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?
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>
0
Dhanasekaran SengodanCommented:
Apply Header Template Style in GridView Tag

ex
===

HeaderStyle-HorizontalAlign="Left"


0
doramail05Author Commented:
cannot

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

guess it would not
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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" />
0
Dhanasekaran SengodanCommented:
try this

<span style="float:left">
0

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>
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.