r4r4
r4r4

Reputation: 75

CommandField ImageButtons to Render side by side

Cannot make Update and Cancel ImageButtons to render side by side in a GridView, they are always stacked on top of each other in this Edit CommandField no matter how wide I make the column:

<asp:CommandField ButtonType="Image" ShowEditButton="true" HeaderText="Edit" EditImageUrl="~/i/BlueButton.jpg" ControlStyle-CssClass="center-block"
    CancelImageUrl="~/i/Cancel.jpg" UpdateImageUrl="~/i/Update.jpg" >
    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="25px" Width="100px" />
</asp:CommandField>

I tried many approaches in vain; for example, wrapping the commandfield in a div - failed, probably because I tried to do it inside the GridView; could not find a combination of alignment specifications that would work.

Upvotes: 0

Views: 275

Answers (1)

r4r4
r4r4

Reputation: 75

Thank you, Martin! Solved simply by dropping ControlStyle-CssClass="center-block". Centering the controls is taken care of in ItemStyle.

Upvotes: 0

Related Questions