For the below code ,
how to text-align :center,
And how to fit photo column without any gaps i.e. (how to remove unwanted gap in that photo column)
<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" AutoGenerateColumns="false" > <Columns> <asp:TemplateField HeaderText="UserId"> <ItemTemplate> <asp:Label ID="Label9" runat="server" Text='<%# Bind("id") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Name"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Photo" > <ItemTemplate > <asp:Image ID="Image3" runat="server" ImageUrl='<%# "data:image/jpg;base64," + Convert.ToBase64String((byte[])Eval("images")) %>' Width="125px" Height="55px" CssClass="myin" ></asp:Image> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Designation" > <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("designation") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="#99CCCC" ForeColor="#003399" /> <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" /> <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" /> <RowStyle BackColor="White" ForeColor="#003399" /> <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" /> <SortedAscendingCellStyle BackColor="#EDF6F6" /> <SortedAscendingHeaderStyle BackColor="#0D4AC4" /> <SortedDescendingCellStyle BackColor="#D6DFDF" /> <SortedDescendingHeaderStyle BackColor="#002876" /> </asp:GridView>
i didn't see any gap in the photo column as your screen short,
But i'm getting gap at Bottom of image ,
right know i tried like Below
finally my proBlem is solved By add property :- ImageAlign="AbsBottom"
thank's for quick reply :-)
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.