Jump to content


Photo

dbgrid Columns proposed increase DisplayFormat property


  • Please log in to reply
6 replies to this topic

#1 chenbo

chenbo

    Active Member

  • Members
  • PipPipPip
  • 62 posts

Posted 10 December 2015 - 05:43 AM

dbgrid Columns proposed increase DisplayFormat property


  • -1

#2 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10426 posts

Posted 10 December 2015 - 08:04 AM

DisplayFormat can be adjusted from attached TField.


  • 0

#3 chenbo

chenbo

    Active Member

  • Members
  • PipPipPip
  • 62 posts

Posted 11 December 2015 - 05:33 PM

DisplayFormat can be adjusted from attached TField.

 

If not using ClientDataSet1, but the use of adoquery? 
 
adoquery Without this property

  • 0

#4 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10426 posts

Posted 11 December 2015 - 05:46 PM

In AdoQuery you can have fields too. It is same as any TDataSet.


  • 0

#5 shawdown

shawdown

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 81 posts

Posted 10 July 2018 - 06:46 PM

In VCL I used '000000' in the DisplayFormat to display integer codes in dbgrid always adding 0 to the left.
 
Ex:
When code was 20 then 000020 was displayed.
 
In uniDBGrid it does not behave the same way.
How can I make this integer formation in dbgrid?

  • 0

#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 11 July 2018 - 05:56 AM

Hi,

 

 

In VCL I used '000000' in the DisplayFormat to display integer codes in dbgrid always adding 0 to the left.
 
Ex:
When code was 20 then 000020 was displayed.
 
In uniDBGrid it does not behave the same way.
How can I make this integer formation in dbgrid?

 

 

You can open a ticket in support portal

 

As a workaround you can try to use something like this I think:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    // 0 - your integer field index
    columns[0].renderer = function(v) {
      return (v.toString().padStart(6, '0'))
    }
}

  • 0

#7 gerardocrisci

gerardocrisci

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 73 posts
  • LocationItaly

Posted 11 July 2018 - 08:15 PM

I think the problem can be solved

http://forums.unigui...isplay-in-grid/

 


  • 0

Italy.gif Italy is wonderful





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users