Hi
I am using Radgrid having filtering controls. I used to call each filter control event at code behind. But theproblem is i could get filtered data only from the last control event fired,though i preserved the first control value it didnt take an account that value by the last control event value only taken.
So i need the filtering based on all control values even though i used to select randomly
My cs code:
//First Combo
protected void JurisdictionCodeComboBox_IndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
string filterExpression = "";
string query = "";
if (e.Text.IndexOf(",") > -1)
{
string[] values = e.Text.Split(',');
for (int i = 0; i < values.Length; i++)
{
query += "'" + values[i] + "',";
}
query = query.Remove(query.Length-1, 1);
}
else
{
query = "'" + e.Text + "'";
}
if (e.Value != "All")
{
filterExpression = "([JurisdictionCode] in (" + query + "))";
}
else
{
filterExpression = "([JurisdictionCode] <> '')";
}
hdnJurisdictionCode.Value = e.Text.ToString();
RadGrid1.MasterTableView.FilterExpression = filterExpression;
}
//Second Combo
protected void FergTechNumComboBox_IndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
string filterExpression = "";
string query = "";
if (e.Text.IndexOf(",") > -1)
{
string[] values = e.Text.Split(',');
for (int i = 0; i < values.Length; i++)
{
query += "'" + values[i] + "',";
}
query = query.Remove(query.Length - 1, 1);
}
else
{
query = "'" + e.Text + "'";
}
if (e.Value != "All")
{
filterExpression = "([FergTechNum] in (" + query + "))";
}
else
{
filterExpression = "([FergTechNum] <> '')";
}
hdnFergTechNum.Value = e.Text.ToString();
RadGrid1.MasterTableView.FilterExpression = filterExpression;
}
Appu
I am using Radgrid having filtering controls. I used to call each filter control event at code behind. But theproblem is i could get filtered data only from the last control event fired,though i preserved the first control value it didnt take an account that value by the last control event value only taken.
So i need the filtering based on all control values even though i used to select randomly
My cs code:
//First Combo
protected void JurisdictionCodeComboBox_IndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
string filterExpression = "";
string query = "";
if (e.Text.IndexOf(",") > -1)
{
string[] values = e.Text.Split(',');
for (int i = 0; i < values.Length; i++)
{
query += "'" + values[i] + "',";
}
query = query.Remove(query.Length-1, 1);
}
else
{
query = "'" + e.Text + "'";
}
if (e.Value != "All")
{
filterExpression = "([JurisdictionCode] in (" + query + "))";
}
else
{
filterExpression = "([JurisdictionCode] <> '')";
}
hdnJurisdictionCode.Value = e.Text.ToString();
RadGrid1.MasterTableView.FilterExpression = filterExpression;
}
//Second Combo
protected void FergTechNumComboBox_IndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
string filterExpression = "";
string query = "";
if (e.Text.IndexOf(",") > -1)
{
string[] values = e.Text.Split(',');
for (int i = 0; i < values.Length; i++)
{
query += "'" + values[i] + "',";
}
query = query.Remove(query.Length - 1, 1);
}
else
{
query = "'" + e.Text + "'";
}
if (e.Value != "All")
{
filterExpression = "([FergTechNum] in (" + query + "))";
}
else
{
filterExpression = "([FergTechNum] <> '')";
}
hdnFergTechNum.Value = e.Text.ToString();
RadGrid1.MasterTableView.FilterExpression = filterExpression;
}
Appu