TsDBCtrlGrid questions

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #36536
    SzakiLaci
    Participant

    Hi,

    Please help me with DBCttrlGrid, because I'm trying since a week, but no luck:

    Problem 1:

    – if I select a row in the CtrlGrid >> it's nicely color the selected line with the property given at .SelectedColor = clLime; IF UNscinned.

    BUT if Skinned is active >> the only thing I can see are tiny dots around the selected row.

    Tried to change everything, like:

    Code:
    Grid1.PanelSkin := 'BUTTON';
    Grid1.SkinSelection := 'BUTTON_RED'; // declared at .CommonSections

    … but did not work either.

    Problem 2: (this is more important!)

    – Can not color/hide the controls separately drawn on each row depending on dataset values 🙁

    Tried both:

    Code:
    procedure TFrm_Orders.GR1PaintPanel(DBCtrlGrid: TDBCtrlGrid; Index: Integer);
    begin
    lbl_storno.Visible := DSorders.Active and (not DSordersStorno.IsNull);

    end;

    // or

    procedure TFrm_Orders.DSordersAfterScroll(DataSet: TDataSet);
    var n : TDateTime;
    begin

    lbl_storno.Visible := DSorders.Active and (not DSordersStorno.IsNull);
    end;

    … but each control behave the same in each row >> so only the current record defines the state of all, not just of 1 row. 🙁

    Using Version 8.42 stable. Are there any improvements for these problems in current 10.x version?

    #53459
    Support
    Keymaster
    'SzakiLaci' wrote:

    Tried to change everything, like:

    Code:
    Grid1.PanelSkin := 'BUTTON';
    Grid1.SkinSelection := 'BUTTON_RED'; // declared at .CommonSections

    … but did not work either.

    I will add new “SelectionSkin” property for this purpose in the next version of the package.

    Quote:
    Problem 2: (this is more important!)

    – Can not color/hide the controls separately drawn on each row depending on dataset values 🙁

    This problem I can't solve quickly, unfortunately.. researching required. Maybe solution is available in the Net already?

    #53463
    SzakiLaci
    Participant

    Thank you VERY much for your quick answer!

    'Support' wrote:

    I will add new “SelectionSkin” property for this purpose in the next version of the package.

    Many Thanks 🙂 sounds great! Until then I'll just set '' (none) for skin, so it will stay unskinned >> that way the selection will be colored properly.

    'Support' wrote:

    This problem I can't solve quickly, unfortunately.. researching required. Maybe solution is available in the Net already?

    That's bad… without this I have to drop 3 weeks of work if I have to change the DBCtrlGrid to some other alternative. (Is there any?)

    I've searched the web based for 3 days on normal TCtrlGrid >> others had same problems too >> found no real “this is working and tested” type of solution.

    #53464
    SzakiLaci
    Participant

    I've just found that:

    http://www.delphigroups.info/2/29/385120.html

    … will investigate more.

    #53476
    SzakiLaci
    Participant

    Still no solution 🙁

    I think I'm approaching this problem “from the wrong component”.

    If I would like to color each component differently row by row >> maybe I should somehow override each component's OnPaint event, and change color and visibility there.

    Already tried to put the code to every TsDBEdit's OnChange event, but no luck with that either.

    How do I override a TsEdit or TsLabel ? … than change the color first, than decide if inherited should be called or not.

    #53477
    SzakiLaci
    Participant

    Strange …

    Yesterday I've tried under Delphi XE3 the OnPaintPanel version, and it's WORKING !

    Well, I mean coloring TEdit componensts. Setting Visible row by row drops error.

    #53478
    Support
    Keymaster

    I will check it soon, after the nearest relase.

    Maybe we will be able to use the Visible property also.

    #53480
    SzakiLaci
    Participant
    'Support' wrote:

    I will check it soon, after the nearest relase.

    Maybe we will be able to use the Visible property also.

    Sounds great! Thanks in forward… 🙂

    An other guy reported me, it's working under TurboDelphi too. So the problem seems to be at Delphi 7 base code. Maybe you can override it.

    In between I've tried an other solution:

    – setting TsDBLabel-s Autosize property to true, and catch the DataField's OnGetText to allow any Text printed only if necessary… but that's a failure too.

    Code:
    procedure TFrm_NetRendelesek.DSrendSZTORNOZVAGetText(Sender: TField;
    var Text: String; DisplayText: Boolean);
    begin
    DisplayText := (DSrend.Active and not DSrendSZTORNOZVA.IsNull);
    Text := ifThen(DisplayText, 'S Z T O R N Ó Z V A ! '+ftdp(DSrendSZTORNOZVA.AsDateTime) );
    end;

    So you are my last hope :blush:

    #53482
    SzakiLaci
    Participant

    Tested to switch back the TsCtrlGrid component to Delphi's default TCtrlGrid >>

    and it's WORKING how it should!!!

    So that means AlphaSkin is causing this mess.

    #53484
    Support
    Keymaster

    I have tried it too, but with same result as in TsDBCtrlGrid. Can you show me how you doing that in the test-app?

    #53486
    SzakiLaci
    Participant
    'Support' wrote:

    I have tried it too, but with same result as in TsDBCtrlGrid. Can you show me how you doing that in the test-app?

    Sorry, no time. Don't worry about that any more. Will use standard TDBCtrlGrid.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.