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

Clearing Radgrid

1 Answer 18 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 04 Mar 2013, 09:29 AM
Hi
I have a reset button on a form with the following client-side code to clear the grid:

var view = $find('grd').get_masterTableView();
view.set_dataSource([]);
view.dataBind();


This works great but the NoMasterRecordsText is not shown on reset. This is set as follows in the MasterTable view:

ShowHeadersWhenNoRecords="true"
NoMasterRecordsText="No data available matching the supplied search criteria."

Perhaps somebody could shed some light on how to achieve this

Regards

Daniel Affleck

1 Answer, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 04 Mar 2013, 04:36 PM
Have worked this out for myself - changed the code below:

var view = $find('grd').get_masterTableView();
view.set_dataSource([]);
view.dataBind();

to:

var view = $find('grd').get_masterTableView();
view.set_dataSource([]);
view.rebind();

This clears the grid and shows the NoMasterRecordsText as per expected :)


Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Share this question
or