Give gridview color based on some condition in datatable
I need to give color of gridview on some condition in datatab开发者_StackOverflow社区le. The column is NOT added in gridview but is present in datatable. It checks that if country is USA the color the row as green.
The setting can be done from gridview row databound but not sure how to access the datatable column in rowdatabound.
Thanks!
You cant access Datatable once u assigned it to grid as Datasource for that column as it is not added to grid. You can add same column in gridview wth visible=false so that u can access it in rowdatabound event of grid and accordingly change color.
Hope this help.
精彩评论