473,394 Members | 1,641 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,394 software developers and data experts.

question with Datagrid.datasource ...

VM
If I'm filling a DataTable and, in the middle of the table fill, I set the
datagrid.datasource to this table, how can I stop the grid from reflecting
the changes from the table after I set the dartasource? Since I' m not sure
I'm explainng it well, here's some pseudocode:

for (int i =0;i<20000;i++)
{
rowAudit = mytable.NewRow();
// Code fills rowAudit
mytable.Rows.Add(rowAudit);
if (i == 500)
{
mygrid.DataSource = mytable;
//there are still 19500 rows to go but I don't want to see them in
the grid even though they'll be added to the table.
}
}


Nov 16 '05 #1
1 1115
Hi,

If you are using a asp.net datagrid you can do so by calling
DataGrid.DataBind() the grid will get only the rows that exist at that
moment in the table

I don;t know if that will work with a win. app based grid.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"VM" <vo******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
If I'm filling a DataTable and, in the middle of the table fill, I set the
datagrid.datasource to this table, how can I stop the grid from reflecting
the changes from the table after I set the dartasource? Since I' m not sure I'm explainng it well, here's some pseudocode:

for (int i =0;i<20000;i++)
{
rowAudit = mytable.NewRow();
// Code fills rowAudit
mytable.Rows.Add(rowAudit);
if (i == 500)
{
mygrid.DataSource = mytable;
//there are still 19500 rows to go but I don't want to see them in
the grid even though they'll be added to the table.
}
}

Nov 16 '05 #2

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

Similar topics

2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
1
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...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
4
by: dyw55a | last post by:
Donna Mar 15, 10:11 am show options Newsgroups: microsoft.public.dotnet.framework.adonet From: "Donna" <dyw...@yahoo.com> - Find messages by this author Date: 15 Mar 2005 10:11:56 -0800...
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
2
by: JohnR | last post by:
I have a question on bindingcontext, bindings, and controlbindingscollection. I understand the very basic idea, and I think I should be able to do this, but I'm not sure how. First problem: I...
5
by: rn5a | last post by:
In my application, I want to populate all the directories & files existing in a directory on the server in a DataGrid. To ensure that all the directories get listed first followed by all the files,...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.