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

Can't Get Grid to 'reset' on ComboBox Selector Change

1 Answer 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 2
Kevin asked on 25 Mar 2009, 11:27 PM
I am using the advanced databinding technique (OnNeedDataSource) in a grid that is in a user control, inside a splitter pane, and controlled by a combobox.  Fun!

User control has a combobox and grid in it, and when an item is selected from the combobox it causes the grid to be re-filled with that combobox item as a filter of sorts.

Used to be, the filtering worked but when I did any paging on the grid, the grid disappeared!  It looks like to correct that issue I need to take the advanced databinding technique using the OnNeedDataSource.  So I've done that and now the grid does not disappear when paging.

However, what I'm seeing is that when I do paging in the grid, then use the combobox to select a different value to filter the grid on, the grid *is* re-getting the modified datasource however it is *not* resetting its current page number.  It's remembering whatever the last page number was when I really want it to reset and start fresh upon a combobox selection change.

I tried just setting the grid datasource to null before the calls to get its datasource and rebind, but that doesn't seem to do the trick.

What's the correct way to force the grid to reset its page number?

Thx

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 30 Mar 2009, 02:03 PM
Hello Kevin,

Just set the grid's CurrentPageIndex property to 0 before rebinding it.

I hope this helps.

Best Regards,
Tsvetoslav
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Kevin
Top achievements
Rank 2
Answers by
Tsvetoslav
Telerik team
Share this question
or