Re: Newbie Question: Distinguishing between user click and binding context position change

From: Rajesh Patel (rdp647_at_hotmail.com)
Date: 12/14/04


Date: Tue, 14 Dec 2004 17:13:16 -0500

I believe basically you want to perform actions on combobox if user changes
them, not because of bindingcontext change.

There are 2 possible solutions I can think,

1. Use Removehandler and addhandler for all combobox. use removehandler in
listbox before you start poplulate details' combobox and addhandler as soon
as you finished binding combobox with details' records.

2. use boolean variable blnByBinidingcontext. before you populate values
for comboboxes make this variable true. after binding every combobox make it
again false. This variable should be private at class level. Check this
boolean variable in combobox's selectedindexchanged event. if
blnByBinidingcontext = true then exit procedure.

Regards,
Rajesh Patel

<Eric> wrote in message news:O0gdWtV4EHA.1204@TK2MSFTNGP10.phx.gbl...
> Hello,
>
> I have a master/detail form using a typed DataSet-a ListBox with the
> "master" records and several ComboBoxes with "detail" records. On the
> SelectedIndexChanged handler for the ListBox, it selects the appropriate
> detail records in the ComboBoxes. This, of course, raises a
> SelectedIndexChanged for the detail ComboBoxes.
>
> How, then, can I know if the detail ComboBoxes' SelectedIndexChanged
events
> fired because the user changed them or because the binding context changed
> them by changing the master record's position?
>
> Thank you,
>
> Eric
>
>



Relevant Pages

  • Re: Newbie Question: Distinguishing between user click and binding context position change
    ... SelectedIndexChanged events was on form load when the ComboBox was bound to ... To fix this, I just declared a Boolean var, IsFormLoad. ... Within each combo box's SelectedIndexChanged event, ... > as you finished binding combobox with details' records. ...
    (microsoft.public.dotnet.framework.windowsforms.databinding)
  • Re: DatagridView Binding
    ... You are binding your datagridview to the same table you ... You need to bind the combobox to the student table, and the datagridview to ... filter the datagridview on the matching column ...
    (microsoft.public.dotnet.general)
  • DataGridView Bound ComboBoxColumn cell take several seconds to show edit control
    ... I am binding a custom object list to a ComboBox ... dropdown the ComBox when the user hits Enter. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Select or Filtering on a related group
    ... >> Binding. ... >> You could bind all three objects, the Securities ComboBox, the Exchanges ... > this to Filter the ExchSec DataView.. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Question about Data Binding
    ... I'm having a combobox/data binding issue also and like Markward, ... >> public string uniqueId; ... >> values of ArrayList-Item number 1, no matter, what Item was selected in ... >> the Combobox. ...
    (microsoft.public.dotnet.framework.compactframework)

Loading