473,473 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

datagrid column sizes

Hi

Is there anyway of capturing when the users adjusts the width of a datagrid
column so the new column width can be stored.

Thanks in advance

Nov 21 '05 #1
2 1178
Hi,

Try something like this is the datagrid mouse move
event.
Private Sub DataGrid1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseMove

Dim hti As DataGrid.HitTestInfo

hti = DataGrid1.HitTest(e.X, e.Y)

If hti.Type = DataGrid.HitTestType.ColumnResize Then

Debug.WriteLine(String.Format("Resized Column {0}", hti.Column))

End If

End Sub

Ken

-------------------
"Starbuck" <ke*@kevsbox.com> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
Hi

Is there anyway of capturing when the users adjusts the width of a datagrid
column so the new column width can be stored.

Thanks in advance


Nov 21 '05 #2
Thanks Ken

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:O4**************@TK2MSFTNGP14.phx.gbl...
Hi,

Try something like this is the datagrid mouse move
event.
Private Sub DataGrid1_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseMove

Dim hti As DataGrid.HitTestInfo

hti = DataGrid1.HitTest(e.X, e.Y)

If hti.Type = DataGrid.HitTestType.ColumnResize Then

Debug.WriteLine(String.Format("Resized Column {0}", hti.Column))

End If

End Sub

Ken

-------------------
"Starbuck" <ke*@kevsbox.com> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
Hi

Is there anyway of capturing when the users adjusts the width of a
datagrid
column so the new column width can be stored.

Thanks in advance

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul Sampson | last post by:
Hello, I've added a TableStyle and two GridColumnStyles to my datagrid in design mode, to allow setting the size of the columns. This works fine (even though it's WAY too complicated for...
2
by: news | last post by:
Hello All, As a VB6/C/C++ (and some Java) developer, I've been toying with c# for the last couple of weeks. I'm currently trying to create a grid of 3x3 with each cell containing numbers from 1...
0
by: GroZZleR | last post by:
Hey all, How can you expand the column sizes to ALWAYS take up atleast 100% of the DataGrid / DataTable? Right now my columns look like this: http://www.grozzler.com/dump/dt_mine.png I...
5
by: Jeremy | last post by:
I have googled for this issue, and many other people have the same problem with no resolution. The data grid column sizes automatically resize based on their contents no matter what the...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
0
by: Paul | last post by:
Hi I have a datagrid with two different hyperlink columns. The columns open up a new window as the target is set to _blank for both. The windows are different sizes (one large, one small) and I...
3
by: Helen Trim | last post by:
How can I set the sizes of columns in a datagrid? Thanks in advance Helen
2
by: cj | last post by:
I was looking over some of my 2003 code today (see below) that loads a foxpro table via oledb connection. I used a sub "autosizecolumns" I found on the web but I never quite understood why they...
1
by: =?Utf-8?B?VEQgaXMgUFNQ?= | last post by:
Asuming that you have a DataGrid DG - then DG.columns.ItemStyle.Width = 100; DG.columns.Visible = true; should do the trick. You can also use the column name instead of the column number as...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.