473,406 Members | 2,710 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,406 software developers and data experts.

Clear a unbound data gridview in c# or VB.net

1
this is maby a answer and not a discussion. I saw many questions about how to clear an unbound datagrid in C#.
Here is de ansuer: " dataGridView1.Rows.Clear(); "//clear or delete all columns in the datagridview
if the grid is bound to any dataset o datatable you only have to clear the dataset or datatable, but if you user dataGridView1.Rows.Clear(); will be good any way.
Mar 23 '07 #1
2 12090
kenobewan
4,871 Expert 4TB
Welcome to the site. Thanks for sharing your solution. Have you tested it?
Mar 23 '07 #2
shweta123
692 Expert 512MB
Hi,

What I think is , if you do require the Grid to fill up again in the future with the same Dataset , you should not close the dataset and instead clear the Rows.Otherwise if its not needed to use the same dataset again , you can
Close the Dataset.
Mar 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bill Stock | last post by:
The few times in the past that I've loaded unbound data, I've tended to cheat and use temp tables (not really unbound) or use code for small datasets. I'm currently involved in a project that...
0
by: bienwell | last post by:
Hi all, I have a data entry form in ASP.NET (Web development) which has some fields (field1,..., fieldN) , button ADD THIS RECORD, and button CANCEL. In button ADD THIS RECORD, I have VB.NET...
1
by: sambathrajmca | last post by:
Hai, I am sambath Raj.I am new for you.Now i am trying to use windows forms with data GridView Controll.Now i am adding combobox in that data GridView but defaultly New Row Will be added next to...
3
by: JennDavila | last post by:
Hello, Not sure if my title was correct, but here is what I am dealing with. I have created a DB that contains different tables that are linked to a form through combo box's. I have createad a...
19
by: Mel | last post by:
I want to display custom data in some sort of control on a web page. By custom data I mean it's not in a database yet it just resides in a List Box on a different tab . I just want to display the...
1
by: Ozone | last post by:
Hi, I need to know how to validate encrypted column which may by chance loads clear text or unencrypted value. An exception should be triggered if encrypted column receives any clear text data....
1
by: dotnetnovice | last post by:
Hi everybody... I want to show data in the data gridview placed in my form after getting data from my data access layer class through a class... Here is my code in the data access layer class....
3
by: muddasirmunir | last post by:
I am using MSFlexGrid , I am using the follwing code to clear the data on click of button grid1.Clear grid1.Row = 0 grid1.Col = 0 But, that only clear the data and still showing the entire...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.