Datagridview AutoSizeColumnsMode in custom control.

Datagridview AutoSizeColumnsMode in custom control.

Post by Glen » Wed, 19 Oct 2005 04:32:24


I am creating a custom control that inherits from the new datagridview
control. My "re-packaged" datagridview will be used all over our
application.

One thing I want my control to do for the programmer is to
automatically detect whether the total width of all the columns is
wider than the datagridview control on the form.

If the columns are WIDER than the control, then the mode should be set
to "AllCells".

If the columns are NOT WIDER than the control, then the mode should be
set to "Fill".

I have tried testing these parms during the DatabindingFinished event,
but the AutoResizeColumns won't allow the "Fill" mode and just setting
the AutoSizeColumnsMode doesn't have any effect.

Anyone know how to do this?

Any help would be greatly appreciated.

Sincerely,
Glen
 
 
 

1. DataGridView as Custom Control with a default column: Code executes twice...

2. How can you add a custom user control to a datagridview?

Thinking two things,
1- Creating a userControl -yeah you guessed it, a multi column drop down
combobox - I've looked at several articles and did not find what I need, one
that's bindable and that I can use in a datagrid view.
2- Extending the datagridview so that it can be added to the list in the
column types when editing columns in the datagridview.
I'm really getting PO'd at Microsoft for not including a multi column
combobox both a the standard combox and as a datagridviewcombobox. Its
something so essential and they've been doing that in Access for years. We
had the capability in VB6, what the hell are we paying these overinflated
prices for development tools for?
Maybe I'm trying to reinvent the wheel?

Anyways, any ideas would be appreciated.

Bob

3. Adding "Add-Ins..." control to custom tooolbar

4. WIN XP SP2 active X controls, plug ins, add ins, downloading software

5. XP SP2 active x control,add-ins,plug-ins nightmare

6. WIN XP SP2 active X controls, plug ins, add ins, downloading s

7. Clearing selection in DataGridView when user clicks outside the DataGridView control

8. Capturing event from other custom control within another custom control

9. Custom control within a custom control

10. zooming a custom control - layout custom controls in grid

11. Custom Control : One custom property to array of controls

12. databound custom controls vs composite databound custom controls

13. Custom Control inheriting from a Custom Control

14. Blend and custom controls derived from custom base control class.

15. Capturing event from other custom control within another custom control