Change DataGrid value while associating DataSet
In Windows application, in DataSet, I hv one column “Status”. This will have the value ranging from 1 to 5.
While displaying content of this DataSet in DataGrid, “Status” value should be converted into meaningful text like
1 = “New”, 2 = “Open” … 5 = “Closed”
Can you please shed any light on achieving this.
thanks
Venu
Re: Change DataGrid value while associating DataSet
Try modifying the information in your dataset with the appropriate string values before binding it with the datagrid.
Re: Change DataGrid value while associating DataSet
DataSet is associted with the XML schema (i'm reading the data from XML source) and it 'll not allow me to change the content to different datatype
Re: Change DataGrid value while associating DataSet
write that logic inside the ItemDataBound event of the datagrid which is called before the data is bound to the grid.
This event is called once for every record bound to the grid.So check for the value in the required column,if it is 1 then set it to "one" or whatever text you want to.When the record is bound to the grid it will have this text value insetad of the previous number.