Make DataGrid row read-only based on a cell's value

lorena

Centurion
Joined
Oct 23, 2003
Messages
134
Location
Phoenix, Arizona
I have a datagrid for a user to edit records. It will load "ALL", "OPEN" or "CLOSED" records depending on a value selected from a dropdown. With "ALL" and "CLOSED" records, any records that are closed are not (or should not) be available for editing. It will depend on whether or not the cell containing the close date has a value.
Is there a way to disable a row when a date is present in the "close date" cell? Thanks in advance.
 
Take a look at the articles here:

http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

In particular Part 8 (as well as being a useful concept in it's own right) covers the item databound event that you need to use. It also covers getting a reference to the delet button. In your case you will want to remove or hide the eidt button based on a test of the data in that row but the principle is similar.

:)
 
Back
Top