Hello folks,
for showing data from my database i use a Master-Panel which have added
Detail-Panels for each row of the dataset.
Inserting the Detail-Panels running this code

disDetails.Controls.Clear()
For Each r As DataRow In myDataSet
Dim p As myDetailPanel
p = New myDetailPanel(r)
p.Dock = DockStyle.Top
disDetails.Controls.Add(p)
p.SendToBack()
Next


If i chance to the next Masterrecord and displaying the new Detailrows
(maximum 15 rows) i have to wait 1-5 seconds.
Cause of this bad performance I inserted
"Debug.Writeline(Datetime.now.ticks)" and found that most of this time (80%)
will used for running the Controls.Clear() statement.

Thanks in advance for any help to get a better performance.

Niels

RE: Performance of Panel.Control.Clear by nieurig

nieurig
Wed Jul 13 03:37:05 CDT 2005

Hello folks,
one hour later i locate my performance problem into the DetailPanel.
I have a ComboBox on this Panel which shows data from a datatable.

The dataset for the ComboBox was filled at DetailPanels-Constructor
and was set as datasource of this ComboBox.

If i delete this ComboBox from the detailpanel or if i don't set
the datasource of the ComboBox i get a good performance.

What happend if I free the panel what slow down my program?

Any ideas?

Niels


Re: Performance of Panel.Control.Clear by Bob

Bob
Wed Jul 13 07:52:39 CDT 2005

Probably the combobox selected index changed event is wired to something and
is firing every time the thing is updated. Wee Windows Forms Tips and Tricks
for the solution.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"nieurig" <nieurig@discussions.microsoft.com> wrote in message
news:698C8E57-A94A-4AD2-BADA-FE96737D037F@microsoft.com...
> Hello folks,
> one hour later i locate my performance problem into the DetailPanel.
> I have a ComboBox on this Panel which shows data from a datatable.
>
> The dataset for the ComboBox was filled at DetailPanels-Constructor
> and was set as datasource of this ComboBox.
>
> If i delete this ComboBox from the detailpanel or if i don't set
> the datasource of the ComboBox i get a good performance.
>
> What happend if I free the panel what slow down my program?
>
> Any ideas?
>
> Niels
>



Re: Performance of Panel.Control.Clear by Bob

Bob
Wed Jul 13 07:53:04 CDT 2005

oops typo.. Wee=See ;-)

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"nieurig" <nieurig@discussions.microsoft.com> wrote in message
news:698C8E57-A94A-4AD2-BADA-FE96737D037F@microsoft.com...
> Hello folks,
> one hour later i locate my performance problem into the DetailPanel.
> I have a ComboBox on this Panel which shows data from a datatable.
>
> The dataset for the ComboBox was filled at DetailPanels-Constructor
> and was set as datasource of this ComboBox.
>
> If i delete this ComboBox from the detailpanel or if i don't set
> the datasource of the ComboBox i get a good performance.
>
> What happend if I free the panel what slow down my program?
>
> Any ideas?
>
> Niels
>



Re: Performance of Panel.Control.Clear by nieurig

nieurig
Thu Jul 14 04:43:02 CDT 2005

Hello Bob,
thanks for your reply.

No, the Eventhandler for selection event can't be the reason.
If i set it inactiv i get the same result.

New results of my researce:
- Setting the datasource catch a much time to.
- It runs very quick if no datasource was linked to the ComboBox
- If i create ONE dataset before creating my panels and give the reference
to its construktor i don't get a better result.

Any more ideas?
Niels

Thanks for the given links. They are very usefull.