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

GridView focus lost when BusyIndicator is not busy

3 Answers 29 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 06 Nov 2013, 08:03 PM
The BusyIndicator content is a control with Gridviiew and MyDetailsViewControl that bound to selected record (in ViewModel)
When GridView selection changed selected record changed, then BusyIndicator.Busy bound to VM property set to true, then an asynchronous call is made and when it is complete IsBusy set to false.

Used this (http://www.telerik.com/help/silverlight/radbusyindicator-how-to-restore-the-focus.html) method to return focus to the grid
(in fact it's a GriidViewCell) with no success.

Anyone done that?

3 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 11 Nov 2013, 01:12 PM
Hi Sergey,

The focus is not going into the Cell as the Cell is not in edit mode. So you will have to set the IsInEditMode property of the GridViewCell to true and Focus it afterwards. Please see the code snippet below which shows how the IsEnabledChanged event handler should be set up:

private void focusedElement_IsEnabledChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
{
    (this.focusedElement as GridViewCell).IsInEditMode = true;
    this.focusedElement.Focus();
             
    this.focusedElement.IsEnabledChanged -= focusedElement_IsEnabledChanged;
}

Hope this works.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sergey
Top achievements
Rank 1
answered on 12 Nov 2013, 02:36 PM
Hi Kalin,
I solved my problem by taking out RadBusyIndicator CONTENT out of it (above in XAML)
Not sure if there will be any "side effects" - did not notice any so far.

before
<RadBusyIndicator>
    <RadGridView\>
<\RadBusyIndicator>
after
<RadGridView\>
<RadBusyIndicator\>

I will try your solution when I can.
Thank you,
Sergey
0
Sergey
Top achievements
Rank 1
answered on 12 Nov 2013, 05:47 PM
One other thing.
Setting GridViewCell edit mode might be not a solution.
In my case the Grid is in read only mode.
Setting edit mode before setting focus and resetting it back will not set the focus.

There is another way (that works)

Find GridView Ancestor (using VisualTreeHelper) and set focus to it.
Tags
BusyIndicator
Asked by
Sergey
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or