|
Subject:
|
DropDownList in Header of GridView Control ...
|
|
Posted By:
|
hunzian78@yahoo.com
|
Post Date:
|
12/4/2006 11:20:57 PM
|
Hi All.. Well dearz I am facing a difficulty in sending the selected value as query string from the Dropdwonlist(in Header of GridView Control) and GridView control's one of column through the HyperLinkButton of GridView Control to another page. I not able to send the second or third selected value from the dropdownlist to another page, although the first selected value can be. Actually there is the problem of posting back. Please try to understand the whole scenario..
This is the code I am working on *********************************** <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="SchoolCode" DataSourceID="AccessDataSource1"> <Columns> <asp:BoundField DataField="SchoolCode" HeaderText="SchoolCode" ReadOnly="True" SortExpression="SchoolCode" /> <asp:BoundField DataField="SchoolName" HeaderText="SchoolName" SortExpression="SchoolName" /> <asp:BoundField DataField="VillageName" HeaderText="VillageName" SortExpression="VillageName" /> <asp:TemplateField> <HeaderTemplate> Select Year: <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True"> <asp:ListItem>2006</asp:ListItem> <asp:ListItem>2005</asp:ListItem> </asp:DropDownList> </HeaderTemplate> <ItemTemplate> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("SchoolCode", "Default2.aspx?SchoolCode={0}&Year="+((DropDownList)(this.GridView1.HeaderRow.FindControl("DropDownList1"))).SelectedValue.ToString()) %>' Text='<%# Eval("SchoolCode", "Get Details") %>'></asp:HyperLink> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> ********************************
Thanks in advance for your precious replies....
Abdul Ghaffar
|
|