Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 column adjustment with grid within the screen

Author  Topic 

yasin
Yak Posting Veteran

68 Posts

Posted - 2005-08-30 : 16:25:25
Hi guys... there

For fixed column in a grid, i used the following calculation.

for i = 0 to grid1.col -1
tot = tot + grid1.colwidth(i) ' finding total columnwidth of the grid.
next i

tot = tot - grid1.colwidth (0)

'Then i am subtracting namecolumn width [SAY namecolumn
= Grid1.COLWIDTH(0)] from the total column width.

grid1.colwidth(0) = grid1.width - tot

'This is the namecolumn[grid1.colwidth(0)] so i have to adjust the extra space only in this column.

Gridwidth - totalcolwidth[EXCLUDING COLWIDTH(0)]. This is column adjustment for this grid.


but i have a problem in the reverse case [ Grid wih Not fixed column ]

In my VB application , i have grid. Grid column is not fixed it depends upon the user account selection. If user select two account then 4 column is displayed in that grid( Two column is common for all account). if the user select 5 account then 7 column is displayed. Here what i want is within the screenwidth i have to adjust the column automatically. How i can do... If the the total column width is greater than the screen width no problem... If it is less than the screen width it should adjust in the name column.

thanx in advance
by
yasi
   

- Advertisement -