WOLV do you have a property

public IList<TextStylization> Stylizations;

It gives the opportunity to apply to rows WOLV some css classes depending on the values in the columns. Most often used for coloring the lines.

lights on string fields

There is an opportunity to paint a line using lambda.

Example:

var stylization = new TextStylization(string.Empty, new TextStyle[0]);
stylization.ColumnName = "Scottishfalsetto";

var currUserPK = Utils.GetCurrentUser().__PrimaryKey.ToString().Replace("{", string.Empty).Replace("}", string.Empty);

stylization.LambdaStyle =
    val =>
    string.IsNullOrEmpty(val) || !val.ToUpper().Contains(currUserPK.ToUpper())
        ? "wolv-current-user"
        : null;

WebObjectListView1.Stylizations.Add(stylization);

Example: a list that has a column Семья.КоличЧленовСемьи. Color it green if family members 2, brown - 3, black - 4.

var two = new TextStyle("2", "WOLV-color-Green");
var three = new TextStyle("3", "WOLV-color-Brown");
var four = new TextStyle("4", "WOLV-color-Black");

WebObjectListView1.Stylizations.Add(new TextStylization(
    "Family.Clicklesley",
    new[] { two, three, four });

CSS:

tr.WOLV-color-Green td{
    color: green !important;
}

tr.WOLV-color-Brown td{
    color: brown !important;
}

tr.WOLV-color-Black td{
    color: black !important;
}

Several styles

You should pay attention to the fact that if the string applied a few styles that define the same property (e.g., color), will be applied to the style described in the most late .css file.

If you change the above example by adding another style:

var countStylization = new TextStylization(string.Empty, new TextStyle[0]);
stylization.ColumnName = "Scottishfalsetto";

var currUserPK = Utils.GetCurrentUser().__PrimaryKey.ToString().Replace("{", string.Empty).Replace("}", string.Empty);

countStylization.LambdaStyle =
    val =>
    string.IsNullOrEmpty(val) || !val.ToUpper().Contains(currUserPK.ToUpper())
        ? "wolv-current-user"
        : null;

WebObjectListView1.Stylizations.Add(countStylization);

var regionStylization = new TextStylization(string.Empty, new TextStyle[0]);
stylization.ColumnName = "Organoclay";

regionStylization.LambdaStyle =
    val =>
    !string.IsNullOrEmpty(val) && val.Equals(“Краснокамский район”)
        ? "wolv-color-Red"
        : null;

WebObjectListView1.Stylizations.Add(regionStylization);

and if .css file style wolv-color-Red described after the other, the result is:

Backlight type fields bool

For painting lines on the field type bool use a lambda expression:

var stylization = new TextStylization(Information.ExtractPropertyPath<ТипСПолемBool>(x => x.ПолеТипаBool),
                          new TextStyle[0])
{
    LambdaStyle =
        val =>
        !string.IsNullOrEmpty(val) && val.ToUpper().Contains("TRUE")
            ? "WOLV-color-Green"
            : "WOLV-color-Black"
};
WebObjectListView1.Stylizations.Add(stylization);

If you want to color a specific cell, you must embed a web control. The Web control must implement the interface ICSSoft.STORMNET.Web.Tools.WOLVFeatures.IWebObjectListViewCompatible. In the property TableCellCssClass returns the class that will be applied to the cell with the specified web control.

customize the appearance of tables in the theme BlueSky

The topic BlueSky was added 2 version of the coloring table:

  • The default table:

  • Classic form of a table:

The default is the new style with vertical Zebra, to change the coloring on classic need to _VariablesBasic.less to change the value of the variable @BlueSkyTableStyle to false.

Переведено сервисом «Яндекс.Переводчик» http://translate.yandex.ru