Hi,
While trying to Insert a row to my grid...(after a successful load and the same code already executed)
In my grids ItemDataBound event, I get the following error:
Unable to cast object of type 'Telerik.WebControls.GridInsertionObject' to type
I use the underlying datasource to retrieve the value for a checkbox and set it T or F.
The code in it
Whilst doing the following...
While trying to Insert a row to my grid...(after a successful load and the same code already executed)
In my grids ItemDataBound event, I get the following error:
Unable to cast object of type 'Telerik.WebControls.GridInsertionObject' to type
I use the underlying datasource to retrieve the value for a checkbox and set it T or F.
The code in it
Whilst doing the following...
if (e.Item is GridDataItem && e.Item is GridEditableItem)
{
GridDataItem item = e.Item as GridDataItem;
CheckBox box = (CheckBox)item.FindControl("chkLstAdd");
Planning.
Task dataSourceRow = (Planning.Task)e.Item.DataItem;
//set custom attributes (i.e the checkbox.checked value) from the datasource:
box.Checked =
false;
if (dataSourceRow.IsTaskAllocated.ToString() == "True")
{
box.Checked =
true;
}
}
Should I not try prevent the "To be inserted row " from executing this code, ? if so How?
ManyThanks
Neal