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

Focus 1st Row in RadGrid

7 Answers 255 Views
GridView
This is a migrated thread and some comments may be shown as answers.
GOPI S
Top achievements
Rank 1
GOPI S asked on 15 Mar 2011, 05:51 AM
Hi,
I am using Radgridview which is placed inside the childwindow ,so whenever the window is opened the 1st record in the gridview should be active(ie focus and default selection should be on 1st row of GridView )

so that if i am pressing down arrow the next record should be highlighted ,I should not use mouse to select the record

please help me in this ,the default selection and focus should be set on 1st of GridView

7 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 15 Mar 2011, 09:41 AM
Hello GOPI S,

You may set the IsSynchronizedWithCurrentItem property of the grid to "True". 
 

Kind regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
GOPI S
Top achievements
Rank 1
answered on 15 Mar 2011, 10:02 AM
Hi Thanks ,
But i think my problem is different

I am having one gridview in child window which is also having textbox at the top ,when i am opening the child window the focus has been set for gridview ,so when i am pressing tab key the 1st row of the grid view is getting focused ,once it get focused when i am pressing down arrow the next record is get highlighted .

But for me instead of setting focus on Grid view and pressing tab to highlight 1st Row ,I need to set focus directly on 1st row,I should not use Tab for moving to Rows ...


I think i am clear now

Thanks In advance
0
Maya
Telerik team
answered on 15 Mar 2011, 11:10 AM
Hi GOPI S,

As you have a TextBox as well, you will have to set the focus explicitly to the RadGridView. You may refer to the sample project attached for a reference.
 

Best wishes,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
GOPI S
Top achievements
Rank 1
answered on 15 Mar 2011, 11:22 AM
Hi Thanks ,
 for the Demo ,But demo is not working fine ,it's working fine in some random order ,
0
Maya
Telerik team
answered on 15 Mar 2011, 03:25 PM
Hi GOPI S,

May you provide a bit more details ? What do you mean by "not working fine" ? Do you get any exceptions ?

All the best,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
GOPI S
Top achievements
Rank 1
answered on 16 Mar 2011, 05:15 AM
Hi Thanks for Reply,
I told that is working but not everytime ,sometime the focus has been set for textbox ,sometime its on RadGrid

But i have added tabindex="0" for
RadGridView  
so it's working Fine for Me now

thanks ,

But the same is not working if we are placing that inside
BusyIndicator 



 <controlsToolkit:BusyIndicator >
        <Grid x:Name="LayoutRoot" Margin="2">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition/>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBox Width="100" Height="25" Margin="155,52,123,54"   />
            <telerik:RadGridView  TabIndex="0" IsSynchronizedWithCurrentItem="true" Grid.Row="1"   Name="ResultsGridView" Height="340" Width="400" HorizontalAlignment="Left" CanUserFreezeColumns="False" CanUserResizeColumns="True"
ScrollMode="RealTime" IsReadOnly="True"
IsFilteringAllowed="False" 
VerticalAlignment="Top" Margin="0,10,0,0"
                        
 >

                <telerik:RadGridView.Columns >

                    <telerik:GridViewDataColumn Width="Auto" DataMemberBinding="{Binding FirstName}"    Header="First Name"  />
                    <telerik:GridViewSelectColumn IsVisible="False" />
                    <telerik:GridViewDataColumn Width="*" DataMemberBinding="{Binding LastName}" Header="Last Name" />
                </telerik:RadGridView.Columns>

            </telerik:RadGridView>
        </Grid>
    </controlsToolkit:BusyIndicator>
0
Maya
Telerik team
answered on 16 Mar 2011, 01:25 PM
Hi GOPI S,

Is it not appropriate for you to call the Focus() method for the grid as demonstrated in the sample project ? 

Greetings,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
GOPI S
Top achievements
Rank 1
Answers by
Maya
Telerik team
GOPI S
Top achievements
Rank 1
Share this question
or