M
Mike Gorgone
Hi All,
Quite the Quandry here... I've got two list boxes with datasets bound
to them. Items from the listboxes can be moved from one listbox to
another and vice versa. The problem is that when a listbox is empty
the first time I load it the load takes about 2 seconds and after that
it's nice and quick (even if I close and reopen the form). So the
lists look like this...
List1 List2
------- -------
Item1 Item2
Item3 [Add >>]
[<< Remove]
If the lists are in this configuration when I load up and then I
remove Item2 (moving it to List1) and then add any item from List1
back to List2 I get the delay. After that everything is fine. The
removal from List2 and addition to List1 is quick. I'm guessing
because there are items on the list already.
When the form loads I bind the datasets to the listboxes with the
DataSource property. The code I use to move an Item from List2 to
List1 is as follows and the slow down occurrs on the ImportRow line.
Dim SelectedRow As DataRow
SelectedRow = CType(AssignedSecurityRoles.SelectedItem,
DataRowView).Row
_List1DS.Tables(0).ImportRow(SelectedRow)
_List2DS.Tables(0).Rows.Remove(SelectedRow)
That's all the code I need to move the rows (reversed in the case of
an Item going from List1 to List2.
ANY help or insight on this would be greatly appreciated as I have now
spent 8 hours on the damn problem.
Thanks in advance,
Mike Gorgone
(e-mail address removed)
Quite the Quandry here... I've got two list boxes with datasets bound
to them. Items from the listboxes can be moved from one listbox to
another and vice versa. The problem is that when a listbox is empty
the first time I load it the load takes about 2 seconds and after that
it's nice and quick (even if I close and reopen the form). So the
lists look like this...
List1 List2
------- -------
Item1 Item2
Item3 [Add >>]
[<< Remove]
If the lists are in this configuration when I load up and then I
remove Item2 (moving it to List1) and then add any item from List1
back to List2 I get the delay. After that everything is fine. The
removal from List2 and addition to List1 is quick. I'm guessing
because there are items on the list already.
When the form loads I bind the datasets to the listboxes with the
DataSource property. The code I use to move an Item from List2 to
List1 is as follows and the slow down occurrs on the ImportRow line.
Dim SelectedRow As DataRow
SelectedRow = CType(AssignedSecurityRoles.SelectedItem,
DataRowView).Row
_List1DS.Tables(0).ImportRow(SelectedRow)
_List2DS.Tables(0).Rows.Remove(SelectedRow)
That's all the code I need to move the rows (reversed in the case of
an Item going from List1 to List2.
ANY help or insight on this would be greatly appreciated as I have now
spent 8 hours on the damn problem.
Thanks in advance,
Mike Gorgone
(e-mail address removed)