DataGridView Row HotTracking

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

Hi,

I’ve been looking for a way on how to do hot-tracking a row when the mouse is over a row. I looked at appearance key Table Row in Theme Builder but didn’t find any style or properties for Hovered the way Treeview does.

Is it possible?

Thanks.

  • You must to post comments
0
0

I copied the values from the theme since I thought thatĀ the mixin overrides the entire state. But it looks like it preserves the inherited styles. See

"inherit": "table-row"


 

  • You must to post comments
0
0

Hi Luca,

This is great and works. Just wondering what are

             "widthBottom": 1,
               "colorBottom": "table-row-line",
               "backgroundColor": "table-row-background",
lines for in the under styles. I commented them out and still works. Am I missing something?

Thanks.
  • Cris
    • Cris
    • Jan 10, 2017 - 5:21 pm
    Hi Luca, I now see the difference when above three lines are commented out. Sorry.
  • You must to post comments
0
0

Yes, it’s possible but in a slightly different way since rows and cells in a DGV are not widgets, they are rendered directly as html. The nodes in a treeview andĀ items in a listbox are widgets so they have all the standard widget states and behavior. The theme states, styles and properties that a DGV cell recognizes are preset in the cell renderers (you can have customer renderers, but it’s a different topic and we’ll have an extension with some very cool DGV columns).

To make it short, you can always use normal CSS in a Wisej theme using the css value under styles. Try this mixin:

{
 "name": "HotDGV",
   "appearances": {
     "table-row": {
       "inherit": "table-row",
       "states": {
         "default": {
           "styles": {
             "widthBottom": 1,
               "colorBottom": "table-row-line",
               "backgroundColor": "table-row-background",
               "css": "{\"hover\":{\"cursor\":\"pointer\", \"background-color\":\"red\"}}"
           },
           "properties": {
             "textColor": "table-row"
           }
        }
      }
    }
  }
}

You can also use any of the theme colors instead of red. The definition in “css” is translated to pure css by Wisej. Id you specify a child property (in the mixin above it’s “hover”, Wisej treates is a pseudo style and it prefixes it with “:”, so hover becomes “:hover”. If you used “:after”, it would becomes “::after” and you can add ::after and ::before pseudo elements.

 

 

 

  • You must to post comments
Showing 3 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json