Hi,
I am using Visual studio c# aspx forms and i am using a data grid that pulls data from our sql server, this is working fine, but there are a few columns that have quite a bit of data compared to others, e.g firstname, surname, date, problem details etc, the latter being more like a paragraph and i wanted to know if it is possible to alter individual columns widths to suit. My first week on C# so any help would be great.
If there is a way a small example would be appreciated.
Cheers
VS c# Manipulate DataGrid Column Widths
Page 1 of 15 Replies - 884 Views - Last Post: 30 January 2012 - 07:09 AM
Topic Sponsor:
Replies To: VS c# Manipulate DataGrid Column Widths
#2
Re: VS c# Manipulate DataGrid Column Widths
Posted 25 January 2012 - 02:50 PM
Something like:
See the official Docs for more:
msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.width.aspx
DataGridViewColumn column = dataGridView.Columns[0]; column.ItemStyle.Width = 60;
See the official Docs for more:
msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.width.aspx
This post has been edited by Sergio Tapia: 25 January 2012 - 02:51 PM
#3
Re: VS c# Manipulate DataGrid Column Widths
Posted 26 January 2012 - 02:56 AM
Strangely but the URL parser won't parse the URL unless you out http:// in front of the address. (At least in my case: I'm using Chrome)
DataGridViewColumn.Width Property
DataGridViewColumn.Width Property
This post has been edited by RexGrammer: 26 January 2012 - 02:58 AM
#4
Re: VS c# Manipulate DataGrid Column Widths
Posted 26 January 2012 - 03:42 PM
Thanks for the reply,
I forgot to add this is an aspx web form and i cannot see DatGridView in the Toolbox, would this still be the same syntax? or should i be using/ looking for something else.
Thanks
I forgot to add this is an aspx web form and i cannot see DatGridView in the Toolbox, would this still be the same syntax? or should i be using/ looking for something else.
Thanks
#5
Re: VS c# Manipulate DataGrid Column Widths
Posted 26 January 2012 - 04:22 PM
This is why we have an ASP.Net forum. For ASP.Net questions, please post in this forum. There is a huge difference between ASP.Net and WinForms. One is that ASP.Net doesn't have a DataGridView. It has a DataGrid(back from .Net 1.1) and a GridView(you should use this one).
#6
Re: VS c# Manipulate DataGrid Column Widths
Posted 30 January 2012 - 07:09 AM
Apologies,
Will post in the ASP.net side
Will post in the ASP.net side
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|