Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all

I facing problem in inserting a hyperlink button in gridview

1)from Add New Column i added one hyperlink field but when i m running the application it's not showing that column

and 2nd one
2)I want that column on right side of the gridview but by default it's coming left side..

Please tell the the problem...

Thank you

Below is my gridview HTML code:

ASP.NET
<pre lang="xml"><asp:GridView ID="GridView1" runat="server" BorderStyle="Solid"
                        ForeColor="Black" style="text-align: center" CellPadding="4"
                        CssClass="Gridview" onrowdatabound="GridView1_RowDataBound" Width="837px"
                        Height="199px" AllowPaging="True"
                        onpageindexchanging="GridView1_PageIndexChanging" BackColor="#CCCCCC"
                        BorderColor="#999999" BorderWidth="3px" CellSpacing="2">
                        <RowStyle BackColor="White" />
                        <FooterStyle BackColor="#CCCCCC" />
                        <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
Posted
Updated 11-Oct-12 20:53pm
v2
Comments
Mohd. Mukhtar 12-Oct-12 2:20am    
Could you please paste your html code of gridview?

Hi refer the below link this will may help you.

http://webdesign.ittoolbox.com/groups/technical-functional/asp-dotnet-l/linkbutton-in-gridview-2045194[^]

If you still not able to resolve the issue. Better you should copy your code here.
 
Share this answer
 
v2
Use the template of the gridview to put a hyperlink in your grid, to the new page.
Refer some threads:
Adding hyperlinkfields to gridview [^]
Use a HyperLink control inside a GridView[^]

Refer: CP Search[^]
..and more threads here[^]
 
Share this answer
 
CodeProject Frequently Asked Questions Series 1: The ASP.NET GridView[^] might give you some additional information.
 
Share this answer
 
use..itemtemplate mode of gridview..for taking control on the hyper link..refer this website..it gives an idea how u can load the required data to the hyperlink on the grid rowdatabound..

http://stackoverflow.com/questions/11193490/how-to-enable-and-disable-the-hyperlink-in-gridview[^]
 
Share this answer
 
v2
hi snehashish,

i think you should go for "edit Columns.." option from there you will get option for adding new column and you can also change the order of the columns(that is right or left)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900