Custom Col width from XML file is not working

1 posts, 0 answers
  1. Parthasarathy
    Parthasarathy avatar
    2 posts
    Member since:
    Jul 2011

    Posted 01 Apr 2013 Link to this post

     We need to set the width of the columns in RadGridview from a xml file. It is working fine in WPF datagrid. And also it is working fine in RadGridview in visual studio design mode but in run time the widths are not taken from the xml file. Find the code below

    <?xml version="1.0" encoding="utf-8" ?>  
    <DatagridColumns xmlns="">
        <DatagridColumn Case_ColumnWidth="150" />
        <DatagridColumn Order_ColumnWidth="100" />
        <DatagridColumn IPName_ColumnWidth="150" />

    --RAdGridview code (Main window)
    <Window x:Class="TelerikGridviewColumnWidth.MainWindow"
            Title="MainWindow" Height="350" Width="525">
                <XmlDataProvider x:Key="xmlProvider" Source="XML/data1.xml" XPath="/DatagridColumns/DatagridColumn"/>
            <telerik:RadGridView AutoGenerateColumns="False" >
                    <telerik:GridViewDataColumn Header="Case" Width="{Binding Source={StaticResource xmlProvider}, XPath=//@Case_ColumnWidth}" />
                    <telerik:GridViewDataColumn Header="Order" Width="{Binding Source={StaticResource xmlProvider}, XPath=//@Order_ColumnWidth}" />
                    <telerik:GridViewDataColumn Header="IpName" Width="{Binding Source={StaticResource xmlProvider}, XPath=//@IPName_ColumnWidth}"/>

    Let us know how to configure the column widths from xml file

    Parthasarathy  K.
Back to Top