S
Sharon McCarty
Hi everyone , I have a datagrid containing some controls.
The columns are as follows:
---------------------------------------------------
ID |Name |Description |Edit |Delete |
---------------------------------------------------
The Edit and Delete are column buttons. I would like to disable the
delete button as soon as someone clicks on the Edit button (for a
particular row). In the code, I have:
private void somedatagrid_EditCommand(object source,
DataGridCommandEventArgs e)
{
Button b = new Button();
b= (Button)e.Item.Cells[4].FindControl("What is the name of the
control");
b.Enabled = false;
return;
}
I saw this code snippet in the discussion groups, but I would like to
know what I would put in as a parameter for FindControl(). I know
it's supposed to be the id of the control, but I can't seem to find
the id of the delete push button... Can someone tell me where I would
find the id name of the delete button, so I can feed it into the
FindControl parameter?
I've also tried doing: b = (Button)e.Item.Cells[4].Controls[0];
But I keep getting an index out of bounds...
Thanks
Sharon.
The columns are as follows:
---------------------------------------------------
ID |Name |Description |Edit |Delete |
---------------------------------------------------
The Edit and Delete are column buttons. I would like to disable the
delete button as soon as someone clicks on the Edit button (for a
particular row). In the code, I have:
private void somedatagrid_EditCommand(object source,
DataGridCommandEventArgs e)
{
Button b = new Button();
b= (Button)e.Item.Cells[4].FindControl("What is the name of the
control");
b.Enabled = false;
return;
}
I saw this code snippet in the discussion groups, but I would like to
know what I would put in as a parameter for FindControl(). I know
it's supposed to be the id of the control, but I can't seem to find
the id of the delete push button... Can someone tell me where I would
find the id name of the delete button, so I can feed it into the
FindControl parameter?
I've also tried doing: b = (Button)e.Item.Cells[4].Controls[0];
But I keep getting an index out of bounds...
Thanks
Sharon.