Gridview CommandField modifying programatically
Mark Aurit <[email protected]> Wed, 28 May 2008 06:38:59 -0700
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Message-ID | <[email protected]> |
Im doing maintenance on a 2.0 app that has a gridview that consists of a
few boundfields and a commandfield.
Based on the value in one of the boundfields, I want to show a different
textual value for the link (not the header).
For example, I can do something like
if (e.Row.Cells[1].Text == "")
e.Row.Cells[2].Text = "Add" //Cells[2] is CommandField
else
e.Row.Cells[2].Text = "Modify"
The problem is that code correctly sets the text, but the value is no
longer hot, its just text.
As best as I can tell, I want to modify the CommandField's HeaderText
SelectText atribute, but I cant figure out how to do this.
Thanks much!
Mark
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com