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

[Solved] Cannot set focus on child Grid when expand second time (scenario of hierarchical RadGrid).

1 Answer 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Manas
Top achievements
Rank 1
Manas asked on 23 Jul 2009, 01:02 PM

Hi,

 

I have hierarchical Grid View (Parent and child grid), child grid allows user to enter new row by hitting <INSERT> key. Child grid bind with Loaded event (Loaded="RadGridView_Loaded").

 

When load control first time and expand any parent row by click on pulse (+) sign then fire child grid Loaded event and set focus on child but if I collapse parent row and expand again then does not fire Loaded event, so I can’t set  focus on child grid to add new row by hitting <INSERT> key.

 

If anybody has any way out regarding that, then please guide me.

 

 Thanks.

 

Regards,

Manas

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 28 Jul 2009, 01:32 PM
Hello Manas,

I may suggest the following approach :

Subscribe to ExpanderRowStateChangedEvent the following way:

this.AddHandler(GridViewExpandableRow.ExpanderRowStateChangedEvent, new RoutedEventHandler(OnExpanderRowStateChangedEvent), true); 

This event will fire after the user has pressed the expand button .
Within the event handler you may get acces to the expandableRow this way :

void OnExpanderRowStateChangedEvent(object sender, RoutedEventArgs args)  
        {  
            GridViewExpandableRow expandableRow = ((RadRoutedEventArgs) args).Source  
        } 

After you have got the reference to the expandableRow , you may manipulate it the way you need.


Best wishes,

Pavel Pavlov
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Manas
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or