kukxxoqmfb
New Member
I have a datagrid and want to format the data with my own method. <BR><BR>Instead of {0:##?##-###} or something like that I wnat to do:<BR><BR>myMethod({0}) and get a string back after running my method.<BR><BR>can this be done?It can be done in a templated DataGrid. To see how to create a templated DataGrid, read:<BR>http://aspnet.4guysfromrolla.com/articles/061002-1.aspx<BR><BR>In your ItemTemplate, you just do:<BR><BR><%# YourFunction(DataBinder.Eval(Container.DataItem,"ColumnName")) %><BR><BR>then, in your ASP.NET Web page you create a function like:<BR><BR>Function YourFunction(input as String) as String<BR> 'Do whatever you want here, returning the<BR> 'particular string you wish to return, where<BR> 'the variable input is the value of the particular db value<BR>End FunctionI kept looking at the template column, but had a freeze thinking I need it to be Bound to get the data. Thanks a ton!THanks again...would this method be preffered over making this function call at the dataset level prior to populating the datagrid?