Resizing columns in an datagrid 
Author Message
 Resizing columns in an datagrid

Hello,

I am wondering if it is possible to resize the columns of a datagrid based
on the length of the values I want show in them.
One way would be to read an amount of records, get the length of the
contents and then set the width of each columns. But there must be a better
way.....I hope.

Tia

Ronnie



Mon, 14 Apr 2003 03:00:00 GMT  
 Resizing columns in an datagrid

Ronnie,
I don't think there is a better method, unless you use True DBGrid Pro by
APEX. They have made the datagrid for Microsoft, and sell the proffesional
version. The PRO version has an AutoSize method on the column object, which
sets the size of a column so that each cell is displayed.

Pieter


Quote:
> Hello,

> I am wondering if it is possible to resize the columns of a datagrid based
> on the length of the values I want show in them.
> One way would be to read an amount of records, get the length of the
> contents and then set the width of each columns. But there must be a
better
> way.....I hope.

> Tia

> Ronnie



Tue, 15 Apr 2003 00:47:17 GMT  
 Resizing columns in an datagrid
Hello

I needed to do the same thing for a datagrid I was using.

I was on to sizing the grid cells by calculating the number of pixles
that the text took up and then sizing the cell to that number of pixles
plus a few extra for space.

With help from the news groups I was able to do it.

But I found that it's not pixles you have to count, but twips.

I will see if I can cut and paste that part of the code and send it to
you.

Ken

Quote:

> Hello,

> I am wondering if it is possible to resize the columns of a datagrid based
> on the length of the values I want show in them.
> One way would be to read an amount of records, get the length of the
> contents and then set the width of each columns. But there must be a better
> way.....I hope.

> Tia

> Ronnie



Fri, 23 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Datagrid Column Resizing

2. Preventing DataGrid Row/Column Resizing At Runtime

3. Resizing columns in datagrid

4. Resizing columns in datagrid control automatically

5. URGENT : Width datagrid columns problem resize

6. How to auto resize columns in DataGrid?

7. resizing DataGrid after resizing Form

8. resizing DataGrid after resizing Form

9. How to align column header differently from column in windows datagrid

10. Datagrid column reject input when added expression for parent columns

11. could not edit the column of datagrid where this column is being binded to an alias

12. Dynamically Added Datagrid Template Column - Checkbox.Checked state in Column Header

 

 
Powered by phpBB® Forum Software