|
-
October 12th, 2005, 06:22 PM
#1
multiple rowfilter help please
i have the rowfilters running functioning individually but now i want to make one button that will pick up all 3 values and rowfilter that way, here is what i have, im pretty sure im goign to need some if/then's to get these 3 criteria to work togather, any help is appreciated!
private void btnSchoolFilter_Click(object sender, System.EventArgs e)
{
objdsStudents.Tables["students"].DefaultView.RowFilter = "schoolID =" + this.comboBox5.SelectedValue.ToString();
this.dataGrid1.Refresh();
}
private void button3_Click(object sender, System.EventArgs e)
{
objdsStudents.Tables["students"].DefaultView.RowFilter = "diabetes = 0";
this.dataGrid1.Refresh();
}
private void button4_Click(object sender, System.EventArgs e)
{
objdsStudents.Tables["students"].DefaultView.RowFilter = "zip =" + this.zipfilter.Text.ToString();
this.dataGrid1.Refresh();
}
-
October 13th, 2005, 01:09 AM
#2
Re: multiple rowfilter help please
You can use AND and OR to concat the RowFilters.
something like this...
objdsStudents.Tables["students"].DefaultView.RowFilter = "(schoolID = " + this.comboBox5.SelectedValue + ") AND diabetes = 0 AND zip = " + this.zipfilter.Text;
HTH.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|