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

[Solved] Visible(false) = missing from dom

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Doug
Top achievements
Rank 1
Doug asked on 19 Feb 2010, 03:31 AM
I need to include the identity column in the grid so I can RESTfully edit/delete/etc unfotunately when I include the column with visible(false) the column isn't rendered.

            colums.Add(o => o.er_id).Visible(false);
            colums.Add(o => o.er_company).Title("Company").Filterable(false);
            colums.Add(o => o.er_code).Title("Code").Filterable(false);
            colums.Add(o => o.er_description).Title("Description").Filterable(true);
            colums.Add(o => o.er_otoverride).Filterable(true);

renders

<tr class=" ">
   <td style="">REG</td>
   <td>REG</td>
   <td>Descr</td>
   <td>1</td>
</tr>

Changing visible(true) does send the column. I will work around this for now by adding some javascript to hide the field. Doesn't make sense to me to have visible if it means "don't send".



1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 19 Feb 2010, 08:20 AM
Hi Doug,

Indeed by design invisible columns are not output at all. This feature was considered for a different purpose - hiding certain columns for security reasons. If the column were in DOM malicious user would be able to show it or read the data.

Anyway you can use the rowDataBound client-side to retrieve any data from the data item. Or check this forum thread for a working solution on hiding columns.

I hope this helps,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Doug
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or