Is there a way to align (horizontally center) a HyperLinkColumn of an aspdatagrid?

Posted on 2005-04-02
Medium Priority
Last Modified: 2010-08-05
I have a datagrid where I am including an image using a HyperLinkColumn using the following code (I didnt add the navigation url yet):

<asp:HyperLinkColumn Text ="<img border=0 src=../images/icons/trash-24.png>" />

When the data grid is displayed in the UI it is left justified.  Is there a way to center this icon in the column?
Question by:egdigital
LVL 18

Accepted Solution

tusharashah earned 500 total points
ID: 13689833
Add Style like following:

<asp:HyperLinkColumn Text ="<img border=0 src=../images/icons/trash-24.png>" >                                                            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
            <ItemStyle HorizontalAlign="Center"></ItemStyle>


Author Comment

ID: 13690415
Great, thanks a lot tushar that works perfectly

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month12 days, 21 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question