473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Clear DataGrid


This is with regard to my previous post for resetting my
DataGrid, and I was adviced to use the clear function on
DataGrid items by Sachan

The datagrid does not have a Clear function and I get the
following error

DataGrid1.Items.Clear();

(186): 'System.Web.UI.WebControls.DataGridItemCollection'
does not contain a definition for 'Clear'

Is there any other way to clear the datagrid

thanks
Nov 18 '05 #1
1 4206
Try this

DataGrid1.DataSource = Nothing
DataGrid1.DataBind

/Lars

"Lee Price" <an*******@discussions.microsoft.com> skrev i meddelandet
news:58****************************@phx.gbl...

This is with regard to my previous post for resetting my
DataGrid, and I was adviced to use the clear function on
DataGrid items by Sachan

The datagrid does not have a Clear function and I get the
following error

DataGrid1.Items.Clear();

(186): 'System.Web.UI.WebControls.DataGridItemCollection'
does not contain a definition for 'Clear'

Is there any other way to clear the datagrid

thanks

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Weeepie | last post by:
Hello, Is it possible to clear a datagrid in VBdotNET? I'm using a query to fill the datagrid, but when I change the parameter, the next query follows the previous. Is there someone who can...
4
by: Mike L | last post by:
This is for a Win form. How do I clear all the rows in a datagrid? How do I add a record to a datagrid?
1
by: John Smith | last post by:
What are all the options to clear the rows in a datagrid? ..Net Framework 1.1. ASP.Net Thanks, Smith
4
by: aikwee | last post by:
how, how do i clear the current content of a datagrid? I am using datagrid to do a xml editor, so every time i try to open anther file and load it to datagrid, it actually append it in to...
4
by: Alan | last post by:
I have set the datasource of the datagrid to a datatable. How do I clear the datagrid contents before refill the datagrid everytime ?
0
by: Flack | last post by:
I have pasted at the end of this message a small sample program I whipped up to do some testing. It's a form with a datagrid and two buttons. Each button clears the dataTable that is the source...
2
by: harini | last post by:
hi, i have a radio button. On clicking the radio button i have to clear the already existing tablestyle of my datagrid and bind a new table to the grid with a new tablestyle. i used, ...
5
by: Steve | last post by:
In VB6 I have a screen the has a text box and a datagrid If I click the datagrid, the 1st event is to validate the textbox and then the 2nd event is a datagrid mousedown event. If a get an error...
4
by: inadsad | last post by:
Good day Group, I have a form with a datagrid and two buttons. On show button datagrid is populated with a datatable and on clear button datagrid is cleared. DataTable.Clear not only removes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.