Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-02-2009
Member
 
Join Date: Feb 2009
Posts: 5
Putting a dropdownlist in the column header of a GridView

Hello,
I have a Datagrid, In ASP .net environment the user wants to replace the title of the column in the DataGrid with a DropDownlist. I really want to know how to do this?
Can anyone please help me out with the same.
Reply With Quote
  #2  
Old 10-02-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Putting a dropdownlist in the column header of a GridView

Assigning a DropDownList Value in a ASP.NET GridView Using ObjectDataSource
And
http://www.codeproject.com/KB/webfor...oBoxField.aspx

I think this page will help you more regarding your problem!
Reply With Quote
  #3  
Old 10-02-2009
Member
 
Join Date: May 2008
Posts: 40
Re: Putting a dropdownlist in the column header of a GridView

you need to have a template column and in the header template of that column you need to put your DropDown. Something like this -

Code:
 

1    <asp:TemplateField>
2    	<HeaderTemplate>
3    		<asp:DropDownList runat="server" ID="ddlHeaderText">
4    		</asp:DropDownList>
5    	</HeaderTemplate>
6    </asp:TemplateField>

I hope that will be helpful.
Reply With Quote
  #4  
Old 10-02-2009
Member
 
Join Date: May 2008
Posts: 115
Re: Putting a dropdownlist in the column header of a GridView

Take a loot at this link:

http://forums.asp.net/t/1001702.aspx

It describes how you can dynamically create TemplateFields for the GridView control.
Reply With Quote
  #5  
Old 10-02-2009
Member
 
Join Date: May 2008
Posts: 27
Re: Putting a dropdownlist in the column header of a GridView

You can write the code in the row databound event of the gridview.

such as like this

in that event...

1. first you specify some unique datakeynames for gridview.
2. whenever that rowdatabound event fire you can get the datakey for that row.
3. using that datakeyname ( may be questionid) you fire select query in that event function and bind that result with dropdown in that particular row.
4. your task completed.

I hope it will help you..
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Putting a dropdownlist in the column header of a GridView"
Thread Thread Starter Forum Replies Last Post
Connect USB 3.0 front case panel header to motherboard w/o a header? Dogs-Day-Out Motherboard Processor & RAM 4 14-04-2012 07:02 PM
Putting CHAR and INTEGER value in same column Garlands Software Development 3 11-02-2010 10:44 PM
How to highlight identical cell value of one column in another column? D_chapple Windows Software 3 09-12-2009 01:11 PM
IIS7: Add expires header or cache-control header quota Software Development 3 06-06-2009 07:45 PM
GridView in ASP dotnet need scroll for only a column RadhaV Software Development 3 04-02-2009 05:25 PM


All times are GMT +5.5. The time now is 09:22 AM.