First of all I must say that I am a newbie when it comes to net (C#).
Here is my problem.
I can not populate the DropDownList with ID="ddlName" when select the value in the DropDownList with ID="ddlMatr" and vice versa.
If you have link for similar task, please give it me.
Can you explain any one or any sample code related this.
Your help would be very appreciated.
Thanks in advance for your time and hints.
Cheers.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
Chevy Mark SunderlandPosted Jul 21, 2012, 7:00 AM
I need filtering gridview with the ObjectDataSource control.
e.g.: http://www.obout.com/grid/aspnet_filtering_performance.aspx
Can you help me?
Rahul BhattPosted Jul 21, 2012, 3:06 AM
Chane your ddlName as folloiwng way
Remove AppendDataBoundItems from Dropdown property
<asp:DropDownList ID="ddlName" runat="server" DataSourceID="dsName" DataValueField="Name"
AutoPostBack="true" Width="120px" Font-Size="11px" >
<asp:ListItem Text="All" Value="%" />
asp:DropDownList>
Change your SQL DataSource dsName as following way
Filter expression make equal instead of like
<asp:SqlDataSource ID="dsName" runat="server" ConnectionString="<%$ ConnectionStrings:ConnMySQL %>"
ProviderName="<%$ ConnectionStrings:ConnMySQL.ProviderName %>" SelectCommand="Select Matr, Name from tbl_1"
FilterExpression=" Matr = '{0}'">
<FilterParameters>
<asp:ControlParameter Name="Matr" ControlID="ddlMatr" PropertyName="SelectedValue" />
FilterParameters>
asp:SqlDataSource>