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

[Solved] Grid Clearing problem

5 Answers 171 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 25 Mar 2008, 11:52 AM
Hi,

I have a Premetheus grid that display database data. One of the columns includes a link field, and another an image button. The data is loaded from the database and displays well.

To clear the grid data, I set the DataSource property to null and then do a rebind. The data disappear but empty rows remain and the image buttons remain shown.

Setting the Datasource to null and rebinding should do the trick. Any ideas why this is happening?

Thanks.

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Mar 2008, 11:54 AM
Hi Mohamed,

How the grid is bound in your case? Do you use NeedDataSource?

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mohamed
Top achievements
Rank 1
answered on 25 Mar 2008, 02:30 PM
Hi Vlad,

No I am not using NeedDataSource. I simply set DataSource and bind.

Mohamed
0
Jim
Top achievements
Rank 2
answered on 17 Apr 2008, 07:21 PM
Any answer for this, I'm having the same problem.  Set datasource to null and rebind, but I still have data populating the grid as well as the buttons.

Thanks Jim
0
Jim
Top achievements
Rank 2
answered on 17 Apr 2008, 07:53 PM
I worked around this problem by querying the server for a blank/empty dataset and then setting the grid's datasource to the dataset.  Then I just set the NoDetailRecordsText = "" NoMasterRecordsText ="" and I have the functionality I wanted.  Still think the grid should be able to clear all of it's records though.

Thanks,
Jim
0
Shinu
Top achievements
Rank 2
answered on 11 Jun 2008, 10:00 AM
Hi Jim,

Try setting the DataSource for the Grid as shown below.

CS:
RadGrid1.DataSource = new string[] { };  


Shinu.
Tags
Grid
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Mohamed
Top achievements
Rank 1
Jim
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or