473,766 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ 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 1192
Hi,

Try something like this is the datagrid mouse move
event.
Private Sub DataGrid1_Mouse Move(ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles DataGrid1.Mouse Move

Dim hti As DataGrid.HitTes tInfo

hti = DataGrid1.HitTe st(e.X, e.Y)

If hti.Type = DataGrid.HitTes tType.ColumnRes ize Then

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

End If

End Sub

Ken

-------------------
"Starbuck" <ke*@kevsbox.co m> wrote in message
news:O3******** ******@TK2MSFTN GP10.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***@bellsout h.net> wrote in message
news:O4******** ******@TK2MSFTN GP14.phx.gbl...
Hi,

Try something like this is the datagrid mouse move
event.
Private Sub DataGrid1_Mouse Move(ByVal sender As Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles DataGrid1.Mouse Move

Dim hti As DataGrid.HitTes tInfo

hti = DataGrid1.HitTe st(e.X, e.Y)

If hti.Type = DataGrid.HitTes tType.ColumnRes ize Then

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

End If

End Sub

Ken

-------------------
"Starbuck" <ke*@kevsbox.co m> wrote in message
news:O3******** ******@TK2MSFTN GP10.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
1862
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 something so simple). However, prior to this the second column was a checkbox, reflecting the underlying MSSQL bit data type. After explicitly adding the GridColumnStyle the textbox is replaced by "True/False". I can't work out how to keep the...
2
1605
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 to 9. The idea is that if you push one of the numbers, it gets 'blown up' to the full size of the control, hiding all the other ones. It should also be possible to enable/disable some cells in the grid through calling a method. I've actually...
0
1099
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 want it to look more like this (minus the colours and such): http://www.grozzler.com/dump/dt_theirs.png
5
329
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 Style.Width is set to. I was looking at the HTML output, and the values I entered for Width does not even get generated. And to make things worse, even though I set the width of the Grid to 100%, it actually expands beyond the edge of the screen forcing...
4
3496
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 snippet from my .css file: *************************** body { margin:0; padding:0;
0
1207
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 have java script to resize them accordingly. I noticed that the resizing does not seem to work properly when accessing the windows through the datagrid. If I open the small window first through the column hyperlink it seems to open the correct...
3
1045
by: Helen Trim | last post by:
How can I set the sizes of columns in a datagrid? Thanks in advance Helen
2
1777
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 said the style name had to be the same as the table name. Perhaps the are refering to ts1.mappingname must be the same as the table name (datagrid1.datamember) because I've read that that is how the datagrid associates a style with what it's...
1
1293
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 an index into the collection of columns. Is that what you need?
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3929
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 we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.