Im having Gird, Textbox and a search button in the form. User has to enter the value into the textbox and upon clicking the button, ive to show the records that matches the text from textbox in Radgrid. I've used the following code to accomplish the task.
protected
void imgSearch_Click(object sender, EventArgs e)
{
Grd1.EnableLinqExpressions =
false;
string l_filer = string.Empty;
if (!String.IsNullOrEmpty(txtName.Text.Trim()))
l_filer =
"name LIKE '" + txtName.Text.Trim() + "'";
else
l_filer =
"1 = 1 ";
GrdUDF.MasterTableView.FilterExpression =
"(" + l_filer + ")";
GrdUDF.Rebind();
}
Here the problem is, when I give the exact word in the textbox, it will give me the result. but I want to search the records using "Contains". say for example, If I'm giving "D" in textbox, it should show the list of records, that contains "D". if nothing I there, then I've to show all the records in the grid.
I dont know, where I slipped. any help????
thanks in advance,
Prabhu KS