Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 5th, 2006, 12:20 AM
Authorized User
 
Join Date: Jan 2006
Location: Hunza, Gilgit, Northern Areas, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default DropDownList in Header of GridView Control ...

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_SelectedInde xChanged" 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="+((DropDownLis t)(this.GridView1.HeaderRow.FindControl("DropDownL ist1"))).SelectedValue.ToString()) %>'
Text='<%# Eval("SchoolCode", "Get Details") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
********************************


Thanks in advance for your precious replies....

Abdul Ghaffar




Similar Threads
Thread Thread Starter Forum Replies Last Post
Two DropDownList Inside a Gridview ilayaraja ASP.NET 3.5 Basics 3 December 5th, 2008 06:26 PM
DropDownList in Gridview sdoremus ASP.NET 3.5 Basics 0 September 15th, 2008 07:15 PM
Gridview and DropDownList extendedram ASP.NET 2.0 Basics 3 June 12th, 2007 04:05 PM
Gridview and dropdownlist GuyB ASP.NET 1.0 and 1.1 Basics 0 November 9th, 2006 08:54 PM
DropDownList inside a GridView aidoco ASP.NET 2.0 Basics 0 October 13th, 2006 04:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.