views:

1436

answers:

1

I have a gridview whose datasource is an oracle database. I want to know how to be able to change column width (in the gridview) when it is being displayed in the web browser.

Thank you

A: 

Hi zohair--

You can set the column directly with the GridView tag:

<asp:GridView ID="myGrid" runat="server">
  <Columns>
    <asp:BoundField DataField="myColumn" ControlStyle-Width="25%" />
  </Columns>
</asp:GridView>

You could also assign the column a CSS class, and then use CSS to set the column width.

Jeremy Kratz