Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Grid Column Resizing


Hey all,

Any ideas on resizing the grid columns when the form is resized!
The math for it!!

It's for a true dbgrid!

Cheers
Beacon




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Resizing A MS Flex Grid Column To Fit The Longest Value
hi,
I want to allow the user to dbl click on the column resize mark in order to resize it automatically to the longest value (makes all the values visible).
Same behaviour as in Windows Explorer and most of MS apps.
Is there a more elegant way of doing it other than going over each cell in the column and checking it's Width?
How do I catch the dbl click specifically on the resize mark?

thanx

Resizing Data Grid To Match The Length Of The Column And The Rows
How do I resize a data grid to match the length of the column and the height of the datagrid to match the rows that are dynamically displayed. Any help would be appreciated

Not Allow Column Resizing
Hello,

I want to prevent users to change the size of a specific column. Does any one knows how can I do it?


Best regards,

Ricardo Amaro

ricardo.amaro@clix.pt

 

MSHFlexgrid Column Resizing
Is it possible to prevent the user from resizing a particular column mshflexgrid? ie I want the user to be able to resize rest of the columns, but I have a column which i have hidden(.ColWidth = 0) and I don't want the user to be able to drag and expand it at runtime. I know he/she has to delicately position the mouse and drag to be able to see it, but can I just not allow him/her to be able to resize?

Thanks in advance.

Flexgrid Column Resizing
Ive read the flexgrid functions in the knowledge base, but is there a simpiler way to do it such as .ColWidth or .CellWidth? I just want it to set each column to resize itself depending on the text at all times how is this possible?


Thanks
Jaden

Resizing Column In Datagrid
how do you resize a column of a datagrid to match the length of the text in it? and is it possible to change the style of the header to bold? thanks

Column Resizing In An MSFlexgrid
Hi All,

I need to resize the columns in my MSFlexgrid.

Note however, that I cannot use the controls AllowUserResizing property because I have merged headings in the first row which look like columnheaders so I can't click on the the first row to resize. I need it to work almost like excel where I can place the mouse pointer on the line that seperates columns and then change the width of the column.

Please help me.

ListView Column Resizing
Hi Everyone,

Is there anyway to disable column resizing inside of a ListView control? I would appreciate any help. Thank you.

MSHFlexGrid Column Resizing
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.) MouseDown, MouseUp, MouseMove,
MouseIcon etc. all seem to be 'blind' when my mouse cursor changes to the
horizontal double headed arrow for column resizing. No events seem to be
triggered when the mouse pointer is in this state?

Thanks,

Gord

Excel Column Resizing
Hello All Memebers
How can i adjust a certain Column or a row (Resize it) by a visual basic!!!
Is there is a code for making that?!
Thanks alot for help and advice



Egyptian Man

Table Column Resizing
Hi listers,
Does anyone know how to resize a field in a table in DAO/Jet (VB, Access).

I have a text field in a table and want to increase its length (the database exists).

I didn't find the equivalent for SQL command ALTER <table> MODIFY <column> ..

Thanks for replying

Resizing My Sudoku Grid
Hello. Everything's working nicely with the logic, but now I need to focus on users being able to resize the form (and thus the grid) for my Sudoku program. It's a nine by nine grid with a number in each box, and currently I'm using text boxes, although it wouldn't be a problem to use another control to show the numbers and accept the input, the main thing is just getting the numbers once inputted to resize along with their boxes.

How would you go about resizing these boxes with numbers?

Msflex Grid , Col Resizing.
Hi

I have a flex grid on a form showing the contents of the table I am linked to. But the cols are to smal to show all the data. How do you make the col automatically adjust to show all the data and the table field names in full in the msflex grid ?

Rgds, Locutus

Resizing Data Grid
Hi All

A while ago Shandy gave me this peice of code to resize a datagrid (MSDATGRD.OCX) on a form,
so it will occupy the entire area of a form, when the form is resized.

This works well, but I was wondering if there was some extra code to reszise the columns, because at the moment
the columns stay put, but the grey area around them fills the form.
Is there a way to move the cells/columns along with the rest of the grid when being resized ?

Thanks everyone

Oly

Listview Auto Column Resizing
I have a Listview control in Report view which I have populated with data.

