Hi all,
I am dynamically generating a RadGrid from code behind, which was perfectly working of retrieving the RadGrid Item data for hidden columns.
But, now I need to upgrade telerik version from "2011.1.413.35" to "2014.3.1209.35".
After doing this upgrade, the above method of retrieving the RadGrid Item data for hidden columns is not working, in other ways I am getting in place of the value.
Here is my sample code to create grid:
I am putting xmldatasource to fill the RadGrid.
radGrid.MasterTableView.Columns.Add(_CreateColumn("ID", "", Unit.Percentage(0), false));
private GridBoundColumn _CreateColumn(string dataField, string text, Unit width, Boolean readOnly)
{
GridBoundColumn boundColumn = new GridBoundColumn();
boundColumn.DataField = dataField;
boundColumn.HeaderText = text;
boundColumn.SortExpression = boundColumn.DataField;
boundColumn.HeaderStyle.Width = width;
boundColumn.ReadOnly = readOnly;
boundColumn.Visible = (width.Value == 0 ? false : true);
return boundColumn;
}.
Sample code to retrieve item value:
RadGrid radGrid = (RadGrid)control;
foreach (GridDataItem grdItem in radGrid.Items)
{
string ID = grdItem["ID"].Text;
}
But the ID = which should be some value which I filled though xmldatasource.
Please provide some bunch of code or any kind of help will be appreciated.
I am dynamically generating a RadGrid from code behind, which was perfectly working of retrieving the RadGrid Item data for hidden columns.
But, now I need to upgrade telerik version from "2011.1.413.35" to "2014.3.1209.35".
After doing this upgrade, the above method of retrieving the RadGrid Item data for hidden columns is not working, in other ways I am getting in place of the value.
Here is my sample code to create grid:
I am putting xmldatasource to fill the RadGrid.
radGrid.MasterTableView.Columns.Add(_CreateColumn("ID", "", Unit.Percentage(0), false));
private GridBoundColumn _CreateColumn(string dataField, string text, Unit width, Boolean readOnly)
{
GridBoundColumn boundColumn = new GridBoundColumn();
boundColumn.DataField = dataField;
boundColumn.HeaderText = text;
boundColumn.SortExpression = boundColumn.DataField;
boundColumn.HeaderStyle.Width = width;
boundColumn.ReadOnly = readOnly;
boundColumn.Visible = (width.Value == 0 ? false : true);
return boundColumn;
}.
Sample code to retrieve item value:
RadGrid radGrid = (RadGrid)control;
foreach (GridDataItem grdItem in radGrid.Items)
{
string ID = grdItem["ID"].Text;
}
But the ID = which should be some value which I filled though xmldatasource.
Please provide some bunch of code or any kind of help will be appreciated.