![]() |
| ||
| Format single Row in datagridview using a value in same row I have a simple database that displays information in various datagridview controls on the same form. One thing I would like to do is change the colour of a row if the value from a cell returns "poor", or "fair" I call a private function to go through each row in the datagrid just after it is connected to the bingingSource. I can get it to change the colour, but it formats all the rows with that colour, and I want only the row that returned the value to be changed. private void checkForSurveyColour() Thanks. |
| ||
| Re: Format single Row in datagridview using a value in same row This might help. You shouldnt have to check if its null because if its not equal to Fair or Poor it wont matter. Also, as long as you have a column within the dataview named RepVisits and you know it will be there ever single time, you dont need the try/catch. private void checkForSurveyColour(DataGridView dv) {That is much more compact and I believe it should work the same way. The syntax might not be exactly how it should be but if you use visual studio and use the CTL + SPACE shortcuts after puting a period, it helps a lot in finding the proper method/properties you need.Hope it helped. |
| All times are GMT -4. The time now is 9:25 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC