I'm using the RadGrid contro and. In the ItemDataBound method I'm trying to get the value of a cell which is boolean and I'm receiving a FormException was unhandled by user code (String was not recognized asa valid Boolean) Error.
The only fields that get this error are the boolean fields. All other returns the text or integer with no problem. One thing that does happen is if in debug mode and I mouse over the variable I see the variable and the value (locked = false).Also if I don't conver the variable the value rturns as " " which is very strange.
Any reason how i can return a boolean value or what needs to be done so i can get the correct value without the error or ?
protected void gridAddendum_ItemDataBound(object sender, GridItemEventArgs e)
{
//Is it a GridDataItem
if (e.Item is GridDataItem)
{
//Get the instance of the right type
GridDataItem dataBoundItem = e.Item as GridDataItem;
var logid = dataBoundItem["LogId"].Text;
var deleted = dataBoundItem["Deleted"].Text; // this is a boolean
var Ownerid = dataBoundItem["OwnerId"].Text;
var locked = Convert.ToBoolean(dataBoundItem["Locked"].Text); // this is a boolean
}
}