472,142 Members | 1,040 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

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 1135
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.