I'm implementing an application by using the MVVM pattern and I need to bind a collection to a GridView control.
However, there are some items in the collection which need to be displayed as a single text, so rows bound to those items should be spanned across all the columns of the grid and a specific text must be shown.
Also, they would be ignored when sorting data.
How can I achieve this goal?
I have gridview version 2010.1.309.1030
Thanks.
Regards.
6 Answers, 1 is accepted
I have attached a sample application that demonstrates how this can be achieved. You need a custom row style that will only display a single text field and span all columns. One you have this row style you need a Style Selector that will determine when this special row style should be applied. In my application I am applying this style to all Players that are playing defense.
Greetings,
Milan
the Telerik team
thanks for the example, but I'm using silverlight 3 with Visual Studio 2008. Can I achieve the same goal with this configuration? If not, is there any work around I can consider?
Thanks.
There is no problem to do the same with Silverlight 3 and Visual Studio 2008 - the only requirement is that you upgrade to a more recent release since Style Selectors are not available in 2010.1.309.1030. Will that be convenience for you?
Best wishes,
Milan
the Telerik team
If not possible, what can I do?
Thanks.
I have updated the sample to use our latest Silverlight 3 controls (2010.2.812.1030) and I have also downgraded the project version to Visual Studio 2008.
If upgrade is not possible I guess we can try to implement this feature by using our RowLoaded event and apply the styles there but it would be great if you can upgrade to our latest version.
Kind regards,
Milan
the Telerik team
Again, thanks.
Regards,