Why ItemStyle-VerticalAlign=”Middle” not work in asp:GridView?, this is my code
<asp:GridView ID="GridView1" runat="server" RowStyle-VerticalAlign="Middle" >
<Columns>
<asp:TemplateField ItemStyle-VerticalAlign="Middle" HeaderText='<%$ Resources:Language, Admin_Employee_TimeTracker_GV_Code %>'>
<ItemTemplate>
<asp:TextBox id="txtReferenceCode" runat="server" text='<%# Bind("referenceCode")%>' MaxLength="100" Width="100px"></asp:TextBox>
</ItemTemplate>
<ItemStyle VerticalAlign="Middle" />
</asp:TemplateField>
Run the page, right-click, and view source; it’s probably adding the style to the wrong element. I think it adds it to the row, which it’s not setting correctly? I’ve experienced something like that with the empty data template…
Take a look and see which underlying HTML element it applies it too first.