Hi,
I am using radgrid and edit form as a user control.
I want to find either user clicked on "Edit" or "add new record" link inside "OnEditCommand Method".
coz i want to hide insert button (which is present inside edit user control) when user clicks on "edit" link.
and
hide update button (which is present inside edit user control) when user clicks on "add new record" link
I used foll. code, but its not working correctly.
If condition is TRUE for both Edit and add clicks.
I am using radgrid and edit form as a user control.
I want to find either user clicked on "Edit" or "add new record" link inside "OnEditCommand Method".
coz i want to hide insert button (which is present inside edit user control) when user clicks on "edit" link.
and
hide update button (which is present inside edit user control) when user clicks on "add new record" link
I used foll. code, but its not working correctly.
If condition is TRUE for both Edit and add clicks.
protected void rdgrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
((Button)(userControl.FindControl("btnInsert") as Button)).Visible = false;
((Button)(userControl.FindControl("btnUpdate") as Button)).Visible = true;
}
}