G
Guest
I have a form with a DeptList, an EmployeeList and a panel containing a bunch
of textboxes for employee data, e.g. name, address, etc. The textboxes are
bound to a datatable in a dataset. The DeptList SelectedIndexChanged event
handler is used to populate the employeeList and its SelectedIndexChanged
event handler is used to populate the textboxes. I also have added a handler
for the DataColumnChanged event of the datatable
Private sub OnColChanged(..)
m_bDirty = true
end sub
and a handler for the panel validating event
private sub DataPanel_Validating(..)
if m_bDirty then
QuerySave ( this uses a msgbox to query the user)
end if
end sub
I now select an employee, enter some data in the text boxes and then click
an unselectd row in the DeptList. With the code in the validating handler
commented out, the DeptList SelectedIndexChanged event is raised and
everything works as expected. With the code include however, the DeptList
SelectedIndexChanged event either wasn't raised in the first place or was
surpressed because the event handler is not called. In fact even with the
code commented out, if I place a debup break point on the End Sub, the
SelectedIndexChanged is not called. Of course since the SelectedIndexChanged
is not called, nothing works correctly. The problem seems to be related to
the listbox because if I click a btn outside the panel everything works as
expected. The list box shows the correct line selected in either case. The
same behavior occurs if I put a breakpoint on the end sub of the OnColChanged
event handler, so that if I change some data and then click the list box, the
execution breaks in the OnColChanged handler and afterwards the
SelectedIndexChanged is not called. How do I get around this problem? Is
there some way to re-raise the pending events for the listbox?
of textboxes for employee data, e.g. name, address, etc. The textboxes are
bound to a datatable in a dataset. The DeptList SelectedIndexChanged event
handler is used to populate the employeeList and its SelectedIndexChanged
event handler is used to populate the textboxes. I also have added a handler
for the DataColumnChanged event of the datatable
Private sub OnColChanged(..)
m_bDirty = true
end sub
and a handler for the panel validating event
private sub DataPanel_Validating(..)
if m_bDirty then
QuerySave ( this uses a msgbox to query the user)
end if
end sub
I now select an employee, enter some data in the text boxes and then click
an unselectd row in the DeptList. With the code in the validating handler
commented out, the DeptList SelectedIndexChanged event is raised and
everything works as expected. With the code include however, the DeptList
SelectedIndexChanged event either wasn't raised in the first place or was
surpressed because the event handler is not called. In fact even with the
code commented out, if I place a debup break point on the End Sub, the
SelectedIndexChanged is not called. Of course since the SelectedIndexChanged
is not called, nothing works correctly. The problem seems to be related to
the listbox because if I click a btn outside the panel everything works as
expected. The list box shows the correct line selected in either case. The
same behavior occurs if I put a breakpoint on the end sub of the OnColChanged
event handler, so that if I change some data and then click the list box, the
execution breaks in the OnColChanged handler and afterwards the
SelectedIndexChanged is not called. How do I get around this problem? Is
there some way to re-raise the pending events for the listbox?