Link to home
Start Free TrialLog in
Avatar of techprocess
techprocess

asked on

How to do grid column resizing at run time.

Hii,

we are facing one issue regarding grid column resizing in asp.net 3.5.
At run time, we want to re-size the column.
Please suggest on the same.

Thank in advance,
techprocess
Avatar of nost2
nost2

You can set the column size in event OnRowCreated.

    <asp:GridView runat="server" ID="Grid1" AutoGenerateColumns="false" OnRowCreated="RowCreated">
    <Columns>
    <asp:BoundField DataField="c1" />
    <asp:BoundField DataField="c2" />
    </Columns>
    </asp:GridView>
 
        protected void RowCreated(object sender, GridViewRowEventArgs e)
        {
            e.Row.Cells[0].Width = 800;
        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of techprocess
techprocess

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial