-
July 4th, 2005, 05:29 AM
#1
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
Venu Bharadwaj
"Dream it. U can do it!"
-
July 4th, 2005, 07:01 AM
#2
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.
-
July 4th, 2005, 07:10 AM
#3
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
Venu Bharadwaj
"Dream it. U can do it!"
-
July 5th, 2005, 08:40 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|