DataGrid ButtonColumn ButtonType?

A

Arpan

An ASPX page retrieves records from a database table & displays them in
a DataGrid. Assume that one of the columns in the DB table is "Country"
which is rendered in the DataGrid as ButtonColumn whose ButtonType is
set to "PushButton" using the following code snippet:

<form runat="server">
<asp:DataGrid ID="dgUsers" runat="server">
<Columns>
<asp:ButtonColumn DataTextField="Country" ButtonType="PushButton"
HeaderText="COUNTRY"/>
</Columns>
</asp:DataGrid>
</form>

Now it's very much possible that, on most occasions, the countries
different users belong to won't be the same. For e.g. some will be from
India, some from Holland, some from Australia, some from France, some
from USA etc. Now since the length of the country names aren't the
same, the width of the buttons vary depending upon the length of the
country names. This gives a shabby look to the page.

How do I ensure that the width of all the buttons remain the same
irrespective of the length of the country names?

Thanks,

Arpan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top