Jump to content

CSS for UniDBGrid


MarcoZC

Recommended Posts

Good morning. I have two days trying to configure the customcss to be shown as I want. I have reviewed all the contributions to the CSS configuration forum of a Tunidbgrid component and I can't get it as I would like.
I am using version 1.90.0.1567 of Unigui, Delphi 11 version 28.0.48361.3236.
The maximum I have achieved is to show the unidbgrid in Zebra format using:
.x-grid-item-Alt {
     Background-Color: #DFBF9F;
}
I am using the Triton-Modified theme and when I pass with the cursor on one of the items that are not even the line takes the default color of the theme, but when I pass on one of the item even the line does not change color.

Looking on the Internet I have found this configuration that in principle adapts to what I want to do:
/ * General style for UNIDBGRID */
.STL-GRID {
   Font-Family: Arial, Sans-Serif;
   Border-Collapse: Collapse;
   Width: 100%;
   Margin: 10px 0;
}

/ * Table header */
.stl-Grid Th {
   background-color: #8b5a2b; /* Dark brown */
   Color: #FFF; / * Blank text */
   Padding: 8px;
   Text-align: Left;
}

/ * Even rows */
.STL-GRID TR: NTH-CHILD (EVEN) {
   Background-Color: #F2E5C1; /* Light brown */
}

/ * Odd rows */
.STL-GRID TR: NTH-CHILD (ODD) {
   Background-Color: #E5D0A4; / * Another tone of light brown */
}

/ * Normal cell */
.STL-GRID TD {
   Padding: 8px;
}

/ * Highlighted cell (for example, when passing the cursor on it) */
.STL-GRID TD.HIGHLIGHT {
   Background-Color: #BF8040; / * Medium brown */
   Color: #FFF; / * Blank text */
}

/ * Selected cell */
.STL-GRID TD.SELECTED {
   Background-Color: #A3662A; /* Dark brown */
   Color: #FFF; / * Blank text */
}
But even if it includes it in the Grid Cls, directly on the component or do so by uniframecreate with dbgrid.jsinterface.jsconfig ('CLS', ['Stl-Grid']);
Only all the rows are shown in a color and when I move the cursor, nothing changes.

Any help, please?

Link to comment
Share on other sites

  • 8 months later...
On 8/15/2023 at 1:12 PM, MarcoZC said:

Good morning. I have two days trying to configure the customcss to be shown as I want. I have reviewed all the contributions to the CSS configuration forum of a Tunidbgrid component and I can't get it as I would like.
I am using version 1.90.0.1567 of Unigui, Delphi 11 version 28.0.48361.3236.
The maximum I have achieved is to show the unidbgrid in Zebra format using:
.x-grid-item-Alt {
     Background-Color: #DFBF9F;
}
I am using the Triton-Modified theme and when I pass with the cursor on one of the items that are not even the line takes the default color of the theme, but when I pass on one of the item even the line does not change color.

Looking on the Internet I have found this configuration that in principle adapts to what I want to do:
/ * General style for UNIDBGRID */
.STL-GRID {
   Font-Family: Arial, Sans-Serif;
   Border-Collapse: Collapse;
   Width: 100%;
   Margin: 10px 0;
}

/ * Table header */
.stl-Grid Th {
   background-color: #8b5a2b; /* Dark brown */
   Color: #FFF; / * Blank text */
   Padding: 8px;
   Text-align: Left;
}

/ * Even rows */
.STL-GRID TR: NTH-CHILD (EVEN) {
   Background-Color: #F2E5C1; /* Light brown */
}

/ * Odd rows */
.STL-GRID TR: NTH-CHILD (ODD) {
   Background-Color: #E5D0A4; / * Another tone of light brown */
}

/ * Normal cell */
.STL-GRID TD {
   Padding: 8px;
}

/ * Highlighted cell (for example, when passing the cursor on it) */
.STL-GRID TD.HIGHLIGHT {
   Background-Color: #BF8040; / * Medium brown */
   Color: #FFF; / * Blank text */
}

/ * Selected cell */
.STL-GRID TD.SELECTED {
   Background-Color: #A3662A; /* Dark brown */
   Color: #FFF; / * Blank text */
}
But even if it includes it in the Grid Cls, directly on the component or do so by uniframecreate with dbgrid.jsinterface.jsconfig ('CLS', ['Stl-Grid']);
Only all the rows are shown in a color and when I move the cursor, nothing changes.

Any help, please?

I tried to check this CSS but it dosnt work 

may you send me a testcase

 

or you can try this one 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...