This is a migrated thread and some comments may be shown as answers.

RadGrid invisible item value not able to get in Asp.Net backend

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Muttalib
Top achievements
Rank 1
Muttalib asked on 28 Jan 2015, 08:13 AM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Maria Ilieva
Telerik team
answered on 29 Jan 2015, 09:28 AM
Hi Muttalib,

The mentioned behavior appear due to a breaking change that we introduced in Q1 2013 version of the controls. See the link below for more information on this matter:

http://www.telerik.com/forums/breaking-change-hidden-column-cell-text-is-not-persisted-in-viewstate

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Muttalib
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or