This is a migrated thread and some comments may be shown as answers.

Binding to RadGridView

0 Answers 39 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shivam
Top achievements
Rank 1
Shivam asked on 03 Jan 2012, 08:22 AM
My XElements.Elements()is returning this XML  


<
Student>
  
<Element Name = "abc" Class = "4" Section = "A" />
<Element Name = "abc" Class = "4" Section = "A" />
<Element Name = "abc" Class = "4" Section = "A" />
  
</Student>


and i need to bind this data to the columns of my gridview as shown in XAML :

<telerikGridView:RadGridView.Columns>
                  
<telerikGridView:GridViewDataColumn 
Header="Name" 
Width="*"
IsSortable="True"  
HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}" 
IsReadOnly="False"
 DataMemberBinding="{Binding Name}" />
                 
 <telerikGridView:GridViewDataColumn
 Header="Class" 
Width="*"
 IsSortable="True"
 HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"
 IsReadOnly="False"
 DataMemberBinding="{Binding Class}"/>
                  
<telerikGridView:GridViewDataColumn 
Header="Section" 
Width="*"
 IsSortable="True"
 HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"
 IsReadOnly="False" 
DataMemberBinding="{Binding Section}"/>
  
</telerikGridView:RadGridView.Columns>

I have tried to bind gridview with Xelement.Elements() dynamically ..

Number of rows and columns generated are correct but cells are empty. respective attributes of the element are not binded properly.

Is there any binding format or different method to bind attributes of element in XML to  gridview ??

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Shivam
Top achievements
Rank 1
Share this question
or