Khurram Ilyas
Top achievements
Rank 1
Khurram Ilyas
asked on 24 Mar 2010, 03:52 PM
How to select the first by default when grid is loaded.
6 Answers, 1 is accepted
0
Hi Khurram Ilyas,
Greetings,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
public
MainPage()
{
InitializeComponent();
this
.RadGridView1.DataLoaded +=
new
EventHandler<EventArgs>(RadGridView1_DataLoaded);
}
void
RadGridView1_DataLoaded(
object
sender, EventArgs e)
{
this
.RadGridView1.SelectedItem =
this
.RadGridView1.Items[0];
}
Greetings,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Khurram Ilyas
Top achievements
Rank 1
answered on 25 Mar 2010, 07:27 AM
Hi Pavel Pavlov
can we do this in xaml i mean is there any property for this. ?Thanks,
Saqib Ali
0
Hello,
You can bind SelectedItem to your view model:
<telerikGrid:RadGridView SelectedItem="{Binding YourViewModelSelectedItemProperty, Mode=TwoWay}" ...
Sincerely yours,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You can bind SelectedItem to your view model:
<telerikGrid:RadGridView SelectedItem="{Binding YourViewModelSelectedItemProperty, Mode=TwoWay}" ...
Sincerely yours,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Marc Roussel
Top achievements
Rank 2
answered on 01 May 2013, 12:26 PM
The line is grey but not like when I click it which is highlighted.
I have put this in DataLoaded :
I have put this in DataLoaded :
if
(rgvExpenses.Items.Count > 0)
{
rgvExpenses.CurrentItem = rgvExpenses.Items[0];
this
.Dispatcher.BeginInvoke(() => { rgvExpenses.SelectedItem = rgvExpenses.Items[0]; });
}
0
Hello,
Didie
the Telerik team
With Q2 2012 we have introduced a new Unfocused state for GridViewRow which will be shown when the GridView is out of focus. You can check this help article for a reference.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Marc Roussel
Top achievements
Rank 2
answered on 01 May 2013, 03:50 PM
Thank you :)