- This topic has 10 replies, 2 voices, and was last updated 9 years, 5 months ago by SzakiLaci.
-
AuthorPosts
-
May 28, 2015 at 12:55 pm #36536SzakiLaciParticipant
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?
May 28, 2015 at 2:43 pm #53459SupportKeymaster'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?
May 29, 2015 at 12:23 am #53463SzakiLaciParticipantThank 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.
May 29, 2015 at 12:39 am #53464SzakiLaciParticipantMay 31, 2015 at 7:27 pm #53476SzakiLaciParticipantStill 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.
June 1, 2015 at 9:34 am #53477SzakiLaciParticipantStrange …
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.
June 1, 2015 at 10:17 am #53478SupportKeymasterI will check it soon, after the nearest relase.
Maybe we will be able to use the Visible property also.
June 1, 2015 at 1:15 pm #53480SzakiLaciParticipant'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:
June 2, 2015 at 11:36 am #53482SzakiLaciParticipantTested 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.
June 4, 2015 at 8:41 am #53484SupportKeymasterI have tried it too, but with same result as in TsDBCtrlGrid. Can you show me how you doing that in the test-app?
June 4, 2015 at 8:44 pm #53486SzakiLaciParticipant'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.
-
AuthorPosts
- You must be logged in to reply to this topic.