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

Bug accessing field value from code behind when column is set to visible="false"

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark Kucera
Top achievements
Rank 1
Mark Kucera asked on 16 Apr 2013, 05:56 PM
I just upgraded to 2013.1.403.40, and i have what seems like a bug.  In many places i use a radgrid and create a hidden databoundcolumn like this:

<telerik:GridBoundColumn UniqueName="UpdateProfileActionID"     DataField="UpdateProfileActionID"   Visible="false"/>

And i've always been able in my code-behind to access this value.  This allows me to pass around hidden ID fields usually that can be passed into an edit or delete command without having to make the column visible to the user.  After the 2013.1.403.40 upgrade these values in my code-behind are blank well, "&nbsp;". 

1. is this intended behavior
2. is there a way to make this work like it did before?

I've confirmed that my code behind values are fine when i remove the Visible="false" flag.  So if the column is visible then i can access it in the code-behind.  I the column isn't visible then the value is &nbsp;.

I've now already found two places where this has caused me a problem since upgrading and i'm scared how many other places i'm probably doing this that i haven't found yet.

Thanks!
-Mark

1 Answer, 1 is accepted

Sort by
0
Mark Kucera
Top achievements
Rank 1
answered on 16 Apr 2013, 06:05 PM
Ugh... i just found this...

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

Tags
Grid
Asked by
Mark Kucera
Top achievements
Rank 1
Answers by
Mark Kucera
Top achievements
Rank 1
Share this question
or