Jump to content


Photo

two dbgrids with the same datasource


  • Please log in to reply
6 replies to this topic

#1 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 16 October 2015 - 04:40 PM

Hi,

 

just playing around with the new v6:

 

- two dbgrids v5 with the same datasource: you can scroll around in first or second grid, no problems

- one dbgrid v5 the other dbgrid v6, both with the same datasource: you can scroll only in dbgrid v6, trying to scroll in v5 immediately throws an exception

- two dbgrid v6 with the same datasource: trying to scroll, no matter in which grid, immediately throws an exception

 

 

by the way (i am using SQL-Server 2014):

if i connect to a table and do not define the columns, the displayed values are different formated:

- in v6 integers has always two digits behind comma, why?

- in v5 float has not digits behind comma when 0, in v6 it has always Digits behind comma (this is better i find)

​- in v5 tinyint with value 0 is shown as 0 leftaligned, in v6 it is shown as 0 but rightaligned (is better)

- in v5 and v6 tinyint with value NULL is shown as empty, smallint and int with value NULL are shown as empty in v5 but as 0.00 in v6

 

i think

- numeric values should always be right aligned by default

- integer values (from tinyint till up to bigint) should always be shown as xxx, not as xxx.yy

- values which are NULL should always be empty (because this is not the same like 0!)

 

... but as long as this can be overwritten it's no major problem :-)

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 17 October 2015 - 03:17 AM

Hi,

 

Can you maybe give me TFieldType for your fields. Most probably I should better configure CreateCols method (where I pick col type for each TFieldType of Field):

     case DataField.DataType of
        ftBoolean: ColClass := TNxDBCheckBoxColumn6;
        ftDate, ftDateTime, ftTime, ftTimeStamp: ColClass := TNxDBDateColumn6;
        ftString, ftWideString: ColClass := TNxDBTextColumn6;
        ftAutoInc, ftFloat, ftCurrency, ftInteger, ftSmallint, ftWord: ColClass := TNxDBNumberColumn6;
        else ColClass := TNxDBTextColumn6;
      end;

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.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 17 October 2015 - 03:28 AM

PS. in v6 NULL should be shown as null. There is a NullText property of DataBinding property of column. 

 

I will check if I miss something, but TFieldType listings will helps for sure :)


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.

#4 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 21 October 2015 - 12:39 PM

Hi Boki,

 

sorry for the delay, i had a little accident (now i am okay again).

Here the list, but all is defined in DB.pas ...

 

  TFieldType = (ftUnknown, ftString, ftSmallint, ftInteger, ftWord, // 0..4
    ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime, // 5..11
    ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo, // 12..18
    ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString, // 19..24
    ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob, // 25..31
    ftVariant, ftInterface, ftIDispatch, ftGuid, ftTimeStamp, ftFMTBcd, // 32..37
    ftFixedWideChar, ftWideMemo, ftOraTimeStamp, ftOraInterval, // 38..41
    ftLongWord, ftShortint, ftByte, ftExtended, ftConnection, ftParams, ftStream, //42..48
    ftTimeStampOffset, ftObject, ftSingle); //49..51​

 

I think you should check for types like ftByte, ftWord, ftSmallint, ftInteger, ftAutoinc, ftLargeInt,

ftLongWord and ftShortInt and for this fields set decimal places = 0 and right aligned.

 

Why NULL is not working is another part, TField has an isnull-property, do you use it?

 

best regards 



#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 21 October 2015 - 05:30 PM

Hi,

 

Maybe you can check procedure TNxDataBinding.AssignFieldProperties; inside NxDBColumns6.pas

 

I have slightly improved it. Maybe you have more ideas what to add. 

 

PS. I am working on NULL support. It will be ready in day or two.

 

procedure TNxDataBinding.AssignFieldProperties;
begin
  if (dboUseFieldProperties in Options)
    and Assigned(FField) then
  begin
    FOwner.Alignment := FField.Alignment;
    FOwner.Editing := not FField.ReadOnly;
    FOwner.Header.Caption := FField.DisplayName; // FField.DisplayLabel?
    FOwner.Visible := FField.Visible;
 
    if FOwner is TNxDateColumn6 then
    begin
      if FField is TDateField then
      begin
//        TNxDateColumn6(FOwner).FormatMask
      end;
    end;
 
    if FOwner is TNxFloatColumn6 then
    begin
      if FField is TNumericField then
      begin
        TNxFloatColumn6(FOwner).FormatMask := TNumericField(FField).DisplayFormat;
      end;
      if FField is TFloatField then
      begin
        TNxFloatColumn6(FOwner).Max := TFloatField(FField).MaxValue;
        TNxFloatColumn6(FOwner).Min := TFloatField(FField).MinValue;
        TNxFloatColumn6(FOwner).Precision := TFloatField(FField).Precision;
      end;
    end;
  end;
end;

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.

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 21 October 2015 - 05:31 PM

As you can see, dboUseFieldProperties flag need to be set for Field and properties from TField are copied.


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.

#7 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 22 October 2015 - 07:57 PM

Okay, fine :)

I will see how i can help (very less time, my project is a little bit behind schedule). 






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users