By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,836 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,836 IT Pros & Developers. It's quick & easy.

resizing cell width in a grid view

P: 25
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
Share this Question
Share on Google+
1 Reply


kenobewan
Expert 2.5K+
P: 4,871
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.