I have a grid (Silverlight3 built-in) where I build all the columns dynamically by setting the itemssource to a dictionary object. I bind all columns to the same property and then use converters with converter parameter to fetch the correct value from the dictionary.
I want to use the same solution but just with your grid (XamWebGrid). I'm not very familiar yet with your grid so I may be doing things completely the wrong way. I used the Key property of the TextColumn to "bind" the column to a certain property. This works fine first time but on second column I get an error that I must have unique Key names.
Is it possible for me to bind all columns to the same property? I found the ValueConverter and ValueConverterParameter properties of the TextColumn which I can use to achieve the rest of my requirements.
Thanks for this solution. I got it working and I like it a lot more than writing manually the datatemplate string.
Also, here is another thread that talks about doing this with a dictionary of items:
http://community.infragistics.com/forums/t/32460.aspx
-SteveZ
Hi,
Check out the following post which talks about the various ways to achieve this functionality.
http://community.infragistics.com/forums/t/32185.aspx
I was just testing a similar method by manually building the DataTemplate string and then use XamlReader to load it up to the column. However, I don't like this solution very much, it's a dirty workaround :). If I could just hook up the binding in code-behind, like I can do with SL default datagrid, I would be very happy.
Hi anttisimonen,I have created a sample project that uses xamwebgrid to display the columns dynamically. I am using the dictionary object (I saw this methodology on the internet)I customized it to xamwebgrid. The attachment contains the files. My data is in the form of xml.You can modify the xml to load as many no. of columns you require.
Regards,Sreedhar B