5.x
реестр
Технические вопросы

Раскрашивать реестр в 5.4

Подскажите можно ли раскрасить в разные цвета строки реестра в bpm 5.4 on-site?

Нравится

1 комментарий

Доброе утро, Илья. Ознакомьтесь с примером.

На PageLoad подписываемся на событие:

[csharp]
Page.DataSource.Loaded += Page.TreeGrid.DataLoaded;
Page.TreeGrid.GetRowConfigHandler += GetRowConfig;
[/csharp]

Пример метода, который реализует подсветку в зависимости от Статуса контрагента:

[csharp]
public virtual DataSourceRowConfig GetRowConfig(Entity row) {
string primaryColumnName = row.Schema.PrimaryColumn.Name;
string primaryColumnValue = row.GetColumnValue(primaryColumnName).ToString();
Dictionary Colors = new Dictionary();
Colors = (Dictionary)objColors;
var config = new DataSourceRowConfig(primaryColumnValue);
string backgroundColor = string.Empty;
var statusId = row.GetTypedColumnValue("AccountStatusId");
if(statusId != Guid.Empty && Colors.Count > 0){
backgroundColor = Colors[statusId];
}
if(!string.IsNullOrEmpty(backgroundColor)){
config.AddConfig(new DataSourceRowBackgroundColorConfigValue(backgroundColor));
}
string[] dropTags = new string[] {Page.DataSource.Schema.Name};
config.AddConfig(new DataSourceRowDragTagsConfigValue(dropTags));
return config;
}
[/csharp]

backgroundColor можно присваивать значения в таком виде:

Показать все комментарии