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

Selecting a child hierarchy gridview poulate data

1 Answer 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 19 Aug 2014, 03:42 PM
In reviewing the Gridview "First Look" demo for Winforms demo, I saw a feature that I'm looking to implement. The demo does not have a code sample so I'm looking for some assistant on how to do this. Basically, I have a Hierarchy gridview bind to a SQL datasource (I did all this using the property builder).

When I click on the [+] of the parent gridview, it populate the child template gridview. Now, if I click on the row in the child gridview, I want the detail view on my right panel so that I can update/edit the data back to the datasource. Can someone provide some guidance or show me how this can be done?

See attached screen shot of the demo.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 22 Aug 2014, 09:52 AM
Hi Daniel,

Thank you for writing back.

First I want to say that the source code for all the examples is available to our customers. If you open the suite install folder you will notice the Examples directory. The embedded examples are included in the ExamplesCS solution in the QuickStart folder. 

In this case the easiest approach will be to just add RadDataEntry control to the form. Then when a corresponding row is selected you can bind it to the RadDataEntry. This can be achieved in the CurrentRowChanged event:
void radGridView1_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e)
{
    if (e.CurrentRow.ViewTemplate == radGridView1.MasterTemplate.Templates[0])
    {
        DataRowView row = ((DataRowView)e.CurrentRow.DataBoundItem);
        radDataEntry1.DataSource = null;
        radDataEntry1.DataSource = row;
    }
}

I hope this helps. Should you have any other questions do not hesitate to ask.
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or