Is there a way to auto-resize the columns in the Listview by code just like doubleclicking the line between the column headers does?

Prevent Column Resizing In A Listview?
Hello,

Is it possible to prevent column resizing in a listview? I still want to able to scroll down through the listview, but I cannot work out if it is possible to prevent the columns for being resized by the user - there does not seems to be a relevant property (I would have thought there would have been a AllowColumnResizing property).

Thanks in advance.

Capturing The Resizing Of A Listview Column
how do i capture the event when the columns in a listview are resized?
will i have to subclass? If so, can someone give me a starting point on how to do this, since i have never subclassed before.

thanks

DBGrid: Resizing && Column Control
I am using a DBGrid set up in the VB5 Form Wizrd. What I am going for is to have the columns within the grid resize themselves to the width of the largest entry loaded from the database. I then want them to resize themselves based on the size of the window if the user increases/decreases the dimensions.

Also, in Design mode there are only two columns present, however in Run Time there are 5. How can I edit those other 3 columns in Design mode and get them to show up? VB wont let me edit anything other than the first two.

Any help would be great. Thank you.

Restricting Column Resizing In A ListView
I have headers on my ListView, and don't want the user to be able to resize them. I've gone through every property I know of that seems like it could have anything to do with this and I can't find a way to lock the size of the columns.. anyone know of a way? If not, I can always hide the columns and build my own headers, I just don't want to unless I have to.

Disable Resizing Of The Column For Listview?
how would i disable it so the user wont be able to resize the columns of the listview?

Column Width Resizing MSHFg
Here's my code


VB Code:
Do While Not rs.EOF     MSHFlexGrid1.AddItem ""     For lngCol = 0 To MSHFlexGrid1.Cols - 1        MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Rows - 1, lngCol) = rs.Fields(lngCol).Value        'If lngCol = 3 Then               MSHFlexGrid1.Row = MSHFlexGrid1.Rows - 1               MSHFlexGrid1.Col = lngCol               Select Case rs.Fields(lngCol).Value                     Case 8 To 10                          MSHFlexGrid1.CellBackColor = vbGreen                     Case 4 To 7.9999999                          MSHFlexGrid1.CellBackColor = vbYellow                     Case 0 To 3.9999999                          MSHFlexGrid1.CellBackColor = vbRed                 End Select         'End If    Next     rs.MoveNextLoop  MSHFlexGrid1.FixedRows = 1     MSHFlexGrid1.TextMatrix(0, 0) = "Employee Name"    MSHFlexGrid1.TextMatrix(0, 1) = "Department"    MSHFlexGrid1.TextMatrix(0, 2) = "Overall Score"    MSHFlexGrid1.TextMatrix(0, 3) = "Rev Score"    MSHFlexGrid1.TextMatrix(0, 4) = "GMD Score"    MSHFlexGrid1.TextMatrix(0, 5) = "GMP Score"         With MSHFlexGrid1    For lngCol = .FixedCols To .Cols - 1       For lngRow = .FixedRows To .Rows - 1            lngWidth = Me.TextWidth(.TextMatrix(lngRow, lngCol)) + 90            If lngWidth > lngMaxWidth Then                lngMaxWidth = lngWidth           End If        Next        .ColWidth(lngCol) = lngMaxWidth       lngMaxWidth = 0    Next End With


And it is working fine on customer name and department, but the rest of the cols/data is 2 digit numbers, and it is resizing the cols based on that, rather than the fixedcols, which it seems to be skipping.

I've got the Fixedcols listed, but it should be resizing the last 3 cols to "Rev Score" length, but is instead using the nonFixed cols maxlength for the resizing.

Does anyone see where I went wrong?

Thanks-

Guph

Column Resizing In The Listview Control
hey everyone


does anyone know a way to prevent the user from
changing the width if a ListView control when
View = 3-lvwReport.

thanks

Mike

Flexgrid And Column Resizing Resolved
hey,
2 questions here.
I basically want to be able to set the size of the columns in a flexgrid so the edges of my text isnt cut off.Now Ive found the code below on the forum that might be what I want but dont understand it fully.How is this function referenced.Is it called under a command button like Code:ChangeColWidth. And can anyone tell me what the value of ColNo would be.

