Click here to Skip to main content
13,255,974 members (50,033 online)
Rate this:
Please Sign up or sign in to vote.

In our current project we are using telerik rad controls for developing silverlight project,
according to logged-in user the columns are displayed on the datagrid, for some of the users some grid columns are set to invisible, which is leading to a gap between columns ,when the user is logged-in the space between the columns does not look good,
does any one know how to fix this gap, thank you very much.

<telerik:GridViewDataColumn DataMemberBinding="{Binding WeeklyUsage}"                                                                                
Width="84" 												DataFormatString="{}{0:F2}"                         						IsVisible="{Binding IsColumnVisibleToCustomer, Source={StaticResource PFOViewModel}}"
IsReadOnly="True" TextAlignment="Right" HeaderTextAlignment="Center"/>
public bool IsColumnVisibleToCustomer
            get { return !WebContext.Current.User.IsInRole("Customer"); }
public bool IsInRole(string role)
            if ((this.Roles == null))
                return false;
            return global::System.Linq.Enumerable.Contains(this.Roles, role);
Posted 7-Mar-13 12:17pm
Updated 7-Mar-13 12:48pm
ThePhantomUpvoter 7-Mar-13 17:21pm
If you are having a problem with Telerik controls, why are you not talking to them about it?
richcb 7-Mar-13 17:22pm
Instead of visibility, can you alter the display and set it to none? That way it does not take up space on the page.
Member 9857060 7-Mar-13 17:24pm
well i am using a converter to hide the columns according to the user...
richcb 7-Mar-13 17:25pm
You might need to post your code so others can take a look.
Member 9857060 7-Mar-13 17:43pm
<telerik:GridViewDataColumn DataMemberBinding="{Binding WeeklyUsage}"Width="84" DataFormatString="{}{0:F2}" IsVisible="{Binding IsColumnVisibleToCustomer, Source={StaticResource PFOViewModel}}"IsReadOnly="True" TextAlignment="Right" HeaderTextAlignment="Center"/>

public bool IsColumnVisibleToCustomer
get { return !WebContext.Current.User.IsInRole("Customer"); }
Member 9857060 7-Mar-13 17:49pm
I updated my question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171114.1 | Last Updated 7 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100