get cell value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to get the value of a cell if enable and disable a save button based
on the value? WHere can i find a snippet of that?
 
Are you using a datagrid? If so, you can use the ItemDataBound event
of the datagrid. One of the arguments is a DataGridItemEventArgs which
we will refer to as "e". Using this you can reference a cell (0-based
index) with the following:

e.Item.Cells[0].Text (with asp:BoundColumn)

or for a control inside of a template column:

((TextBox) e.Item.Cells[0].FindControl("txtStuff")).Text

If you examine the data here, you can then reference the Enabled
property of the button and have it act accordingly.

Let me know if this helps you.
Thanks,
Ian Suttle
http://www.IanSuttle.com
 
Back
Top