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

RadGridView - Tabs in Row details

8 Answers 124 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ronald
Top achievements
Rank 1
Ronald asked on 05 Jun 2012, 07:47 AM
Hi,

I have a RadGridView setup similar to the GridView FirstLook sample in the Telerik online demos.  There is a RadTabControl inside the row details.  How do I change the Header of one of the Tab Items based on the category of the record/row?  Also, in the row details, I'll be adding another GridView where the data, including the columns, will be different depending on the category of the record.  How can I do this?

Thanks.

8 Answers, 1 is accepted

Sort by
0
Eduan
Top achievements
Rank 1
answered on 24 Jun 2012, 09:20 AM
I have the same scenario and could not yet find a solution that works 100%.
I follow the MVVM pattern so each RadTabItem in my RadTabControl points to a seperate View.
I then bind an ObservableCollection property in each Views ViewModel to the data collected on the LoadingRowDetails event using EventToCommand.

The problem I am having is that if more than one row has its RowDetails visible the rowdetails get populated with the same data in both rows.

And help would be much appreciated
0
Maya
Telerik team
answered on 25 Jun 2012, 06:44 AM
Hi Eduan,

Could you provide a bit more details about the way you handle LoadingRowDetails event ?
Generally, the data context of the RowDetails is the corresponding row, so if you check its Item, you will be able to define which data to load in the details. 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Eduan
Top achievements
Rank 1
answered on 25 Jun 2012, 06:56 AM
I managed to resolve my problems by using the ViewModel of the Gridview as the DataContext of my Views that acts as content to the TabItems.
0
Ronald
Top achievements
Rank 1
answered on 26 Jun 2012, 08:04 AM
Hi Eduan, Maya,

I'm also using MVVM but I'm still new to Silverlight and thus MVVM.  I'm binding my LoadingRowDetails event of the GridView to a Command in my ViewModel.  How do I get the ID (or any other value) from the parent record and pass it to my Command to populate my RowDetails?

The other issue I'm trying to figure out is how to load my may GridView on Load.  How do I execute a Command on Load?

Thanks,
Ronald
0
Maya
Telerik team
answered on 26 Jun 2012, 08:10 AM
Hello Ronald,

Generally, you can follow the approach illustrated in this article for getting the arguments of the event. However, I would recommend you to take a look at our demos and follow the idea of performing all that logic at the data layer - since the data contest of the row details is the corresponding item, you can just bind the elements in them to a property from the parent item.
Still, let me know in case you need any further assistance.

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ronald
Top achievements
Rank 1
answered on 26 Jun 2012, 08:26 AM
Thanks Maya,

The thing is I have a GridView in the RowDetails of which I want to populate only when the RowDetails is visible or opened.  Depending on a value on the parent record, the details GridView will be populated using different datasource.  I'm currently using the approach of MVVM in the article below:
http://www.codeproject.com/Articles/154736/Data-and-Command-Bindings-for-Silverlight-MVVM-App 

I want to bind the LoadingRowDetails event to a Command in my ViewModel but I don't know how to pass a value from the parent record to the Command.  Do you have examples that demonstrate these functionality?

Thanks,
Ronald
0
Maya
Telerik team
answered on 26 Jun 2012, 11:38 AM
Hello Ronald,

You can find the item from the arguments of the LoadingRowDetails event:

var club = e.Row.Item as Club;
 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Sunil
Top achievements
Rank 1
answered on 23 Sep 2012, 07:00 PM
Hi Ronald,

Did you ever get a solution for this. I am have the same scenario.
Tags
GridView
Asked by
Ronald
Top achievements
Rank 1
Answers by
Eduan
Top achievements
Rank 1
Maya
Telerik team
Ronald
Top achievements
Rank 1
Sunil
Top achievements
Rank 1
Share this question
or