RadGridView white space between two columns

Mar 8 2013 12:22 PM
Hello,

We are using silverlight 4 and telerik rad controls, in our project  columns visibility is  based on the logged in users. for some users all the columns are visible, and for some users some columns are hidden,  when the columns are hidden is creating a space between the columns in the telerik rad grid view header, it does not look good.

<telerik:GridViewDataColumn DataMemberBinding="{Binding WeeklyUsage}"                                                                                
   Width="84" 
   DataFormatString="{}{0:F2}" 
   IsVisible="{Binding IsColumnVisibleToCustomer, Source={StaticResource PFOViewModel}}"
   IsReadOnly="True" TextAlignment="Right" HeaderTextAlignment="Center"/>

IsColumnVisibleToCustomer is just a bool property. 

I tried using 

<telerik:GridViewDataColumn.CellTemplate>
      <DataTemplate>
         <StackPanel>
              <TextBlock Text="{Binding PlannedQty}" HorizontalAlignment="Stretch" FontSize="10"
       visiblity="{Binding IsColumnVisibleToCustomer, Source={StaticResource PFOViewModel}}"
         FontWeight="Bold" TextAlignment="Right"/>
   </StackPanel>
    </DataTemplate>
 </telerik:GridViewDataColumn.CellTemplate>


But does not work,

will silverlight allow style.triggers. cause i tried using datatrigger but it is not taking them, is there anyway to make them collapsible or make the columns align without any spaces.


thankyou very much