Click here to Skip to main content
13,298,551 members (37,773 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i have one grid in this multiple column,city,song name and download...
but this grid is left side of page nd i want to display error message in right side of gridview but my grid width is too much big bcz of song name (column )is big so that msg display in below of grid so how i can manage width of that column???or how to reduce that column width???
please help me....
thanks in advance
Posted 8-Dec-12 1:24am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try this

protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
GridView1.Columns[2].ItemStyle.Width =300;
GridView1.Columns[2].ItemStyle.Wrap = false;


for button click

for (int i = 0; i < GridView1.Columns.Count; i++)
GridView1.Columns[i].ItemStyle.Width = 300;
GridView1.Columns[i].ItemStyle.Wrap = false;
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

In the Source on the page you can go in BoundField column and change its size right there.
<asp:BoundField HeaderText="City"; DataField="VARCHARCITY"; ItemStyle-HorizontalAlign="Center" ItemStyle-Width="250px"/>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171207.1 | Last Updated 12 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100