|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GridView: Show SELECT button in certain rowsI would like to have the SELECT button displayed in certain rows
depending on the value of a particular column in the GridView control.
If the value in that column is true, I would like the SELECT button to
be displayed. Otherwise, I don't want the SELECT button to show.
I converted all fields into TemplateField and have been trying to use the RowCreated event to determine when to display the SELECT button. So far I have no luck in accessing and evaluating the value of that particular column. Is there a way that I can do this? -- marlin ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------ The GridViewRow has a DataItem property which is a reference to the row of
data it was built from. Use DataBinder.Eval() to access the data you need form the original data source to determine if the button should be visible or not. -Brock http://staff.develop.com/ballen Show quoteHide quote > I would like to have the SELECT button displayed in certain rows > depending on the value of a particular column in the GridView control. > If the value in that column is true, I would like the SELECT button to > be displayed. Otherwise, I don't want the SELECT button to show. > > I converted all fields into TemplateField and have been trying to use > the RowCreated event to determine when to display the SELECT button. > So far I have no luck in accessing and evaluating the value of that > particular column. > > Is there a way that I can do this? > > -- > marlin > ---------------------------------------------------------------------- > -- > Posted via http://www.codecomments.com > ---------------------------------------------------------------------- > --
Problems with webcontrol and MultiView
Relative Positioning & Fixed Sizing in ASCX Controls ObjectDataSource - query being performed twice per page load? RowDataBound bool to string Disable a button in Javascript disables server-side code How Do I Pass Bindingsource to Another form. context is null in my TypeConverter.ConvertFrom() method Nested UserControl Problem how to introduce a lot of users? Update From DropDownList in DetailView |
|||||||||||||||||||||||