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 3 2099
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
"tshad" wrote: 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
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
"tshad" wrote: 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
"Dave Britton" <Dave Br*****@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com... 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 Dave
"tshad" wrote:
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gary |
last post by:
I have a problem with the datagrid not clearing when the datasource changes,
a few fields remain on the screen and even when new data would fill those
grid squares the old data remains.
I wind...
|
by: Dan |
last post by:
I have a C# form with an OleDBconnection, adaptor and
dataset along with a several text boxes linked to the
Dataset and 2 buttons. I am assigning the dataset to a
DataGrid.
My problem:
I enter...
|
by: Brad |
last post by:
I'm working with a DataGrid in C#, and the user needs to be able add
and remove columns from the DataGrid on the fly, without opening and
closing the form. The scenario is this. I have a setup...
|
by: Alvin Bruney |
last post by:
I have a server side datagrid control. I'd like to clear the grid before the
post occurs using javascript. Anybody know how to do this? It would be a
similar effect to binding to a null dataset in...
|
by: Asha |
last post by:
greetings, how can iclear a datagrid content?
|
by: Ed Bick |
last post by:
I am binding a datagrid to SQL Adapter.
I am wanting to clear it out and populate with a different data set based on
user action. I can not seem to find the equivalent to a VB6 Clear method.
...
|
by: dbuchanan |
last post by:
Help me understand the behavior of this code.
If I run code 1 (below) the datagrid stays populated.
=== incidental code ===
Private dataSet1 As CLIP.dsTables
private Sub FillDataSet()...
|
by: amber |
last post by:
Hello,
What is the best method of clearing a datagrid?
I'm having issues with it not 'resetting' when I want to repopulate it.
I usually design my datagrids using the .net toolbar/properties, but...
|
by: DaveP |
last post by:
I've got to be missing something very simple here, but I'm stumped. I have a
DataGrid control on a form. The form allows search of a database and display
of resulting rows in the DataGrid.
My...
|
by: Neelakandan v n |
last post by:
Hi,
I am unable to clear column headings in datagrid in a program using vb.net 2002, framework 1.0, after clearing a set of data displayed subsequent to a query. The database is in MySql 5.0. Could...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |