For changing the color,just change the color in rowdatabound only.It'll suffice your purpose.
After pageload,you must have assigning some datasource.then, your rowdatabound event will be called for each row.In this event,you can modify the color based on the text. After it page will render and your changes will refelct on the screen.
ok, there were two events for the same thing, that why it wasn't triggered. Now its triggered, but for some reason when I am stepping in to the code the label property doesn't get the text. Its left empty.
Here is the code:
i add a TemplateField to gridview programmatically and i add a textbox in it programmatically also
the problem is:
when press on any server side button the data will clear from the gridview and the textboxes not appear to allow me to write in it