Ver Mensaje Individual
  #6 (permalink)  
Antiguo 13/01/2012, 19:46
asastrem
 
Fecha de Ingreso: agosto-2008
Mensajes: 142
Antigüedad: 15 años, 8 meses
Puntos: 2
Respuesta: Filtrar mientras se tipea

te mando los datos de mi hoja

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table style="width:100%; height: 50px;">
<tr>
<td align="left" valign="top">
<h3
style="width: 541px; font-family: Tahoma; ">Manage Licensees Catalog</h3>
</td>
</tr>
<tr>
<td bgcolor="Silver">
<asp:ImageButton ID="IBNewRecord" runat="server" AlternateText="Add Company"
ImageUrl="~/App_Themes/ButtonBarNew.gif" ToolTip="Add new record" />
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="true" Height="20px" Width="192px"></asp:TextBox>
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" align="top" Height="24px" Width="170px">
<asp:ListItem>Company</asp:ListItem>
<asp:ListItem>Contact</asp:ListItem>
<asp:ListItem>Nation</asp:ListItem>
</asp:DropDownList>
</td>
<td>


<asp:ImageButton ID="ImageButton1" runat="server" Height="20px"
ImageUrl="~/App_Themes/icons/search.png" Width="24px" />
</td>
</tr>
</table>

<table style="width:113%;">
<tr>
<td>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CellPadding="3" DataKeyNames="LicenID" DataSourceID="SqlDataSource1"
GridLines="None" EmptyDataText="No Records" BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellSpacing="1"
AllowPaging="True" Font-Size="Small" Width="1000px" PageSize="8">
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<Columns>
<asp:CommandField ButtonType="Image" EditImageUrl="../App_Themes/edit.gif"
HeaderText="Edit" ShowEditButton="True" />
<asp:BoundField DataField="LicenID" HeaderText="ID"
SortExpression="LicenID" ReadOnly="True" >
</asp:BoundField>
<asp:BoundField DataField="Company" HeaderText="Company"
SortExpression="Company" />
<asp:BoundField DataField="Direccion" HeaderText="Address"
SortExpression="Direccion">
</asp:BoundField>
<asp:BoundField DataField="Ciudad" HeaderText="City"
SortExpression="Ciudad" >
</asp:BoundField>
<asp:BoundField DataField="Region" HeaderText="Region"
SortExpression="Region" >
</asp:BoundField>
<asp:BoundField DataField="CodigoPostal" HeaderText="Z P"
SortExpression="CodigoPostal" />
<asp:BoundField DataField="Nation" HeaderText="Nation"
SortExpression="Nation" >
</asp:BoundField>
<asp:BoundField DataField="Telefono1" HeaderText="Telephone"
SortExpression="Telefono1" >
</asp:BoundField>
<asp:BoundField DataField="Contact" HeaderText="Contact"
SortExpression="Contact" >
</asp:BoundField>
<asp:BoundField DataField="CorreoCont" HeaderText="e mail"
SortExpression="CorreoCont" />
</Columns>
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
</asp:GridView>
<br />
</td>
</tr>
</table>

<table style="width:100%;">
<tr>
<td>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [LicenID], [Company], [Direccion], [Ciudad], [Region], [CodigoPostal], [Nation], [Telefono1], [Fax], [Contact], [TelefonoCont], [CorreoCont] FROM [Licenciatarios]
WHERE (Company LIKE '%' +@Company+ '%')Or (Contact LIKE '%' +@Contact+ '%') Or (Nation LIKE '%' +@Nation+ '%')" FilterExpression="{0} LIKE '%{1}%'">

<FilterParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="FieldToSearch" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TextBox1" Name="SearchCriteria" PropertyName="Text" />
</FilterParameters>
<SelectParameters>
<asp:ControlParameter ControlID="TextBox1" Name="Company" PropertyName="Text" />
<asp:ControlParameter ControlID="TextBox1" Name="Contact" PropertyName="Text" />
<asp:ControlParameter ControlID="TextBox1" Name="Nation" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
<br />
</td>
</tr>
</table>
<div>

</div>

</asp:Content>