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

Bind column on different collection

6 Answers 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jerome
Top achievements
Rank 1
Jerome asked on 26 Apr 2011, 10:56 PM
Is there a way to bind my gridview columns to different collections? I looking for independant column binding.

Something like :

GridView1.Columns(0).ItemsSource = colA
GridView1.Columns(1).ItemsSource = colB

Thanks



6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 27 Apr 2011, 07:03 AM
Hi Jerome,

Generally, each column requires a DataMemberBinding, not defining an ItemsSource (an exception is the GridViewComboBoxColumn, which need a source collection). Consequently, you cannot specify a source for each column, but on the RadGridView. 
So, in order to provide you with a more detailed solution, I would need a bit more information about your exact scenario and settings. Is it not appropriate to gather the two collections into one and set it as ItemsSource of the grid ?
 

Greetings,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Greg
Top achievements
Rank 2
answered on 05 Jul 2011, 08:14 PM
Hello,

I'm looking for this type of solution as well. I have a radGridView with two columns Property and Value. I'd like to bind the Property column as a read only list of table fields. Then I'd like to match the table fields to the table data in the value column. In addition some but not all of the value fields should be read only. Also, it would be nice if I could display a drop down grid that contains a bound object for example the attributes of Type. In this example Type is related to original object and rather than just displaying a single bound value it would be nice to display the full attributes of the related item.

Example:
Property     Value
MyID             1
Name          asdf
Type           mytype
                      > > > >
                       Property              Value
                       Type.Name          asdf
                       Type.attribute1    asdf
                       etc...
0
Pavel Pavlov
Telerik team
answered on 06 Jul 2011, 08:50 AM
Hello Greg,

Your description makes me believe you need a RadPropertyGrid.

Kind regards,
Pavel Pavlov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Greg
Top achievements
Rank 2
answered on 14 Jul 2011, 03:52 PM
Okay, I've just upgraded to the new release and there isn't much in the way of examples on using the new Property Grid. Any chance you can provide a small example of the situation described in my previous post? Is it possible to have two XAML bindings? One for the property and one for the value? I'd like the properties column to be read only. I'd like to include combo boxes and a calendar on some of the value fields as well as mark a couple of them as read only. Is this something that is typically done in the code behind and less in XAML? I'm also not planning on using the Description panel and I'm working on overriding it to remove it from being seen at all.
0
Maya
Telerik team
answered on 15 Jul 2011, 01:58 PM
Hi Greg,

Please take a look at our online documentation for additional reference on the RadPropertyGrid control. Considering hiding the DescriptionPanel, you may set the DescriptionPanelVisibility property of the RadPropertyGrid to "Collapsed".
 

Greetings,
Maya
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Greg
Top achievements
Rank 2
answered on 15 Jul 2011, 03:20 PM
Maya,

Thank you for responding to my post. Yes, I have looked at the online documentation. However, as I mentioned in my previous post there really isn't much there. Would it be possible to provide an example oh how to implement the property grid in the manner I've described in the thread above in this topic?

As for the DescriptionPanel there is another thread that discuss it's visibility in more detail.

Sincerely, Greg
Tags
GridView
Asked by
Jerome
Top achievements
Rank 1
Answers by
Maya
Telerik team
Greg
Top achievements
Rank 2
Pavel Pavlov
Telerik team
Share this question
or