By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 IT Pros & Developers. It's quick & easy.

Disable editing of one specific cell in one specific row in dataGr

P: n/a
Hi,

Is it possible to Disable editing of one specific cell in one specific row
in dataGrid?

Thanks,
Gidi.
Jan 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In your handler for the DataGrid OnItemDataBound event, do something like this:

if(e.Item.ItemIndex == myDataGrid.EditItemIndex)
{
TextBox t = (TextBox)e.Item.FindControl("TextBox2");
if(t != null && t.Text == "TESTVALUE")
e.Item.Cells[2].Text= "TESTVALUE";
}

That will replace the edit contents of that single cell with the text for
the field value.

You'll have to do a comparable test in your handler for OnUpdateCommand
because TextBox.Text for the cell you changed will have unexpected contents
(an empty string in my test).
HTH
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Gidi" wrote:
Hi,

Is it possible to Disable editing of one specific cell in one specific row
in dataGrid?

Thanks,
Gidi.

Jan 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.