checkbox in headercolumn does not align properly

i have the gridview where one checkall checkbox is placed on the header ,
but it is aligned slightly to the right.
<HeaderStyle HorizontalAlign="Left" BackColor="#BDBDBD" />
                    <Columns>
                    
                         <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox id="cbDelete" runat="server" />
                            <asp:Label ID="lblIDField" Visible="false" Text='<%# Eval("sid") %>' runat="server" />
                            <asp:Label ID="lblLSIDField" Visible="false" Text='<%# Eval("lsid") %>' runat="server" />
                    
                         </ItemTemplate>
                         <HeaderTemplate>
                         <asp:CheckBox id="cbAll"  runat="server" />
                         </HeaderTemplate>
                    </asp:TemplateField>

Open in new window

untitled06.bmp
LVL 1
doramail05Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Maybe you could add non-breaking space/s at the right side of the checkbox.  Something like:

<HeaderTemplate>
                         <asp:CheckBox id="cbAll"  runat="server" />&nbsp;&nbsp;
                         </HeaderTemplate>
Dhanasekaran SengodanCommented:
Apply Header Template Style in GridView Tag

ex
===

HeaderStyle-HorizontalAlign="Left"


doramail05Author Commented:
cannot

i even tried <HeaderTemplate>
                         <span style="padding-left:auto"><asp:CheckBox id="cbAll"  runat="server" /></span>
                         </HeaderTemplate>

guess it would not
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Alfred A.Commented:
OK.  Your Header checkbox is in the center of the column.  You have two options.

You can set

<ItemStyle HorizontalAlign="Center" />
                                   
Or,

<HeaderStyle HorizontalAlign="Left" />

Something like this

<ItemTemplate>
                            <asp:CheckBox id="cbDelete" runat="server" />
                            <asp:Label ID="lblIDField" Visible="false" Text='<%# Eval("sid") %>' runat="server" />
                            <asp:Label ID="lblLSIDField" Visible="false" Text='<%# Eval("lsid") %>' runat="server" />
                   
                         </ItemTemplate>
                         <HeaderTemplate>
                         <asp:CheckBox id="cbAll"  runat="server" />
                         </HeaderTemplate>
<HeaderStyle HorizontalAlign="Left" />
Dhanasekaran SengodanCommented:
try this

<span style="float:left">

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alfred A.Commented:
Oh I forgot to include in the my previous post, this should be included inside the template field


<asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox id="cbDelete" runat="server" />
                            <asp:Label ID="lblIDField" Visible="false" Text='<%# Eval("sid") %>' runat="server" />
                            <asp:Label ID="lblLSIDField" Visible="false" Text='<%# Eval("lsid") %>' runat="server" />
                   
                         </ItemTemplate>
                         <HeaderTemplate>
                         <asp:CheckBox id="cbAll"  runat="server" />
                         </HeaderTemplate>

                          <HeaderStyle HorizontalAlign="Left" />  

                    </asp:TemplateField>
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.