Clearing a DataGrid

T

tshad

How do I clear a DataGrid?

I have 2 datagrid (DataGrid1 and DataGrid2). They are the same, except for
a couple of extra fields that DataGrid has for detail.

I only display one DataGrid at a time. The problem is that even when one is
not showing, it is still sending the data it was filled with before. When I
switch to one DataGrid and DataBind to it, I want to clear the other
DataGrid.

Thanks,

Tom
 
G

Guest

To clear the datagrid, you can set the Datasource = null and re-bind.

In my apps, I use <div>'s with a grid on it, then use some javascript to
hide the relevent <div>

Dave
 
T

tshad

Dave Britton said:
To clear the datagrid, you can set the Datasource = null and re-bind.

I'll try that.
In my apps, I use <div>'s with a grid on it, then use some javascript to
hide the relevent <div>

I use <div> also to hide and unhide my grids. But I believe that the data
is still transered with the page on each repost. I was trying to dump the
data so it wouldn't be sent back and forth when not being used.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top