RadGridView - Tabs in Row details

9 posts, 0 answers
  1. Ronald
    Ronald avatar
    1 posts
    Member since:
    Apr 2011

    Posted 05 Jun 2012 Link to this post

    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.
  2. Eduan
    Eduan avatar
    5 posts
    Member since:
    Jun 2012

    Posted 24 Jun 2012 Link to this post

    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
  3. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 25 Jun 2012 Link to this post

    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 >>

  4. Eduan
    Eduan avatar
    5 posts
    Member since:
    Jun 2012

    Posted 25 Jun 2012 Link to this post

    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.
  5. Ronald
    Ronald avatar
    19 posts
    Member since:
    Jun 2012

    Posted 26 Jun 2012 Link to this post

    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
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 26 Jun 2012 Link to this post

    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 >>

  7. Ronald
    Ronald avatar
    19 posts
    Member since:
    Jun 2012

    Posted 26 Jun 2012 Link to this post

    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
  8. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 26 Jun 2012 Link to this post

    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 >>

  9. Sunil
    Sunil avatar
    1 posts
    Member since:
    Aug 2011

    Posted 23 Sep 2012 Link to this post

    Hi Ronald,

    Did you ever get a solution for this. I am have the same scenario.
Back to Top