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

[Solved] EnableViewstate and SelectedValue Problem

1 Answer 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erin
Top achievements
Rank 1
Erin asked on 21 Apr 2008, 11:56 PM
Hello, I'm having a problem where if I have a grid declared with the EnableViewState property is false, the SelectedValue property is null in the OnNeedDataSource event handler (of the grid where the row was clicked).  If declare the grid with EnableViewState to true, the selectedvalue has the appropriate value.

Is this a bug or am I doing something wrong?  I'm using the release version of the grid...

Thanks

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 22 Apr 2008, 07:15 AM
Hi Erin,

The grid should be populated in order to access SelectedValue - OnNeedDataSource is too early for this. You can use OnPreRender instead.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Erin
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or