Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

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
0
techprocess
Asked:
techprocess
1 Solution
 
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
 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now