GridViewColumnGroup width?

4 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 02 Dec 2014 Link to this post

    Hi,

    is it possible to set a width of a GridViewColumnGroup? I have to set two groups and each group
    should be 50% width.

    How can i solve this?

    Best Regards
    Rene
  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 02 Dec 2014 Link to this post

    Hi Rene,

    The ColumnGroups' width is determined by the combined width of their child columns. You can set the widths of the child columns so that the two groups accumulate to 50% of the total width each.

    Regards,
    Nick
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 02 Dec 2014 in reply to Nick Link to this post

    Hi Nick,

    thanks, but there is no fix with of the RadGridView, so how can i set the width of the columns? I need to set with in percent!?

    <telerik:RadGridView Grid.Row="2" Grid.Column="0" Margin="10,10,10,0"  FontFamily="Tahoma" FontSize="12" x:Name="radGridView" AutoGenerateColumns="False"  CanUserReorderColumns="False" CanUserInsertRows="False" CanUserDeleteRows="False" ShowColumnFooters="False" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" >
        <telerik:RadGridView.ColumnGroups>
            <telerik:GridViewColumnGroup  Name="Lokal" Header="lokal DB"  />
            <telerik:GridViewColumnGroup  Name="abas" Header="abas-ERP" />
        </telerik:RadGridView.ColumnGroups>
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding AbasID}" Header="abas-ID" IsReadOnly="True" Width="auto" UniqueName="AbasID" ColumnGroupName="Lokal"  />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Versionn}" Header="Versionn" IsReadOnly="True" Width="auto" UniqueName="Versionn" ColumnGroupName="Lokal" />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Feldname}" Header="Feldname" IsReadOnly="True" Width="auto" UniqueName="Feldname" ColumnGroupName="Lokal" />
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Feldwert}" Header="Feldwert" IsReadOnly="True" Width="auto" UniqueName="Feldwert" ColumnGroupName="Lokal" />
     
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Xabasid}" Header="abas-ID" IsReadOnly="True" Width="auto" UniqueName="XAbasID"  ColumnGroupName="abas"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Xversionn}" Header="versionn" IsReadOnly="True" Width="auto" UniqueName="Xversionn"  ColumnGroupName="abas"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Xfeldname}" Header="Feldname " IsReadOnly="True" Width="auto" UniqueName="Xfeldname"  ColumnGroupName="abas"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Xfeldwert}" Header="FEldwert " IsReadOnly="True" Width="auto" UniqueName="Xfeldwert"  ColumnGroupName="abas"/>
        </telerik:RadGridView.Columns>
        <telerik:RadGridView.GroupPanelBackground>               
            <LinearGradientBrush>
                <GradientStop Color="#FF26A0DA"/>
            </LinearGradientBrush>
        </telerik:RadGridView.GroupPanelBackground>
        <telerik:RadGridView.GroupDescriptors>
            <telerik:ColumnGroupDescriptor Column="{Binding Columns[\AbasID\], ElementName=radGridView}" SortDirection="Ascending"  />
        </telerik:RadGridView.GroupDescriptors>
    </telerik:RadGridView>

    Thanks
    Rene
  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 02 Dec 2014 Link to this post

    Hi Rene,

    You can use the Star widths with equal proportional values. 

    Four columns would each have 0.25* width. Five would have 0.20* each.


    Regards,
    Nick
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top