Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TLMDDBGrid / LMDGridFloatColumn issues

Bug? I have a TLMDDBGrid, with 3 columns.  I want to add a integer
column, there is no button for this.  The only way I can see to add it
is to add all columns, and it's added automatically.

My question
is how do I force a float value to display 3 decimals?  I set the
'FloatFormat' value to   #.000    this did not work

Also, I just
want to display the data in the grid, I don't want it to appear like any
row is selected.  The first field in the first row has a thicker black
border around it, how do I get rid of that?

Thanks!
Tagged:

Comments

  • 7 Comments sorted by Votes Date Added
  • Hi,

    There is a line of buttons with different column types at the top of the grid's column editor.
  • Hi,

    About FloatFormat: In Db version of the grid this property is linked with the corresponding TField.EditFormat property. For better understanding you can review the following code (which is a part of LMDGrid package):

    procedure TLMDGridFloatColumn.CheckInitPropsForField;
    var
      field: TField;
      ff:    TFloatField;
    begin
      Assert(Grid <> nil);

      field := Grid.GetColumnField(Self);
      if (field <> nil) and (field is TFloatField) then
      begin
        ff := TFloatField(field);
        Precision := ff.Precision;
        IsCurrencyMode := ff.Currency;
        FloatFormat := ff.EditFormat;
      end;
    end;
  • Also, I just 
    want to display the data in the grid, I don't want it to appear like any
    row is selected.  The first field in the first row has a thicker black 
    border around it, how do I get rid of that?

    Here I can't understand what you speak about...


  • edited April 2015 Posts: 7Vote Up0Vote Down
    Issue #1

    In the attached picture, the field that has the title "Lap Time" I want to have 3 digits for the decimal.  The 'difference' field is what is being displayed as "Lap Time".  I have the "DisplayFormat" as #.000

    As you can see, 50.71 is displayed in the grid, it should be 50.710

    Issue #2

    Each TLMDGrid has the selected row displayed with white text on a black background. This appears to be random as to which line will be selected when I create the frame.  I'd rather have it just be black text on white like the row isn't selected.  I think I saw those colors somewhere in the properties.  My issue is the dots around the selected field.  So in the picture I have the "11" circled in red. I don't want to dotted lines appearing around the cell.

    Where can I find the header file containing the attributes to the TLMDGridColumn?  I want to custom draw my cells, can't find where the TLMDGridColumn is defined.

    Thanks for the help!


    tms.jpg
    1771 x 966 - 406K
  • Hi,

    1) I said EditFormat, not DisplayFormat.
    2) You should exclude opDrawFocusSelected flag from Grid.Options.

    Where can I find the header file containing the attributes to the TLMDGridColumn?  I want to custom draw my cells, can't find where the TLMDGridColumn is defined.

    TLMDGridColumn declaration resides in LMDGrid.pas file. If you are registered user, you can just download sources. If you speak about C++ hpp file, then it should be somewhere in your installation; otherwise it will be impossible to compile projects...



  • >>> Where can I find the header file containing the attributes to the TLMDGridColumn?  I want to custom draw my cells, can't find where the TLMDGridColumn is defined.<<
    When you don't want to download the sources (as separate installer) - you can also search the interface files (in \interfaces folder of your instalaltion (when installing interfaces was checked in installation)).
Sign In or Register to comment.