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
LVL 3
techprocessAsked:
Who is Participating?
 
techprocessAuthor Commented:
thanks for suggestion, we have resolved the problem by following the javascript suggested on the following link

http://blogs.crankygoblin.com/blogs/geoff.appleby/articles/50712.aspx
 
 
0
 
nost2Commented:
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

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.