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

can't set SelectedItem

1 Answer 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
igal a
Top achievements
Rank 1
igal a asked on 11 Dec 2009, 07:06 PM
SelectedItem is null after set

i checked why it happened and appearently there was a problem inside
Telerik.Windows.Data.Dll
in the class
DataControl

on the  SelectedItem Property
inside the

ItemCoerce function

the Items.CollectionView is null so it doesn't seceed with the IndexOf
and nothing is selected

now it all happens because the Items.CollectionView is null
i also tried to set the ItemSource & DataContext Before the assigment of selectedItem
but it didn't helped

what should i do to make it work?

thanks

1 Answer, 1 is accepted

Sort by
0
igal a
Top achievements
Rank 1
answered on 12 Dec 2009, 12:03 PM
the solution is to call
RadGridView.OnApplyTemplate();

before setting the itemsource/datacontect/selecteditem

and it will work
Tags
GridView
Asked by
igal a
Top achievements
Rank 1
Answers by
igal a
Top achievements
Rank 1
Share this question
or