If you add a TNxVirtualcolumn to a NextDbGrid then you will get access violations whenever you forget to check if the column you want to use is an actual TNxDbColumn as the TNxVirtualColumn don't have the same ancestral-class ...
The column-designer for the grid also allows you to add this TNxVirtualColumn even though it is incompatible with this grid.
[v5111] TNxVirtualColumn incompatible with NextDbGrid
Started by rond, Feb 25 2011 11:01 AM
2 replies to this topic
#1
Posted 25 February 2011 - 11:01 AM
#2
Posted 26 February 2011 - 10:09 PM
Hello Rond,
Please sorry for delay.
I have test it now and all seems to be fine. Do I need to do something more? Thank you.
Best regards
Please sorry for delay.
I have test it now and all seems to be fine. Do I need to do something more? Thank you.
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#3
Posted 28 February 2011 - 10:47 AM
All I did was call BestFitColumn(i, bfBoth) for all the columns, except the ones that had 'autosize' set.
As there were a few virtualcolumns I got an exception for both of them, until I excluded them with code like this :
for i := 0 to aGrid.Columns.Count - 1 do
begin
try
if not (TNxCustomColumn(aGrid.Columns[i]) is TNxVirtualColumn) then
begin
if not (coAutoSize in aGrid.Columns[i].Options) and (not (TNxCustomColumn(aGrid.Columns[i]) is TNxVirtualColumn)) then
aGrid.BestFitColumn(i, bfBoth);
end;
except
on e : exception do
begin
end;
end;
end;
As there were a few virtualcolumns I got an exception for both of them, until I excluded them with code like this :
CODE
for i := 0 to aGrid.Columns.Count - 1 do
begin
try
if not (TNxCustomColumn(aGrid.Columns[i]) is TNxVirtualColumn) then
begin
if not (coAutoSize in aGrid.Columns[i].Options) and (not (TNxCustomColumn(aGrid.Columns[i]) is TNxVirtualColumn)) then
aGrid.BestFitColumn(i, bfBoth);
end;
except
on e : exception do
begin
end;
end;
end;
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











