This is a migrated thread and some comments may be shown as answers.

Templatecolumn-HyperLink Veritcal Align issue

2 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sameers
Top achievements
Rank 1
Sameers asked on 01 Aug 2012, 03:09 PM
Its been weird. I have forced to be veritical align=top to all elements of the grid (built using Templatecolumns) where everything works fine except those template columns which has HyperLink in it. For example,

<telerik:GridTemplateColumn HeaderText="Qty" SortExpression="InventoryAvailableQty" UniqueName="InventoryAvailableQty" ItemStyle-VerticalAlign="Top">
                                <ItemTemplate>                                       
                                    <asp:HyperLink ID="hypInventoryMovement" runat="server" Target="_blank" NavigateUrl='<%# "ProductWarehouse.aspx?ID=" & Eval("ID") %>'>
                                        <asp:Label ID="lblInventoryAvailableQty" runat="server" Text='<%# eval("InventoryAvailableQty") %>' Visible="false"></asp:Label>
                                    </asp:HyperLink>                                    
                                    <asp:TextBox ID="txtInventoryAvailableQty" Width="30" runat="server" Text='<%# eval("InventoryAvailableQty") %>'></asp:TextBox>                                    
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

Where I display or hide either hyperlink column OR the textbox based on the view mode of the grid.
This column, when displaying hyperlink, is a bit off from the top, while other columns which has only label, are well aligned to the top. If I change this hyperlink to the Lable only, then it works fine too. I noticed that few other columns in the grid also have same issue.

I used following CSS to force vertical align = top

tr.rgRow td, tr.rgAltRow td
   {
       vertical-align: top;
   }

Is there something I missing? Please suggest.
thanks,
Sameers

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 06 Aug 2012, 08:20 AM
Hello Sameers,

I have created a sample RadGrid web site where I demonstrated that the vertical alignment of a hyperlink column or a template column containing a hyperlink both work as expected. Please check out the attached application and try to distinguish the crucial differences between our projects.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Sameers
Top achievements
Rank 1
answered on 07 Aug 2012, 12:26 PM
Hi Eyup,

  Thanks for the help. I just figured that out.

   There is Nothing Wrong with Telerik, (I beleived that already though). There was a style in my CSS causing the issue. The problem style was 

{
    line-height:25px;
}

I changed the height (or set to normal) and things went well as expected.

thanks again Telerik.
Sameers
Tags
Grid
Asked by
Sameers
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Sameers
Top achievements
Rank 1
Share this question
or