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

Child Row Selection

2 Answers 30 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Claude
Top achievements
Rank 1
Claude asked on 08 Jul 2014, 08:46 PM
I am trying to obtain the value of a cell in the current selected row in the child grid.  There is no problem in getting that in the Parent using the CurrentRow, but I do not see CurrentRow in the Child as an option.

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Jul 2014, 06:51 AM
Hello Claude,

Thank you for writing.

CurrentRow is one for the whole grid no matter parent or child, so you can use this property to access the current row.

I hope this helps.

Regards,
Stefan
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.
 
0
Ryda
Top achievements
Rank 1
answered on 31 Jul 2014, 11:13 AM
Hi Claude,

i faced  the same problem 

Do you use a bindingsource?

i wanted to display the value of the current row in separate textboxes  and i known which type i get back from the row so i used this code.

void rgvData1_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e)
        {
                    if(e.CurrentRow != null){
                if (e.CurrentRow.DataBoundItem != null && (e.CurrentRow.DataBoundItem.GetType().BaseType == typeof(EtNewsletterOffer) || e.CurrentRow.DataBoundItem.GetType() == typeof(interfaceLibrary.EtNewsletterOffer)))
                {
                    this.etNewsletterOfferBindingSource.DataSource = e.CurrentRow.DataBoundItem;
                }
}
}

maybe this helps.
Tags
GridView
Asked by
Claude
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ryda
Top achievements
Rank 1
Share this question
or