Re: Centering button in a datagrid column

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: tshad (tscheiderich_at_ftsolutions.com)
Date: 12/03/04


Date: Fri, 3 Dec 2004 08:48:48 -0800


"Patrick.O.Ige" <PatrickOIge@discussions.microsoft.com> wrote in message
news:71386D37-8547-47A8-AD3F-4A83B93E128B@microsoft.com...
> Yeah Tom..
> I understand u but what can we do..
> Developers look for solutions and you have to provide it..
> Anyway good it worked!!
> By the way are you on MSN?IF you are send me your ID..

No, I'm not - sorry.

You're right about looking for solutions. Glad to have found a solution.
We spend much time trying to solve things that should work (or that you
would expect to happen a certain way but don't). Many hours are spent
trying find or engineer band-aids. That's what keeps it interesting.

Tom
> Enjoy
> Patrick
>
> "tshad" wrote:
>
>> "Patrick.O.Ige" <PatrickOIge@discussions.microsoft.com> wrote in message
>> news:8E5993F2-085F-4AA5-8876-78A48723EF20@microsoft.com...
>> > Hi Tom..
>> > What i did was wrap the LinkButton with DIV Element like so...
>> >
>> > <asp:TemplateColumn ItemStyle-Width="10%"
>> > ItemStyle-HorizontalAlign="Center">
>> > <FooterTemplate>
>> > <div align="center">
>> > <asp:LinkButton CommandName="Insert" Text="<img
>> > src='..\images\Add.gif'border='0'>" ID="btnAdd" Runat="server" />
>> > </div>
>> > </FooterTemplate>
>> > <ItemTemplate>
>> > <asp:LinkButton CommandName="Delete" Text="<img
>> > src='..\images\Delete.gif'border='0'>" ID="btnDel" Runat="server" />
>> > </ItemTemplate>
>> > </asp:TemplateColumn>
>> >
>> > It should WORK...Let me know!
>>
>> I did that, as you suggested, and it did work.
>>
>> My question is why wouldn't the other one work.
>>
>> Here is my code now:
>>
>> *****************************************************
>> <asp:TemplateColumn ItemStyle-Width="20%"
>> ItemStyle-CssClass="tdCenter" >
>> <FooterTemplate>
>> <div align="center">
>> <asp:LinkButton CommandName="Insert" Text="<img
>> src='..\images\Add.gif'border='0'>" ID="btnAdd" Runat="server" />
>> </div>
>> </FooterTemplate>
>> <ItemTemplate>
>> <asp:LinkButton CommandName="Delete" Text="<img
>> src='..\images\Delete.gif'border='0'>" ID="btnDel" Runat="server" />
>> </ItemTemplate>
>> </asp:TemplateColumn>
>> *****************************************************************************
>>
>> As you can see, I don't need the <div> tags to center the ItemTemplate,
>> so
>> why do I need it for the FooterTemplate.
>>
>> It's these little inconsistancies that drive me nuts.
>>
>> Thanks for the help.
>>
>> Tom.
>> > Patrick
>> >
>> >
>> >
>> >
>> >
>> >
>> > "tshad" wrote:
>> >
>> >> "Patrick.O.Ige" <PatrickOIge@discussions.microsoft.com> wrote in
>> >> message
>> >> news:F3E93C86-2FA4-4260-A83A-B37F6C1C035B@microsoft.com...
>> >> > Hi Tom,
>> >> > Did you get the working solution i sent to you?
>> >> > Let me know!
>> >> > Patrick
>> >> >
>> >>
>> >> I did answer you on that one - maybe you didn't get it.
>> >>
>> >> You're right. My mistake. But the .css file had it correct, I just
>> >> added
>> >> an extra dot for some reason in the post.
>> >>
>> >> It still doesn't work. But only for the Footer, as I mentioned. It
>> >> does
>> >> work for the ItemTemplate.
>> >>
>> >> Thanks,
>> >>
>> >> Tom
>> >> >
>> >> >
>> >> > "naija naija" wrote:
>> >> >
>> >> >> Tom,
>> >> >> U were missing something i guess i tried ur code and i added CCS
>> >> >> to
>> >> >> LinkButton:-
>> >> >> <asp:LinkButton CommandName="Insert" CssClass="tdCenter" text="<img
>> >> >> src='..\images\Add.gif'border='0'>"ID="btnAdd" Runat="server" />
>> >> >> But i guess it wasn't the problem which i taught it was.
>> >> >> I later found out u that the CSS u posted had double dots like so:-
>> >> >> ..tdCenter {
>> >> >> text-align:center;
>> >> >> }
>> >> >> so i changed it to(WITH one DOT before "tdCenter" :-
>> >> >> .tdCenter {
>> >> >> text-align:center;
>> >> >> }
>> >> >>
>> >> >> So adding CSS to "<asp:TemplateColumn ItemStyle-Width="10%"
>> >> >> ItemStyle-CssClass="tdCenter">" was good and u were doing the right
>> >> >> thing but u added to much DOTS:):)
>> >> >>
>> >> >> Hope this helps..and let me know if it worked!
>> >> >> Patrick
>> >> >>
>> >> >>
>> >> >>
>> >> >> *** Sent via Developersdex http://www.developersdex.com ***
>> >> >> Don't just participate in USENET...get rewarded for it!
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>


Quantcast