Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 27th, 2007, 10:48 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to clear to datagrid?

i have a form with a datagrid displaying retrieved tables from the database. How should i clear the datagrid?
any code to insert?
baties

 
Old August 29th, 2007, 06:23 AM
Authorized User
 
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure this will completely solve ur problem.

Generally a dataset is used to populate the datagridview, datagrid etc
the instead of clearing the datagridview u need to clear the dataset that populates it.

If Dataset ds = new Dataset();
dgv1.Datasource = ds.Tables["aaa"];

If u want to clean the grid use
ds.Clear();
dgv1.Refresh();


I hope this will help.














Similar Threads
Thread Thread Starter Forum Replies Last Post
clear dataGrid(C#) kobystud C# 2 July 17th, 2011 06:54 AM
datagrid clear all item Bluesmen VS.NET 2002/2003 2 March 8th, 2005 12:38 AM
Help me clear out Stress ! minhtri J2EE 12 November 9th, 2004 10:49 PM
do not clear dataset kasper General .NET 1 October 27th, 2004 05:41 AM
Clear Frames SeanW Classic ASP Basics 4 March 30th, 2004 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.