speed problem in Databinding to other control
In GridGroupingControl, I try to build a detail panel which will display a row value in controls
such as TextBox,ComboBox according correspoding column type. When you click a grid row, this detail panel will display the row''s column values. I used DataBinding techs to bind control to the same table which was binded to the GridGroupingControl. This works fine, however the speed is so slow. When I click a row in the grid, it takes 10 seconds to refresh the control values in the detail panel.
The code is like:
// Code to create textbox control for each column
// to detail panel called pnlDetail
......
// Code to load data from database to
// DataSet _gdDataSet with a table
// called "MyTable"
.......
// setup GridGroupingControl datasource
MyGrid.DataSource = _gdDataSet.Tables["MyTable"];
// setup detail control''s datasource
DataTable tb=_gdDataSet.Tables["MyTable"];
foreach (Control ctl in pnlDetail.Controls)
{
// control''s tag holds table field name
string sFieldName=ctl.Tag.ToString
ctl.DataBindings.Clear();
ctl.DataBindings.Add("Text",tb,sFieldName);
}
Any idea?
SIGN IN To post a reply.
4 Replies
AD
Administrator
Syncfusion Team
November 16, 2004 01:06 PM UTC
I tried to see this problem in this little sample, but could not. Are you seeing any exceptions listed in the output window? This would slow things down.
GCC_TextBoxes_4167.zip
AD
Administrator
Syncfusion Team
November 16, 2004 01:26 PM UTC
I have looked your sample and compared my code.
I found the difference is I have two columns have ComboBox which is bould to thier lookup table. These two columns have thier ComboBox controls in the detail panel binding to thier lookup table as well. this is caused the slow-down. When I deleted them from the detail panel
controls( that is the detail panel have only textbox about 20), it works fast.
Could you add a ComboBox column with lookup table in your code sample to see if it slow down?
Thanks.
>I tried to see this problem in this little sample, but could not. Are you seeing any exceptions listed in the output window? This would slow things down.
>
>GCC_TextBoxes_4167.zip
>
>
AD
Administrator
Syncfusion Team
November 16, 2004 04:06 PM UTC
Here is the sample back with a couple of comboboxes. It does not seem to have teh problem you described. Are you seeing any exceptions?
GCC_TextBoxes_2853.zip
AD
Administrator
Syncfusion Team
November 17, 2004 04:37 PM UTC
Hello Clay,
Thanks for help. You solved my problem.
Now my code is working fast..
>Here is the sample back with a couple of comboboxes. It does not seem to have teh problem you described. Are you seeing any exceptions?
>
>GCC_TextBoxes_2853.zip
>
>
SIGN IN To post a reply.
- 4 Replies
- 1 Participant
-
AD Administrator
- Nov 16, 2004 12:27 PM UTC
- Nov 17, 2004 04:37 PM UTC