Hi,
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
--data1.xml
--RAdGridview code (Main window)
Let us know how to configure the column widths from xml file
Thanks,
Parthasarathy K.
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
--data1.xml
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
DatagridColumns
xmlns
=
""
>
<
DatagridColumn
Case_ColumnWidth
=
"150"
/>
<
DatagridColumn
Order_ColumnWidth
=
"100"
/>
<
DatagridColumn
IPName_ColumnWidth
=
"150"
/>
</
DatagridColumns
>
--RAdGridview code (Main window)
<
Window
x:Class
=
"TelerikGridviewColumnWidth.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
Grid.Resources
>
<
XmlDataProvider
x:Key
=
"xmlProvider"
Source
=
"XML/data1.xml"
XPath
=
"/DatagridColumns/DatagridColumn"
/>
</
Grid.Resources
>
<
telerik:RadGridView
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
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}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
Window
>
Let us know how to configure the column widths from xml file
Thanks,
Parthasarathy K.