Yes, what I'm trying to do is using the same event (i.e. only one
rutine) to handle each individual event in each checkbox to generate
the string filter. I wouldn't want to generate 50 events rutine, one
for each checkbox.

For better understanding, the event I have with one checkbox does
this:

        private void S01_CheckedChanged(object sender, EventArgs e)
        {
            filter_gen();
        }

In this way the filter_gen() rutine generates the filter string
inmediately after the user check or uncheck a checkbox. The thing is
that I have 50 of these checkboxes and I don't know how to make ONLY
one rutine, instead of 50, one for each one of them.
Is there a way of doing this? or is it just impossible?



On Feb 15, 1:06 pm, Cerebrus <[email protected]> wrote:
> Not sure I understand correctly, especially the meaning of this line:
> "but I don't want to generate 50 CheckedChanged events triggering the
> same function".
>
> It appears that you understand that you can handle all 50 events using
> the same EventHandler. I don't see what problem you would have with
> that way of doing it.
>
> Personally, though, I'd generate my filter string just before the act
> of filtering itself.
>
> On Feb 14, 2:55 pm, Nacho108 <[email protected]> wrote:
>
> > Hi everybody!
>
> > I'm making an application which creates a filter which I apply later
> > to a dataview based on the selection of the user.
> > The selection is made through checkboxes, 50 of them to be exact. For
> > that I create a function which generates the filter string based on
> > the checkboxes. The thing is that I would like to generate the new
> > string in the same moment the user check or uncheck a control, but I
> > don't want to generate 50 CheckedChanged events triggering the same
> > function.
> > Also I don't see a good solution to use a timer that every a certain
> > time re-generates the filter string.
>
> > Is there a way to "group" all CheckedChanged events in a way I can
> > trigger this function only one time?
>
> > Thanks!

Reply via email to