473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1191
kenobewan
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

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

Similar topics

1
by: Gord | last post by:
Hello, Anybody know how to detect when a user drags between columns in a MSHFlexGrid when resizing column width? (Short of setting up a timer event that continuously monitors column width.)...
0
by: TJ Talluto | last post by:
<facts> I have a "month calendar" that always displays exactly 42 days... and alongside is a vertical box that displays the detail (form fields) of any particular select event that appears on the...
1
by: Terry | last post by:
I've seen several posts from people who have seen this flashing in TreeView's when resizing a form. I've noticed it in my app, but only in the child windows. For example, my main form has a...
3
by: bismarkjoe | last post by:
Hello, I am trying to set the widths on the columns of a DataGrid component, and I'm not sure if I'm doing it correctly. My code is below: //load some inital data table = db.GetDataTable(...
1
by: anuparvathy | last post by:
I am developing a web application.I am using a grid view to get the data from the database to my form.I want to resize each cell's width in my grid.In the properties window i tried to change the...
0
by: anuparvathy | last post by:
Hi I am creating a website using visual studio 2005. In the design view of my asp.net page i have placed a grid view and then i have connected it to the database also. i have set the item style...
6
TMS
by: TMS | last post by:
This spreadsheet is almost done, but there is some functionality that is driving me nuts. For instance: a cell, for instance 'a0' is to have 'a0' as a string, but if something is entered like...
2
by: spinow | last post by:
Hi there, My current project has a div with a table inside it. In this table I have a cell. In this cell images are loaded using a javascript function and the images are resized to fit the cell with...
9
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.