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

GridDataItem - Text is Empty when Visible = false

6 Answers 620 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lars
Top achievements
Rank 1
Lars asked on 03 Apr 2013, 03:13 PM
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.

KR

Lars






6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Apr 2013, 04:55 AM
Hi,

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

Thanks,
Shinu.
0
Andrea
Top achievements
Rank 2
Iron
answered on 04 Apr 2013, 09:42 AM
0
Lars
Top achievements
Rank 1
answered on 04 Apr 2013, 10:04 AM
OK, thanks i didn't read this.
0
Bruno
Top achievements
Rank 1
answered on 07 Apr 2013, 10:55 PM
Has this been fixed now at the latest release 
0
Andrey
Telerik team
answered on 10 Apr 2013, 05:36 AM
Hi,

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,
Andrey
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.
0
Christophorus Donny
Top achievements
Rank 1
answered on 24 Aug 2017, 06:49 AM

Hi

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

 

Thanks,

Hsn

Tags
Grid
Asked by
Lars
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Andrea
Top achievements
Rank 2
Iron
Lars
Top achievements
Rank 1
Bruno
Top achievements
Rank 1
Andrey
Telerik team
Christophorus Donny
Top achievements
Rank 1
Share this question
or