Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

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.

C#
<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
Updated 7-Mar-13 11:48am
v2
Comments
[no name] 7-Mar-13 17:21pm    
If you are having a problem with Telerik controls, why are you not talking to them about it?
Richard C Bishop 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...
Richard C Bishop 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"); }
}

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900