I recently had a project upgraded from Telerik 2009.2.702.35 to 2014.1.403.40. In my RadGrid_ItemDataBound event, I get the values from two of my bound columns and construct a string that I assign to a hyperlink column. Prior to the upgrade, my code worked (and still works in an unconverted version). After the upgrade, my code doesn't seem to work any longer. It looks like one of my bound columns isn't getting assigned a value and contains the blank value default text " " now and I'm not sure why. When I interrogate the item row variable, I can see the data values in the ItemArray collection, but it doesn't seem to be available to me as a table column value when I try to extract it using the column's UniqueName. In the code snippet below, the second value called "NIIN" is there, but the first value called "PIIN" ,isn't( I've verified that the SQL code that I'm using is extracting a value). I can't explain why some of my bound columns don't contain data any longer and other columns do. Any help that you can provide would be appreciated.
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
if (e.Item.OwnerTableView.Name == "LTC_ITEM")
{
GridDataItem item = (GridDataItem)e.Item;
HyperLink hl = (HyperLink)item["LinkCol"].Controls[0];
if (hl != null)
{
string link = "itemdetail.aspx?PIIN=" + item["PIIN"].Text + "&NIIN=" + item["NIIN"].Text; ;
hl.NavigateUrl = link;
}
LTCHeader header = (LTCHeader)FormView1.DataItem;
if ((header != null) && (header.IsTerminated()))
{
GridDataItem di = (GridDataItem)e.Item;
DataBoundControl minQtyPerOrder = (DataBoundControl)di["MIN_QTY_PER_ORDER"].Controls[0];
DataBoundControl maxQtyPerOrder = (DataBoundControl)di["MAX_QTY_PER_ORDER"].Controls[0];
DataBoundControl maxQtyAvail = (DataBoundControl)di["MAX_QTY_AVAIL"].Controls[0];
minQtyPerOrder.Enabled = false;
maxQtyPerOrder.Enabled = false;
maxQtyAvail.Enabled = false;
}
}
}
}