Reputation: 956
I have a datalist that is being bound from a codebehind page (data is coming from a stored procedure). I have one column/field that I need to do some custom formatting and math on before it displays on the front end. What's the easiest way to handle this in .NET?
Upvotes: 0
Views: 109
Reputation: 45096
You could use a class Bind to a List Data and then use the Property Formatted
public class Data
{
private int rawData;
Public Int Raw Data { get { return rawData; } }
Public String Formatted { get { return .... } }
public void Data(int _rawData)
{ rawData = _rawData; }
}
Upvotes: 0
Reputation: 19852
I would use the ItemDataBound
event: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.itemdatabound.aspx
Upvotes: 2