Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4032
How disable active cell appearance from app styling
posted

I have read some posts about disable app styling for a certain grid but could not resolve it to my problem. I can not see any logic there.

I use a predefined .ISL style library in my app (office black.isl. I have disabled the active row and selected row appearance by this code:

            e.Layout.Override.ActiveAppearancesEnabled = DefaultableBoolean.False;
            e.Layout.Override.SelectedRowAppearance.Reset();
            e.Layout.Override.ActiveCellAppearance.Reset();

But selecting a cell the cell backcolor is still set to some orange color and backcolor of cells are not visible. All what I want is a black color (thickness 2) around the active cell. Selected cells should have also a black color of thickness 1. Default border color is light grey.

I tried this but does not work (see image attached):

            // Active cell
            band1.Override.ActiveCellAppearance.Reset();
            band1.Override.ActiveCellAppearance.BackColor = Color.Transparent;
            band1.Override.ActiveCellAppearance.BorderColor = Color.Black;
            band1.Override.ActiveCellBorderThickness = 2;

            // Selected cells
            band1.Override.SelectedCellAppearance.Reset();
            band1.Override.SelectedCellAppearance.BackColor = Color.Transparent;
            band1.Override.SelectedCellAppearance.BorderColor = Color.Black;

Can someone give me some advises to achieve this?

Regards

Markus

 

 

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Markus,

    What version of the controls are you using?

    And which Isl file are you using? There is no "office black.isl", so I assume you meant 'Office2007Black.isl'? Or is this your own custom isl file? Have you made changes to the isl?

    The isl file setting override the settings you apply in code. It looks like this isl file has both active and selected appearances applied to the grid row.

    So there are only two ways to turn this off:

    1) Remove these settings from the isl file itself. This means turning it off for all grids.

    2) Turn off both active and selected appearances in the grid. You are only turning off ActiveAppearancesEnabled, but you did not turn off SelectedAppearancesEnabled. So that's why you are still seeing the orange.

    If you go with option 2 here, then you cannot have a border around the active or selected row. It's all or nothing.

    Also, there's no way to apply a border around the active row - the grid only has this functionality for selected rows.

    So... if you want to have a border around the selected row, it seems to me that you will need to do this in the Isl file. If you want this for all grids in your application, then it's fairly simply. If you want to do this on some grids and not others, then you will need to create multiple StyleSets in your isl and apply them to the grids you want using the StyleSetName property on the grid(s) in your application.

Children