Spankil Wrote

Code:Private Function ChangeColWidth(ColNo As Integer) As Double
Dim i, Max
Max = 0
    With fg1
         For i = .FixedRows To .Rows - 1
              If TextWidth(.TextMatrix(i, ColNo)) > Max Then
                   Max = TextWidth(.TextMatrix(i, ColNo))
              End If
         Next i

         ChangeColWidth = Max
    End With
End Sub

If anyone knows a better way than this please tell me.

Also another question about Flexgrids.Can text (for example headers) be entered into the fixed row(the grey row) at the top.
Thanks.




Edited by - star84 on 6/25/2004 12:18:41 AM

Detecting Row/column Resizing In MSFlexGrid.OCX??
Hi,


I'm currently faced with a problem in VB5 of trying to detect when any row or column in a MSFlexGrid ActiveX control is resized by the user.


Is this achievable and if so, how can it be done?

:confused: Resizing A Flexgrid Column
Hi,

I am having a strange problem.I have a flexgrid in my program.I want the user to resize it.I tried using flexgrid1.AllowUserResizing = flexResizeBoth . But it allows the user to resize only in the row not in the column.I am using VB 6.0 , Office 2000 and Windows 2000.
Also can anyone tell me how to use the flexgriud so that my whole text is visble in a particular column that is it doesnt hide.I tried using flexgrid1.wraptext = false.But that doesnt help.
Can anybody help me out with my problem and suggest me what could be wrong !!!!!!

Regards,
Hema

Resizing Data Bound Grid
How do I set the control to automatically resize the cells to fit all the text in??

ListView Column Header Resizing Cursor
Hello Everyone,

Is there anyway to know when the mouse cursor is located over a divider inside of the ListView column header? I have currently set a few columns so that they cannot be resized and would like the mouse cursor to stay the same as the default cursor for the columns that have been locked. I would appreciate any help. Thank you.

Restrict Column Resizing In DataGrid Control
Hi

I want fixed width of columns, so the user can't not change the widh from Header row.

How this can be done, any idea?

MSFlexgrid Control's Column Width Resizing?
Hi ,
Can I resize the MSFlexGrid control’s column width ?.When I run my program that use the MSFlexGrid,everytime the grid cols is the same size and some of my text in the grid isn’t visible.Is there any way to stop it?.Thanks...

Stop Column Resizing In List View
I want ot hide some columns of the list view.

And I want to Stop resing ONLY for first column of the list view

How can i do this..


Thankx in advance

MSFlexGrid Scrollbars Are Not Visible After Resizing The Grid.
I have a form that is a child form in an MDI setup.

This child form has four tabs and on each tab is an MSFlexgrid.

All data in the flex grids are inserted manually.

When data is entered on one of the four flex grids (call it flexgridalpha, it can create many new rows in one of the other flexgrids (call it flexgridbeta)...

So, flexgridbeta starts with a grid with 24 rows. Then the user tabs to flexgridalpha and makes some changes that generate 50 new entries that are entered into the table that feeds flexgridbeta. The user then selects the flexgridbeta tab to see his 74 rows.

The data appears just fine, but the vscrollbar is not visible. Clicking where the scrollbar SHOULD be causes that part of the scrollbar to become visible. (ie if you click where the arrows should be, they will suddenly reappear, or if you click between the two arrow, the thumb and scroll bar appears but the arrows don't appear, yet).

Any suggestions?

Thanks,
MagicT

Resizing A Column (based On The Longest Value) In MSHflexGrid Automatically?
Okay, I've been looking for a function or procedure that will automatically resize a column-width to the largest value within that column during runtime (like Excel, when you double click on the column line) using MSHFlexGrid....Is it possible to tap into a dll or write some code within VB 6 to do this? Any help would be greatly appreciated...


Morph

Listview: Restrict User From Resizing Column Width
I am using listview on my form.
I don't want to allow user to resize the column width of listview.

How can I do this? Please help and guide.

Resizing Column Widths In Datagrid Keeping All Visible
Hi,

How do I allow the user to resize column widths in a datagrid but not exceed the visible width of the datagrid? I also need the columns not move the current selected column to the left (causing all the other columns, to the left of that one, to disappear out of the visible window).

Thanx in advance,

Nilesh2



Edited by - Nilesh2 on 8/2/2003 8:05:10 AM

How To Restrict The User Resizing The Column Of A List View Control
but my problem is, i have a hidden column in a list view control.(say as the 4th column).
now , at runtime if the user tries to increase the size of 3rd column, then my hidden column becomes visible.
to avoid that i want to restrict the user from resizing any of the columns of list view control.

thanks for any help, in advance

i found a third party control as a solution to this problem.

but i would like to know if there is any simpler solution.

How To Restrict A User Resizing A Column In The List View Control?
i found a third party control as a solution to this problem.

but i would like to know if there is any simpler solution.


Thanks in advance.



Edited by - knowledgeUpdate on 1/29/2003 9:34:01 PM

Two Column Grid?!?
how do i create a two column grid for my problem posted in the thread-'arrays....again...!?!'
plz could sum 1 help?
i would really appreciate ne help ne1 could gve me
a.s.a.p plz
thanx

How To Add Checkboxes In One Column Of Grid
Now,I want to create one Gird which has five columns.
The first column is checkbox.
The next four is DB datafields.
and the grid must be MS controls like grid.

How I can add the checkbox in the grid?
how i can read the checked value in checkbox?

Locking One Column Of A Grid
Hi!
Can i lock first and second column of my grid from updation.
I have five columns in my tdbgrid in which the first two i want to populate with some default value and i want the user not be able to modify the values in first two columns. any idea to achieve this?

Manditory Column In A Grid
I need to make a column in a grid manditory if something in the row has been changed. How could I do this?

for example:
We need to have (Date Due) manditory if someone enters anything else in the grid. Just in case someone forgets to type anything in.

Grid Column Problem
How can i adjust the column length of my grid?

Checkbox Column In Grid
I have a Boolean field in a recordset. Is there any chance to have a checkbox for this field in a grid control? I think I saw this once, but I can't do it again. I am using ADO recordset with DataGrid.

Sorting By A Grid Column
hi

I have a grid column that displays string values like 1,1+1/2,2,2+1/2 etc. The problem is in grid when I sort by this column they donot show up in the order specified above, because they are treated as strings and maybe sorted by their ASCII values. I want them to be sorted by treating them as integers so that they appear in hte sequence shown above. Any ideas that how this can be done. By the way I am using VSFlex grid.


Regards

Ali.

Grid Column Color
How can the color of a particular column be changed in datagrid keeping rest columns unchanged.


Bhavesh Shah

MSFlex Grid : Set A Column To Invisible.
Hi,

I have a MSFlexGrid on a Form.

I would like to make one of the columns in the grid Invisible .

How to do this.

Looked in the archive and MSDN but could not figure it out.

Thanks for any help.

Regards
Jagan Malkareddy

Editing A Mask Grid Column
Hello,

I am using MshflexGrid. When I am loading the Grid, I am filling
that particular column with MASK '#########'.

But when I am trying to edit that column after filling with
mask '#######'. It is now un-editable.


do anyone have any idea, why it is behaving so.



Thank you

Tooltexttips On A Specific Grid Column? Can This Be Done?
I'm currently using the AddCustomToolTip function (found on this forum) for toolTextTips on form objects. This works great for textboxes, buttons etc.. however i have a grid and i'd like to have mouseover popup info on each column. is this possible?

How To Set Column Widths For MS Flex Grid
I am using an MS Flex GRid to display data from a table. However I can not find any way to size the column widths so that no data is cut off.
Any ideas?

Kid

Data Grid Column Format
HI.....

I have a data grid to display all the data in the Access database where the user can edit these data. One of the fields in the Access database is in the Yes/No format, meaning it contains a checkbox.

My problem is...when the data from the database are displayed in the data grid the column that is suppose to have the checkbox is displayed as "0" for the unticked checkbox and "1" for the "ticked" checkbox....

What i need is for the column to display the checkbox so that the user can tick on the data they desired.....

1. can i somehow...set the format for that particular column of the data grid so that it can display the checkbox?

2.can i locked only those columns that cannot be edited by the user?

please help

Copyright © 2005-08 www.BigResource.com, All rights reserved