Adding Columns in DataGrid at run time
-
aloktambi wrote:
No sir, i mean 25000 columns . it is req. of our software
Wow. That sounds very messy. If you don't mind explaining, why is this a requirement? What circumstances force this, and what is the usage of the table?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
Sir, In our software, we want to show peak information to user, No of Columns for General Info = 7 (Constant) No of Columns for Injection Info = 22 (Constant) No of Fixed Column(s) for Peak Info = 1(Constant) //It is for Peak Area Sum. Total No of Columns for N Peaks: N x (13 + 2 x N) Hence total Number of Columns in Datagrid in case of N Peaks = 1(Separator) + 7 + 1(Separator) + 22 + 1(Separator) + 1 + N(13+2N) = 2xNxN + 13xN + 33 Hence Number of Columns in the Datagrid increase as a 2nd Degree Equation. This means For 10 peaks Column Count will be 363 For 25 peaks Column Count will be 1608 For 50 peaks Column Count will be 5683 For 100 peaks Column Count will be 21333 For 150 peaks Column Count will be 46983 For 200 peaks Column Count will be 82633
-
Sir, In our software, we want to show peak information to user, No of Columns for General Info = 7 (Constant) No of Columns for Injection Info = 22 (Constant) No of Fixed Column(s) for Peak Info = 1(Constant) //It is for Peak Area Sum. Total No of Columns for N Peaks: N x (13 + 2 x N) Hence total Number of Columns in Datagrid in case of N Peaks = 1(Separator) + 7 + 1(Separator) + 22 + 1(Separator) + 1 + N(13+2N) = 2xNxN + 13xN + 33 Hence Number of Columns in the Datagrid increase as a 2nd Degree Equation. This means For 10 peaks Column Count will be 363 For 25 peaks Column Count will be 1608 For 50 peaks Column Count will be 5683 For 100 peaks Column Count will be 21333 For 150 peaks Column Count will be 46983 For 200 peaks Column Count will be 82633
Well that is interesting. I can't think of any way to create 25,000 columns in a fast way(like can be done with SQLBulkCopy for rows). Good luck though!
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
-
Sir, In our software, we want to show peak information to user, No of Columns for General Info = 7 (Constant) No of Columns for Injection Info = 22 (Constant) No of Fixed Column(s) for Peak Info = 1(Constant) //It is for Peak Area Sum. Total No of Columns for N Peaks: N x (13 + 2 x N) Hence total Number of Columns in Datagrid in case of N Peaks = 1(Separator) + 7 + 1(Separator) + 22 + 1(Separator) + 1 + N(13+2N) = 2xNxN + 13xN + 33 Hence Number of Columns in the Datagrid increase as a 2nd Degree Equation. This means For 10 peaks Column Count will be 363 For 25 peaks Column Count will be 1608 For 50 peaks Column Count will be 5683 For 100 peaks Column Count will be 21333 For 150 peaks Column Count will be 46983 For 200 peaks Column Count will be 82633
There's no way to create that many columns that fast. You're ARE going to have to find a different way to present your data. Just scrolling that many columns is going to be painfully slow. On a 19" monitor, with all of these columns widths set at, say, a half inch wide, you're DataGrid would be almost A QUARTER OF A MILE (0.4km) WIDE!! A bit excessive, wouldn't you say? This sounds more like a job for some kind of graph, not a DataGrid.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
There's no way to create that many columns that fast. You're ARE going to have to find a different way to present your data. Just scrolling that many columns is going to be painfully slow. On a 19" monitor, with all of these columns widths set at, say, a half inch wide, you're DataGrid would be almost A QUARTER OF A MILE (0.4km) WIDE!! A bit excessive, wouldn't you say? This sounds more like a job for some kind of graph, not a DataGrid.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Dave Kreskowiak wrote:
This sounds more like a job for some kind of graph, not a DataGrid.
Depends what the data needs to be visualized for. A graph would be the way to go if the general distribution is needed. If the user needs to be able to check the value of a parameter some sort of browsing tool would be a better alternative.
-- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
-
Dave Kreskowiak wrote:
This sounds more like a job for some kind of graph, not a DataGrid.
Depends what the data needs to be visualized for. A graph would be the way to go if the general distribution is needed. If the user needs to be able to check the value of a parameter some sort of browsing tool would be a better alternative.
-- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
I was thinking some kind of a grid were you could zoom in and see more detail, and possibly get a table showing the values if you zoomed in far enough, or maybe even hover the mouse over a point on the graph and have a floating table show you the values.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
:omg: I think you really need to review your design. It's not possible for a human to view that much information all at once, even less to do some sort of analysis on it. We will need to find better ways to present the results to the users.
Maximilien Lincourt Your Head A Splode - Strong Bad
-
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
Why don't you try using 25,000 DataGrids with one column each?
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
-
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
Please let us know when your project is complete so we can post it on http://worsethanfailure.com/
-
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
aloktambi wrote:
25000 columns
:wtf::omg: Don't think that is really possible.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
Pfft DataGrids cause a localized lowering of the ambient air pressure; I avoid them at all cost. :cool:
-
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
You need to design a custom control, which meets the criteria of you're data you are trying to present. A grid with 25000 columns isn't the way to go, you need a customized grid and when the user scrolls left/right load the columns on demand, it's easy with .net and even easier with WPF. A good software design engineer (cough, cough) such as my self would be able to create such a control (obviously your company would be billed).
WPF - Imagineers Wanted Follow your nose using DoubleAnimationUsingPath
-
Sir, In our software, we want to show peak information to user, No of Columns for General Info = 7 (Constant) No of Columns for Injection Info = 22 (Constant) No of Fixed Column(s) for Peak Info = 1(Constant) //It is for Peak Area Sum. Total No of Columns for N Peaks: N x (13 + 2 x N) Hence total Number of Columns in Datagrid in case of N Peaks = 1(Separator) + 7 + 1(Separator) + 22 + 1(Separator) + 1 + N(13+2N) = 2xNxN + 13xN + 33 Hence Number of Columns in the Datagrid increase as a 2nd Degree Equation. This means For 10 peaks Column Count will be 363 For 25 peaks Column Count will be 1608 For 50 peaks Column Count will be 5683 For 100 peaks Column Count will be 21333 For 150 peaks Column Count will be 46983 For 200 peaks Column Count will be 82633
What the heck is this anyway. The fact that you are trying to view this data it is such an un-normalized fashion completely fascinates me. Shouldn't you be grouping these things? General info should be a table Injection data should be a table the peaks thing sounds like a function or a set of functions You should create this databse using meaningful relations. If you need to view dynamics mabye you should apply some differential analysis or maybe use graphs with animation. Good luck
-
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
The only thing that can possibly handle that amount of columns is Excel 2007 where the column limit has been increased. I think this is your best bet too, in terms of rendering to screen compared to DataGrid. -- modified at 18:41 Saturday 13th October, 2007
xacc.ide
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach." -
Dear Sir, I am facing one problem in DataGrid. i want to add many columns in DataGrid at runtime .because this is requirement of our applcation. i want to add around 25000 columns at runtime. but when i add columns at run time, application hang up or it will taking much much time to add columns in DataGrid. so any one suggest me the best solution of display 25000 columns in DataGrid
May I suggest the following? 1. Have a small fixed number of columns on your screen, say 10. 2. Add two honrizontal arrows on the screen that when clicked would show users the next/previous 10 columns.
-
Sir, In our software, we want to show peak information to user, No of Columns for General Info = 7 (Constant) No of Columns for Injection Info = 22 (Constant) No of Fixed Column(s) for Peak Info = 1(Constant) //It is for Peak Area Sum. Total No of Columns for N Peaks: N x (13 + 2 x N) Hence total Number of Columns in Datagrid in case of N Peaks = 1(Separator) + 7 + 1(Separator) + 22 + 1(Separator) + 1 + N(13+2N) = 2xNxN + 13xN + 33 Hence Number of Columns in the Datagrid increase as a 2nd Degree Equation. This means For 10 peaks Column Count will be 363 For 25 peaks Column Count will be 1608 For 50 peaks Column Count will be 5683 For 100 peaks Column Count will be 21333 For 150 peaks Column Count will be 46983 For 200 peaks Column Count will be 82633
Mass Spec? Anyway - you would need something like a tree to group the data. You would then only have a constant set of Entries and N Pak-Entries with the Peakinfo underneath.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
George Orwell, "Keep the Aspidistra Flying", Opening words -
May I suggest the following? 1. Have a small fixed number of columns on your screen, say 10. 2. Add two honrizontal arrows on the screen that when clicked would show users the next/previous 10 columns.
And to get to the middle of the grid, you want the user to click the right arrow button, what, 1,250 times??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
And to get to the middle of the grid, you want the user to click the right arrow button, what, 1,250 times??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Perhaps a fast forward/backward button would help?
-
Perhaps a fast forward/backward button would help?
Even at moving 1,000 columns at a time, that's still 12.5 clicks to see the middle of the table. No matter how you bandaid this, it's still a horrible "solution".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Even at moving 1,000 columns at a time, that's still 12.5 clicks to see the middle of the table. No matter how you bandaid this, it's still a horrible "solution".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Dave Kreskowiak wrote:
No matter how you bandaid this, it's still a horrible "solution".
As I recall, the original problem is that the initial poster can't create that many columns in a grid. My "solution" avoids the difficulty of creating that many columns, it is not intended to answer the question of how the hell the users are going to use the application. :) I agree with you that it is a bad design in the first place (that the app needs to create so many columns in a grid).
-
Even at moving 1,000 columns at a time, that's still 12.5 clicks to see the middle of the table. No matter how you bandaid this, it's still a horrible "solution".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Dave Kreskowiak wrote:
Even at moving 1,000 columns at a time, that's still 12.5 clicks to see the middle of the table. No matter how you bandaid this, it's still a horrible "solution".
Not that I advocate continuing on a design path doomed to fail, but you could always have "Jump To" button which would work just fine, maybe even acceptable to a given client assuming it was the same client that came up with 25,000 columns requirement.