Welcome Guest Search | Active Topics | Sign In | Register

Check session value on aspx page Options
hp
Posted: Thursday, June 9, 2011 1:41:33 PM
Rank: Newbie
Groups: Member

Joined: 5/26/2011
Posts: 2
Hi,
I want to hide certain grid columns based on session values. Something like this

<eo:CheckBoxColumn Width="20" AllowResize="false" DataField="media_orig_id" Visible="<%= Session["App_Role"].ToString().ToUpper()=="AGENCY"%>">
</eo:CheckBoxColumn>

How can I do this. This is giving error.

Thanks
eo_support
Posted: Thursday, June 9, 2011 1:54:32 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,201
Hi,

You just can not do that. : ) CheckBoxColumn is not a control and it won't take your data binding expressions. If you wish to set the column's Visible property based on whatever logic you have, you would just write code to do it in your code behind. For example,

Code: C#
if (whatever)
  Grid1.Columns[column_index].Visible = false;


Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.