GridDataItem - Text is Empty when Visible = false

7 posts, 0 answers
  1. Lars
    Lars avatar
    22 posts
    Member since:
    Mar 2009

    Posted 03 Apr 2013 Link to this post

    Hi Telerik,

    since the Version 2013.1.220.35 we have a problem accessing data on the "old" way.

    If you have a GridBoundColumn, which is set to Visible=false, the Text Field is not rendered anymore.

    So an access like
    GridDataItem item = e.Item as GridDataItem;
    string Value = item["columnID"].Text;

    does not work anymore. I get a "  " as result.

    I know, that this is not the correct way, to access data. We do it like
    string Value = item.GetDataKeyValue("ID")

    in most scenarios. (<MasterTableView DataKeyNames="ID">) needed of course.

    But is this a feature in the new Version, or is it a bug.
    We have to clear this, because we will have many adaptions in the application, if this is not supported anymore!

    Thanks for your help.



  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Apr 2013 Link to this post


    This is reported as a bug with the latest version of controls. Try setting Display property as false instead and access the column value.

  3. Lars
    Lars avatar
    22 posts
    Member since:
    Mar 2009

    Posted 04 Apr 2013 Link to this post

    OK, thanks i didn't read this.
  4. Bruno
    Bruno avatar
    1 posts
    Member since:
    Nov 2007

    Posted 07 Apr 2013 Link to this post

    Has this been fixed now at the latest release 
  5. Andrey
    Andrey avatar
    836 posts

    Posted 10 Apr 2013 Link to this post


    There is a difference between "Breaking Change" and a "Bug". The difference is that the "Breaking Change" is done intentionally to provide better functionality, but since it is braking the previous functionality we are informing everyone that they may observe such a change and what are the possible ways for the moment.

    On the other hand a bug is unexpected behavior that was not intentionally introduced and that is causing the control to behave abnormally.

    With all this said, the accessing of columns marked as Visible=False won't be possible for future versions as it was done intentionally to increase the performance of the control. More information on what approaches are supported could be found in this sticky thread.

    I hope this information helps to distinguish both terms.

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Christophorus Donny
    Christophorus Donny avatar
    3 posts
    Member since:
    Jun 2016

    Posted 24 Aug 2017 Link to this post


    don't use Visible="false" on your GridBoundColumn/GridNumericColumn.

    try this to hidden your collumn and still get the value :

    RadGrid1.MasterTableView.GetColumn("UniqueName").Display = False




Back to Top