473,513 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid Problem

I currently have a datagrid which is populated from a dataset table
however the contents of the table how can i clear the grid and
repopulate it ?

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
6 1580
Stuart Ferguson wrote:
I currently have a datagrid which is populated from a dataset table
however the contents of the table how can i clear the grid and
repopulate it ?

*** Sent via Developersdex http://www.developersdex.com ***

I usually do something like this:

myDataGrid.DataBindings.Clear();
myDataGrid.DataSource = null;
myDataGrid.DataMember = "";

Not sure if this is the recommended way but it works for me.

Then to repopulate just set use teh SetDataBinding property or
DataBindings method.

John
Nov 17 '05 #2
hi stuart

for repopulate your data write a one function and when u require call
that function like this

dataset ds = new dataset();
da.fill(ds);
datagrid.datasource=ds;
datagrid.databind();

it will work properly;

Nov 17 '05 #3
hi stuart

for repopulate your data write a one function and when u require call
that function like this

dataset ds = new dataset();
da.fill(ds);
datagrid.datasource=ds;
datagrid.databind();

it will work properly;
vijay

Nov 17 '05 #4
hi stuart

for repopulate your data write a one function and when u require call
that function like this

dataset ds = new dataset();
da.fill(ds);
datagrid.datasource=ds;
datagrid.databind();

it will work properly;
vijay

Nov 17 '05 #5
vi**********@gmail.com Jun 9, 1:07 am show options

Newsgroups: microsoft.public.dotnet.languages.csharp
From: "vijaygpar...@gmail.com" <vijaygpar...@gmail.com> - Find messages
by this author
Date: 8 Jun 2005 22:07:59 -0700
Local: Thurs,Jun 9 2005 1:07 am
Subject: Re: Datagrid Problem
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

hi stuart
for repopulate your data write a one function and when u require call
that function like this
dataset ds = new dataset();
da.fill(ds);
datagrid.datasource=ds;
datagrid.databind();
it will work properly;
victor

Nov 17 '05 #6
victor Jun 9, 1:19 am show options

Newsgroups: microsoft.public.dotnet.languages.csharp
From: "victor" <vijaygpar...@gmail.com> - Find messages by this author

Date: 8 Jun 2005 22:19:27 -0700
Local: Thurs,Jun 9 2005 1:19 am
Subject: Re: Datagrid Problem
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

vijaygpar...@gmail.com Jun 9, 1:07 am show options


hi stuart
for repopulate your data write a one function and when u require call
that function like this
dataset ds = new dataset();
da.fill(ds);
datagrid.datasource=ds;
datagrid.databind();
it will work properly;
vij

Nov 17 '05 #7

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

Similar topics

5
2568
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order date, name, address etc) about the selected row in the datagrid... My problem is when I enter a new record in the details tabpage (saves data...
1
4282
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls (watch the layout, some have child controls):
0
693
by: Richard Ryerson | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls (watch the layout, some have child controls): 1. DataGrid (dgContracts) - Lists current contracts. 1.1. ButtonColumn (CommandName SelectContract) -...
9
5040
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ******************************************************************************* <asp:DataGrid visible="False" border=1
0
1684
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a single worksheet into a dataset. I successfully built a dynamic datagrid. And I did successfully bind it to the dataset. Then I added the datagrid...
0
7269
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7394
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7542
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5701
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.