Hi all, i have a treeviewlist and use it to apply filters for a database, on the 'afterselect' event. Which all works great, how ever some possible filters could be quite lengthy, heres an example;
vb Code:
If e.Node.Text = "Early Childhood (EC)" Or e.Node.Text = "Everyone (E)" Or e.Node.Text = "Everyone 10+ (E10+)" Or e.Node.Text = "Teen (T)" Or e.Node.Text = "Mature (M)" Or e.Node.Text = "Adults Only (AO)" Or e.Node.Text = "Rating Pending" Then TblContactsBindingSource.Filter = String.Format("ESRB = '{0}'", e.Node.Text) lbg1.SetSelected(0, True)
One elseif statement has 30 'Or e.Node.Text = "somestring" '
So is there a better/neater way to do this?
Thanks.




Reply With Quote