Datagrid help
-
Hello All, Thanks for reading this. Here is my issue. I have a datagrid which needs to show 3 columns from my database stored procedure. Lets say the stored proc returns a dataset with 3 columns A,B,C. In my datagrid I want to show columns A and B and keep column C invisible. No big deal right ? Okay here is the tricky part. If value of the data row for column C="General" then i want to make the entire row color Red(or the text color to turn red preferably) for that record.If the value of column C="Personal" i want the rowtext to remain black..but now i want to show a "Delete" hyperlink there, lets say clicking on it makes it go to another page.The "delete" hyperlink should not appear when the column C value is "General". I know the "Delete" hyperlink we can add as a column which is not visible, but cannot seem to figure the mechanics of it. How do I go about it ? All help is greatly appreciated. Code samples much more appreciated !!! Regards RH
-
Hello All, Thanks for reading this. Here is my issue. I have a datagrid which needs to show 3 columns from my database stored procedure. Lets say the stored proc returns a dataset with 3 columns A,B,C. In my datagrid I want to show columns A and B and keep column C invisible. No big deal right ? Okay here is the tricky part. If value of the data row for column C="General" then i want to make the entire row color Red(or the text color to turn red preferably) for that record.If the value of column C="Personal" i want the rowtext to remain black..but now i want to show a "Delete" hyperlink there, lets say clicking on it makes it go to another page.The "delete" hyperlink should not appear when the column C value is "General". I know the "Delete" hyperlink we can add as a column which is not visible, but cannot seem to figure the mechanics of it. How do I go about it ? All help is greatly appreciated. Code samples much more appreciated !!! Regards RH
You need to investigate teh ItemDataBound event of teh dataGrid class... This site: http://www.datagridgirl.com/articles.aspx[^] has loads of links and articles on the datagrid. So does this one (and a lot else besides): http://www.4guysfromrolla.com/[^]