iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
When Ioading the page,I want to apply The custom Filter in the webgrid2,But it does not work.
(However,the gridview can apply The custom Filter )Could you show me a demo about custom Filter ?Anyone can help me ?thanks
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Pop1.aspx.cs" Inherits="Pop1" %> <%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %> <%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop" TagPrefix="ISWebDesktop" %> <%@ Register Assembly="ISNet.WebUI.WebInput" Namespace="ISNet.WebUI.WebControls" TagPrefix="ISWebInput" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <table width="375px"> <tr> <td width="45px"> 关键字 </td> <td> <ISWebInput:WebInput Width="100px" ID="WebInput1" runat="server"> </ISWebInput:WebInput> <asp:TextBox ID="TextBox1" runat="server" Text="大"></asp:TextBox> </td> <td> <ISWebDesktop:WebButton ID="WebButton2" runat="server" Height="20px" Text="查找" Width="50px" AutoPostback="true" PostBackMode="FlyPostBack"> </ISWebDesktop:WebButton> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Button" /> </td> </tr> <tr> <td colspan="3"> <ISWebGrid:WebGrid ID="WebGrid2" runat="server" Height="315px" UseDefaultStyle="True" Width="371px" DataSourceID="Sqltb_stock" DefaultStyleMode="Elegant"> <LayoutSettings AlternatingColors="false" AllowContextMenu="False"> <ClientSideEvents OnCellDblClick="DbclickAutoFill()" /> <SelectedRowStyle BackColor="#FFBD69" /> </LayoutSettings> <RootTable> <Columns> <ISWebGrid:WebGridColumn Caption="tradecode" DataMember="tradecode" Name="tradecode" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="fullname" DataMember="fullname" Name="fullname" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="unit" DataMember="unit" Name="unit" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="qty" DataMember="qty" DataType="System.Double" Name="qty" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="averageprice" DataMember="averageprice" DataType="System.Double" Name="averageprice" Width="100px"> </ISWebGrid:WebGridColumn> </Columns> </RootTable> </ISWebGrid:WebGrid> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="Sqltb_stock"> <Columns> <asp:BoundField DataField="tradecode" HeaderText="tradecode" SortExpression="tradecode" /> <asp:BoundField DataField="fullname" HeaderText="fullname" SortExpression="fullname" /> <asp:BoundField DataField="unit" HeaderText="unit" SortExpression="unit" /> <asp:BoundField DataField="qty" HeaderText="qty" SortExpression="qty" /> <asp:BoundField DataField="averageprice" HeaderText="averageprice" SortExpression="averageprice" /> </Columns> </asp:GridView> </td> </tr> </table> <asp:SqlDataSource ID="Sqltb_stock" runat="server" FilterExpression="fullname Like '%{0}%'" ConnectionString="<%$ ConnectionStrings:db_CMSConnectionString %>" SelectCommand="SELECT [tradecode], [fullname], [unit], [qty], [averageprice] FROM [tb_stock]"> <FilterParameters> <asp:ControlParameter ControlID="TextBox1" ConvertEmptyStringToNull="False" Name="fullname" PropertyName="Text" /> </FilterParameters> </asp:SqlDataSource> </form> </body> </html>
Hi Frank,
For applying custom filter on WebGrid, you can follow our WebGrid's documentation on Walkthrough: Applying Custom Filtering in WebGrid.
Please let me know if this the one you wanted.
Thank you and have a nice day.
Regards,Niven
I am sorry,I want to achieve the function such as ISDataSource >General>UsingFilterParameters.aspxBut when I click the button ,it will refresh the all page,using updatepannel can solve(It will run slowly)How can I custom filter on client-side????(when I click button ,it won't refresh the page)
Unfortunately, the sample you had given to me can't be achieve on client-side and also the given sample using the ISDataSource FilterExpression property to deal with specific scenario automatically and actually an SQL statement.
But the custom filter still need to be set up on server-side.
Regards,Niven.
I t is a pity to hear that,but thank you all the same!
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname