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




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?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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

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.

Restrict Number Of Characters In A Datagrid Column
Dear Friends,

Can we restrict the dataentry in a datagrid column for a particular no. of characters? I had a access table with fields stname text 30 and marks number (long integer). I have defined rsa as adodb.recordset in vb and then set datagrid1.datasource = rsa.
I want to restrict the user to enter only 30 characters in the stname field and only 3 digits in marks field. How it can be done?

Regards
Mukund

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

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

Binding A DateTimePicker And/or ListBox To DataGrid To Control/restrict Input Data.
I have a DataGrid control with certain editable columns (some Numeric, some Date/Time fields) for which I would like to control/restrict input data. I want to acheive this by displaying a ListBox control or DateTimePicker control (as appropriate for that column) when a user clicks on the button in the cell.

I can display such controls external to the grid on the Button_Click event of the grid but I would rather have these pickers intrinsic to the grid...sure we've seen these all over the place?

Thanks in advance

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.

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

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...

Restrict Form Resizing
How can I restrict the user from resizing a form by dragging the corners to resize it?

How To Restrict The Resizing Of Listview
hi all.

how can i restrict the user for resizing the columns of the listview control

saj

Restrict Resizing And Maximizing
This is gotta be an easy one...

I want to restrict resizing and maximizing to a condition.

VB Code:
If SERACHING = False Then    ' Do not allow form to be maximized    ' Do not allow resizing of formElse    ' Allow form to be maximized    ' Allow resizing of formEnd If

Although I don't know how, because as far as I know BorderStyle and MaxButton can only be set at design time.

I know you can:

VB Code:
Private Sub Form_Resize()    If SERACHING = False Then        Me.Width = xxxx        Me.Height = xxxx    End IfEnd Sub

But I don't care for that method.

Can anyone help me out?

Restrict Form Resizing
Does anyone know how to not let the user make the form smaller than a certain size?

I don't really want to use:

VB Code:
If Me.Width <= 5115 Then        Me.Width = 5115    End If

since it flickers when the size is smaller than the one specified.

Any solutions and/or other ways of doing this?

Restrict Resizing Of A Form...
I have a form, which is resizable. The controls on the form also resize to fit the window. I have used a very basic way of controlling the resize, by using :

Code: If Me.Height < 450 Then
Me.Height = 450
End If

And simlarly for width.... However this causes flickering and as this form is an mdiChild form, when I resize the owner it generates errors when the form gets too small!

Anyone got a solution!?

Thanks!

Twisted|Soul

Transcending even the highest forms of digital spirituality.

Restrict A User From Resizing A Form
How do I stop a user from resizing a form? I have my form set on 2-form sizable, so that i get the min and max buttons, i disabled the max button but dont know how to stop a user from resizing the form. anyone know how? thanks,
- gabe

Datagrid Column Control
I want to remove the column in my datagrid that shows the ID. How do you control which columns are visible?

Formatting The Column For A Datagrid Control
ok..did a search..tried different way..still can't figure it out.
I have a column in my datagrid control for telephone numbers...the underlying database has the telephone numbers without any formatting (example: 8172442556)...I would like to display it as "(817) 244-2556"
..i tried setting the Format in DataGrid properties for the given column as Custom ..and setting the format string as (###) ###-####
doesn't seem to work...help please...
thanks in advance !!

Changing The Header Of A Datagrid Control Column
plz telll me how to change the column header of a data control

Query And Column's Title Of Datagrid Control
Hi,
I have two questions:
1) Is there a way that allow me to make the column's title of Datagrid control like "3 mV/m" and "0.5 mV/m"?
2) In my table, all cell values are double (like "0.0", "180.0", "44.4", "78.0", etc...), however, after I use query to retrive these records) and put them into cells of datagrid control, the data changed to "0", "180", "44.4" (which is fine), and "78".., how could I make these data unchanged?
Thanks.
Firstry

Restrict Auto Data Updation In Datagrid?
can any one suggest me how to restrict data from being updated in the underlying table when the data on the datagrid is modified.

the updation should be restricted unless i explicitly tell to do so.

harish.

How To Move The Cursor From One Column To Next Column In Datagrid
Hi
Everyone,    
    In Datagrid control, how the cursor move from one column to another column of the same row after updating the datagrid.
    plz anyone help me.
    
    thanking you in advance.

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

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.

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

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 &lt;table&gt; MODIFY &lt;column&gt; ..

Thanks for replying

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

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

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

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.

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

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

How To Restrict Mouse For A Control.
hi all,

I'm having a picture box in my app.

I want to restrict the mouse over the picture box.

How can I achieve this?.

Bala

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

Using A Tab Control, How To Restrict A Certain Tab With Pass/login
im making a database project in access that is going to display customer feedback in different ways, for review, to edit and enter etc.

using a tab control for access to each one, i would appreciate to know if i could make, for example the first or and second tab accessable to all and have some kind of admin verification via a pop up password dialog box appear when tabs three and four are clicked.
Thanks in advance if anyone has any information

and out of curiosity, on recommendation or personal comments : VB6 or .NET?

Resizing DataGrid
I need to change the size of the DataGrid when the Form is Maximized and Minimized. What is the best way to do this? I've tried several different things with no luck.

TIA,

James

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

Disable Desktop, Restrict Control Panel, Etc
Does anyone know how to Restrict Control Panel and make the desktop icons disappear? Like that cheap software they use in some school up here in Canada. Assuming of course that we're on Win9x. Thanks.

-Nishant

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