467,150 Members | 1,210 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,150 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
  • viewed: 1030
Share:
1 Reply
kenobewan
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
TMS
6 posts views Thread by TMS | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.