Re: Speed up datagrid rendering



Thanks Alex!

I'll try using a different thread, then. However, since the initial rendering of the controls is the problem, I have some doubts this will solve the problem.

Imagine for instance that you have a form with two panels separated by a splitter. One of them is DockStyle.Fill, the other Top or Bottom.

Then in both these Panels, you have a DataGrid set to DockStyle.Fill.

On a toolbar, you have two CheckBoxes setting the visibility of the Panels (and the Splitter)

If you load the grids with some data, and try to check or uncheck the CheckBoxes, you will have a very short pause as things are being reordered, and a microscopic flicker. This is what I'm trying to eliminate. It's not a very big deal, but I feel it's like a small touch that's needed to make an application look professional.


- Peder -


Alex Passos wrote:
Have you tried to do the processing on a separate thread so that your main UI thread won't lock up. I did this on a project and its not something that is trivial because DataGrid is not a thread safe component so great care goes into controlling the concurrency. In my project it loaded thousands upon thousands of rows so I controlled it using the viewable area and fetch the database rows necessary when needed also allowing for a small foot print of the recordset.

Also for a small amount of rows like that you might want to look into DataGrid.SuspendLayout and DataGrid.ResumeLayout so you can suspend it, load the data, then resume that might help you some.

Alex


"Peder Y" <pedery@xxxxxxxxxxx> wrote in message news:eZ1j%23o3OFHA.3076@xxxxxxxxxxxxxxxxxxxxxxx


Nope, I just have a few rows of data. Time will show if an approach like the one you describe will be necessary, but for the time being I'm merely interested in a faster way to load a datagrid. Maybe it's because I use a lot of ColumnStyles (around 15 in each grid)?

- P -





.



Relevant Pages

  • RE: Usage of AppDomain.CreateInstanceFromAndUnwrap method
    ... The reason for other failures is that Controls are not inherited from ... so the program will attempt to load them into the ... Create an AppDomain, do a CreateInstanceAndUnwrap on ... Assemblies in to a seprate ...
    (microsoft.public.dotnet.framework.clr)
  • Re: The Command event of dynamically loaded controls
    ... to load a hierarchical list of folders and files from a database and display ... I'll need to load the folder list in the first pass to wire up the ... controls and corresponding event handlers. ... > and triggers events. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Form Performance
    ... can take a lot of time to load. ... it is not the number of controls. ... So, combo box controls, and sub-form controls are very expensive in terms ... > that tab. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Better multiple forms or.....?
    ... Keep in mind that default behavior is for a form to load all controls on it ... also be possible to use this approach with panels or a tab control. ... is running that could consume significant memory. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Please help with double entries
    ... Thank you John. ... Is there a way, though, to load this ... generalized code to all controls on the form, say, in the on load even of the ... > Dim blTemp As Variant ...
    (microsoft.public.access.formscoding)

Loading