I've a problem with radGrid.
If I hide a column in PreRender event using Me.Grid1.MasterTableView.RenderColumns(3).Visible = False, when I try to retreive the value in ItemDataBound event, the value is
If the column is visible, the value is shown correctly.
I've recently updated Telerik from 2009.3.1314.35 to 2014.3.1209.35.
Before this update, everything was working well
I work with VS 2013.
5 Answers, 1 is accepted
I found a solution by myself:
in the ItemDataBound event, I can use e.Item.DataItem(..columnname..) instead of e.item.cells(3).text, where 3 is the index of "columnname".
Even if the column is hidden, the DataItem is populated correctly.
But if there is a better solution....
If you update to our latest versions you could add the following in your web.config file and it will revert back the previous behavior of the hidden columns:
Another option is to set the Display property of the column to "false", instead of the Visible property.
Telerik by Progress
Wow Konstantin, your web.config solution works well!!!!
Before my post, I tried to use display instead of visible without results.
But inserting the new key in web.config as you suggested, the grid works correctly as previous Telerik version!
Thank you very much.
Hi Telerik Team,
Adding this config is the right solution? and are we missing any performance improvement done in latest releases?
What is better solution except this config change?
We are upgrading RadControls 2011 to 2017
You can find detailed info about this improvement in the following post:
Here is a clarification about the Visible and Display properties:
1. When hiding a column using Visible="false", it won't be rendered at all. No info is sent about this column to the client-side. To make it visible again, you will need to make a PostBack or AJAX request back to the server.
To access record values on code-behind, which are not displayed to the user, you can use e.Item.DataItem object during the ItemDataBound event handler or the DataKeyNames collection of the MasterTableView tag in combination with GetDataKeyValue method. These approaches are explained with examples in the following section:
I hope this will prove helpful.
Telerik by Progress