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
| void grdFinancialPeriods_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| BindGrid(); |
| } |
| private void BindGrid() |
| { |
| int count = 0; |
| FinancialPeriodManagerClient service = new FinancialPeriodManagerClient(); |
| grdFinancialPeriods.MasterTableView.FilterExpression = string.Empty; |
| Prd[] list = service.GetAllFinancialPeriods(out count, grdFinancialPeriods.PageSize, |
| grdFinancialPeriods.MasterTableView.CurrentPageIndex * grdFinancialPeriods.PageSize, |
| (Behsaman.FilterItemList)Session["filterItemList"], |
| (SortItem)Session["SortExpression"]); |
| grdFinancialPeriods.DataSource = list; |
| grdFinancialPeriods.VirtualItemCount = count; |
| grdFinancialPeriods.DataBind(); |
| service.Close(); |
| } |
| public List<Prd> GetAllFinancialPeriods(int maximumRows, int startRowIndex, |
| FilterItemList filterItemList, SortItem sortItem, out int count) |
| { |
| var query = (from prd in Generals.Db.Prds |
| select prd); |
| query = GetFilterQuery(query, filterItemList); |
| query = GetSortQuery(query, sortItem); |
| count = query.Count(); |
| return query.Skip(startRowIndex).Take(maximumRows).ToList().Deserialize<Prd>(); |
| } |
| <SCRIPT language=javascript type=text/javascript>var intervalID = setInterval('MasterItemShowing();', 10000);function MasterItemShowing(){$find('Vitrinas_RadRotator1').showNext(Telerik.Web.UI.RotatorScrollDirection.Up);}function ClientItemShowing(slider,args){ $find('Vitrinas_RadRotator2').showNext(slider.get_animationDirection());}</SCRIPT> |
<
body style="overflow-x:hidden;">
<
form runat="server">
<
asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<
div id="global" runat="server">
<
uc1:rotator id="Vitrinas" runat="server"></uc1:rotator>
</
div>
UC
| HtmlGenericControl divrot = new HtmlGenericControl(); |
| divrot.ID = "idrot"+i; |
| divrot.Style.Add("float","left"); |
| RadRotator Rot = new RadRotator(); |
| int nu = i + 1; |
| Rot.ID = "RadRotator" + nu; |
| RotClientID.Add(Rot.ClientID); |
| Rot.Width =Unit.Pixel(rotateWidth); |
| Rot.Height =Unit.Pixel(rotateHeight); |
| Rot.ScrollDirection = RotatorScrollDirection.Left; |
| Rot.WrapFrames = true; |
| Rot.RotatorType = RotatorType.FromCode; |
| Rot.SlideShowAnimation.Type = Telerik.Web.UI.Rotator.AnimationType.Fade; |
| Rot.ItemWidth = Unit.Pixel(rotateWidth); |
| Rot.ItemHeight = Unit.Pixel(rotateHeight); |
| Rot.ItemTemplate =new RotatorTemplate(); |
| Rot.DataSource = listRotator;//DataSource |
