471,337 Members | 1,179 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

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

Hi,

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

Thanks,
Gidi.
Jan 28 '06 #1
1 2146
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.

Similar topics

reply views Thread by Marcel | last post: by
reply views Thread by sapo | last post: by
2 posts views Thread by tungchau81 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.