Here what I need to do:
I have a ObservableCollection collection say
ObservableCollection<Myclass>. where MyClass has properties
Name,Id and CustomDto.
I want to bind this ObservableCollection to the grid where I will have 3 columns for Name , Id and
Description where the description from my CustomDto.
Any help will be appreciated.
If CustomDto is an object with a property on it that has the text you want to show then your column would look something like this.
<ig:TextColumn Key="CustomDto.PropertyWhereTextValueIs" HeaderText="Description"></ig:TextColumn
>
It's not clear on what you are asking.
If you have a collection you would set it to the .ItemSource of the grid and as long as you have AutoGenerateColumns set to true (the default value) you should see a column for each public property off the data object.
The Header text of that column will be the name of the property. So in your case I would expect to see a column called Name, Id, and CustomDto.
Now if you want to change the header text, off the column object is a HeaderText property, which can be set up in Xaml very easily with Xaml similar to this.
="false">
It didn't fix my problem. Please see the text in bold
3rd column of the grid is Description which is the property of CustomDto
Hello laxmanrawat,
here is a link from our online documentation that will help you to understand how to bind a XamGrid to ObservableCollection<T>
http://help.infragistics.com/NetAdvantage/Silverlight/2010.2/CLR4.0/?page=SL_xamGrid_Data_Binding.html
Hope that helps ,
regards Nikola.