469,904 Members | 2,309 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

resizing cell width in a grid view

Hi all!

I am creating a website using visual studio 2005.in my design view of asp.net page i have placed a grid view in the form.now i want to resize the width of each and every cell.how can i resize it?what code should i write for that?i am using c#. so can someone give me the code for that?

Please help.Thanking in advance.
Feb 28 '07 #1
1 1080
4,871 Expert 4TB
Here is a datagrid example, the principle is the same:
Expand|Select|Wrap|Line Numbers
  1. private void DataGrid1_ItemCreated(object sender, 
  2. System.Web.UI.WebControls.DataGridItemEventArgs e)
  3. {
  4.    e.Item.Cells[0].Width = new Unit(100);
  5.    e.Item.Cells[1].Width = new Unit(50);
Mar 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Gord | last post: by
3 posts views Thread by bismarkjoe | last post: by
1 post views Thread by anuparvathy | last post: by
6 posts views Thread by TMS | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.