Greetings Telerik Community,
I am currently and successfully using the code block below to turn an edit column into a delete column. I do this because my customer wants in-line add and delete but no edit. My issue now is I need to do this for a column that is nested 1 level deep in a hierarchical grid. The column name is "EditColumn2". The problem is this column doesn't appear to exist when the PreRender is called and throws an exception. My guess is it is created on the fly when the expand arrow is clicked. Which event can I use to add a similar code block to so I can apply the same logic to turn an editboundcolumn into a delete column for the nested table?
I am currently and successfully using the code block below to turn an edit column into a delete column. I do this because my customer wants in-line add and delete but no edit. My issue now is I need to do this for a column that is nested 1 level deep in a hierarchical grid. The column name is "EditColumn2". The problem is this column doesn't appear to exist when the PreRender is called and throws an exception. My guess is it is created on the fly when the expand arrow is clicked. Which event can I use to add a similar code block to so I can apply the same logic to turn an editboundcolumn into a delete column for the nested table?
protected void GridPreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in MaintGrid.MasterTableView.Items)
{
ImageButton btn = (ImageButton)item["EditColumn"].Controls[0];
btn.CommandName = "Delete";
btn.ToolTip = "Delete";
btn.ImageUrl = "~/Stylesheets/Images/Delete3.gif";
btn.OnClientClick = "javascript:if(!confirm('Are you sure you wish to delete this record?')){return false;}";
}
}