TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Liron Ladelsky
NA
1
0
lots of time binding large data table to datagrid
Nov 26 2009 10:52 AM
I have a large datatable (matrixdisplay) that includes 51 rows * 420 columns.
I want to bind only 50 columns. if I remove from datatable 370 columns even before binding , it is stuck for 3 minutes at least.
if I remove 200 columns and bind , it takes 10 sec which is great.
but if I remove another 150 columns it is stuck again.
this is my code : I copied the datatable twice.
//MatrixDisplay - contains 51*430
DataTable
MatrixDisplayCopy = MatrixDisplay.Copy();
int
amount_of_cols = 320;
for
(
int
i = 0; i < amount_of_cols; i++)
{
MatrixDisplayCopy.Columns.RemoveAt(3);
}
//MatrixDisplayCopy contains 51*110 - binds to grid fast !!!
DataTable
MatrixAnotherCopy = MatrixDisplayCopy.Copy();
for
(
int
i = 0; i < 100; i++)
{
MatrixAnotherCopy.Columns.RemoveAt(3);
}
//
MatrixAnotherCopy
contains 51*10 - binds to grid SLOWWWWWWWW!!!
dgvMainMatrix.DataSource = MatrixAnotherCopy; //takes minuts!!
dgvMainMatrix.DataSource = MatrixDisplayCopy ; //takes 10 seconds!!
WHY ???
Reply
Answers (
1
)
How to create a multi-select CheckBox in FrameWork 2.0
Database Problem please help