|
9000 columns in a DataGrid view!!!!?
First thing I would do is review your program design. Why would you want 9000 columns?
How can 9000 columns fit on a screen and make any meaningful sense to anyone?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
you mean 9000 rows !!!
Microsoft didn't take in consideration that one day a developer will use 9000 column !
|
|
|
|
|
Lord Hasan wrote: you mean 9000 rows
I would have thought so, but his code is generatinmg columns - slowly!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Yes, It very very slowly, it take a long (about 2 hours) to create 9000 columns
This will appear at the end of articles you submit to the Code Project
|
|
|
|
|
No, I need to create 9000 column
This will appear at the end of articles you submit to the Code Project
|
|
|
|
|
What kind of dataset do you have which contains 9000 fields? Maybe there is a more appropriate control as I think that 9000 columns is beyond the scope of a datagridview control.
|
|
|
|
|
Member 3031069 wrote: Dim i As Int32
For i = 1 To 9000
Dim colX As New DataGridViewTextBoxColumn
colX.HeaderText = i.ToString
colX.Name = "txt"
colX.FillWeight = 1
colX.Dispose()
'colX.AutoSizeMode = DataGridViewAutoSizeColumnMode.None
DataGridView1.Columns.Add(colX)
Next
But it very very slowly (to end this code it takes a long times(about 2 hour)
Are you sure it creates the columns? You have already disposed colX before adding...
|
|
|
|
|
Yes, I have a mistake my code colx.dispose is commented
Dim i As Int32
For i = 1 To 9000
Dim colX As New DataGridViewTextBoxColumn
colX.HeaderText = i.ToString
colX.Name = "txt"
colX.FillWeight = 1
'colX.Dispose()
'colX.AutoSizeMode = DataGridViewAutoSizeColumnMode.None
Next
DataGridView1.Columns.Add(colX)
This will appear at the end of articles you submit to the Code Project
|
|
|
|
|
Are you absolutely, positivly, smack me in the face if i'm lying, sure you need 9000 columns ? This is not viewable or practical in any way !
Well. i was thinking about something like this:
Dim dt As New DataTable<br />
For i As Integer = 1 To 9000<br />
dt.Columns.Add(i.ToString)<br />
Next<br />
DataGridView1.DataSource = dt<br />
but you actually get an exception saying "sum of the columns "FillWeight" values cannot exceed 65535
For the rest however, the datatabe with the 9000 columns itself was build in something like 5 or 6 seconds...
|
|
|
|
|
hello
i'm trying to use ole control to create links to files, but i'm getting error:
i create the .exe program on my desktop and it was working
but in another computer it don't work
so i think that the problem is an dll or an ocx
i'm using vb6
the code giving the error :
OLE1.CreateLink txtObject.Text
help me plz !
|
|
|
|
|
Please check if the OLE components are installed and registered on the other machine as well...
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
how to do ?
|
|
|
|
|
All,
I am in a task of creating a custom reporting tool. For that i want to use a tool like create view tool in sql server. In the create view option, we will be able to select tables & fields. Is there any API available to integrate this view generator tool of sql to my desktop application. Or can you give me any clue about any alternate ways to generate sql query dynamic.!!!
Thanks in advance
Sebastian
modified on Friday, June 13, 2008 4:41 AM
|
|
|
|
|
Its easy enough to write yourself and generate a create view statement, but be careful of joins - you may end up with cartesian joins or joins where there are no indexes causing large tables scans. You can soon bring a database to a standstill if your are unaware of the structure and are inexperienced with sql.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks for your reply...here user selects the table & fields. so it changes everytime, i want to generate sql dynamic, as user selects the table & fields
Thanks
Sebastian
|
|
|
|
|
Sebastian T Xavier wrote: i want to generate sql dynamic
So you don't want to create views, just dynamic sql. All you need to do then is create and run a sql select via the SQLCommand and populate either a datareader or dataset etc. Where is the problem?
Also, keep in mind my comments about performance if they are big tables - table scans can be costly.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I want to update the windows clock via a serial port. I use VB6. How is this done?
|
|
|
|
|
hi,
i have little confusion here..
i'm working on vb.net using VS2008 on windows application..
my problem is i have two or three listbox and i want to using vscrollbar that can control all three listbox..
but i'm only know this..
private sub vscrollbar......handle..
listbox1.selectedindex = vsrollbar.value
it didnt work properly.. error out of range come out..
what can i do to make the scrollbar have same value in listbox..
plz..
|
|
|
|
|
shee_dee86 wrote: it didnt work properly.. error out of range come out..
I guess you didn't bother to make the scrollbar have a range equal to the number of items in the listbox ? Do all three boxes have the same number of items ? I don't think that selecting will scroll anyhow, unless you call the method to make sure an item is visible
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
i have an exe that calls other dlls that has forms in them. the exe is acting like a menu and when a menu item is clicked, it creates an instance of a form in one of my dlls. because the exe and forms are on the main thread, a dialog form locks up the main thread effecting every dll and exe.
is there a good way to handle the issue?
i thought about playing with appdomains attempting to minimize what is effected but I store a bunch of stuff in memory and not sure how to spread that accross domains as well as sync them up.
i tried to mimic the behavior of the "showdiaglog" command by setting up events on the calling form and when it was activated set focus on the "modal" form. works well but when I need wait for a response/answer from the "modal" form, I don't know how to make the calling form wait without locking up the main thread until the "modal" is closed.
any help would be greatly appreciated...
nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
I am working wiht VB.Net 2005 and I am looking at an Access 2003 database. I can run a Delte query in Access and it works fine. But when I try to run the same query from my program it doesn't delete anything. Can someone tell me what I doing wrong? Thanks so much for your help with this....
Cursor = System.Windows.Forms.Cursors.WaitCursor
'Build SQL to delete this department
Dim TempDepartNum As String = Me.txtDepartNum.Text
Dim Sql As String = String.Empty
'initialize database connection
Dim Connection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Databases\Converted to 2003\C022008.mdb")
'set up SQL command to delete records
'DELETE SHACT.ActAcct, *FROM(SHACT) WHERE (((SHACT.ActAcct) Like '100*'));
Sql = "DELETE * FROM SHACT WHERE (((SHACT.ActAcct) Like '100*'));"
Try
'connect to the database and delete the records
Connection.Open()
Dim Command As New OleDbCommand(Sql, Connection)
Command.ExecuteNonQuery()
MessageBox.Show("Delete Department function completed successfully.", "Delete", MessageBoxButtons.OK)
|
|
|
|
|
Try changing the wild card * in your LIKE statement to a % see if that works.
IE: Like '100*')); changes to Like '100%'));
|
|
|
|
|
Thanks, that is exactly what I needed!
|
|
|
|
|
i have a progam that i want to start and run as long an window is running
i try winservice but is giving me " some services start and stop if the have no work to do for example the performance logs and alerts service
if there any easy way to create this project without using winservice
i mean a window project
|
|
|
|
|
You can put the shortcut in the startup folder, or in the run key in the registry. You can't stop a user stopping your program, it won't restart, but you can make it run initially
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|