473,750 Members | 2,527 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 1593
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.Data Bindings.Clear( );
myDataGrid.Data Source = null;
myDataGrid.Data Member = "";

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.dataso urce=ds;
datagrid.databi nd();

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.dataso urce=ds;
datagrid.databi nd();

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.dataso urce=ds;
datagrid.databi nd();

it will work properly;
vijay

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

Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
From: "vijaygpar...@g mail.com" <vijaygpar...@g mail.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.dataso urce=ds;
datagrid.databi nd();
it will work properly;
victor

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

Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
From: "victor" <vijaygpar...@g mail.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...@gm ail.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.dataso urce=ds;
datagrid.databi nd();
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
2596
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 to database), and go back to the datagrid. Only the data from the PM-table
1
4337
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) - Selects a contract to
9
5065
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
1698
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 control to a PlaceHolder. The first worksheet displays beautifully. The next step is to allow...
0
8839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9584
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9398
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9345
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9257
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6811
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4894
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2227
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.