public override DataSourceRowConfig TreeGridConfigHandler(Entity row) { string primaryColumnName = row.Schema.PrimaryColumn.Name; string primaryColumnValue = row.GetColumnValue(primaryColumnName).ToString(); var config = new DataSourceRowConfig(primaryColumnValue); if (row.GetColumnValue("Type").ToString() == "EntitySchemaColumn") { config.AddConfig(new DataSourceRowIsExpandableConfigValue(false)); var icons = new Dictionary <string, ImageConfigValue>(); string imageName = string.Empty; if (row.GetTypedColumnValue <Guid>("RightLevel") == new Guid("007F04EE-1FE1-DF11-971B-001D60E938C6")) { imageName = "AllowAndGrant.png"; } if (row.GetTypedColumnValue <Guid>("RightLevel") == new Guid("C6EAA3F4-1FE1-DF11-971B-001D60E938C6")) { imageName = "Allow.png"; } if (row.GetTypedColumnValue <Guid>("RightLevel") == new Guid("C7EAA3F4-1FE1-DF11-971B-001D60E938C6")) { imageName = "Deny.png"; } icons.Add("Name", new ImageConfigValue(imageName)); var iconConfig = new DataSourceRowColumnIconsConfigValue(icons); config.AddConfig(iconConfig); } return(config); }
public override DataSourceRowConfig GetModuleRowConfig(Entity module) { var treeGrid = Page.Grid.FindPageControlByName("TreeGrid") as TreeGrid; treeGrid.ImageList = "Terrasoft.WebApp"; string primaryColumnName = module.Schema.PrimaryColumn.Name; string primaryColumnValue = module.GetColumnValue(primaryColumnName).ToString(); var valueTypeName = module.GetTypedColumnValue <string>("ValueTypeName"); var icons = new Dictionary <string, ImageConfigValue>(); var config = new DataSourceRowConfig(primaryColumnValue); var imageName = string.Format("{0}column.png", valueTypeName.ToLower()); icons.Add("valueTypeIcon", new ImageConfigValue(imageName)); config.AddConfig(new DataSourceRowFirstColumnIconsConfigValue(icons)); var dataSource = Page.Grid.FindPageControlByName("DataSource") as DataSource; var schemaName = dataSource.Schema.Name; string[] dragTags = new string[] { schemaName }; config.AddConfig(new DataSourceRowDragTagsConfigValue(dragTags)); return(config); /*var valueTypeName = row.GetTypedColumnValue<string>("ValueTypeName"); * var imageName = string.Empty; * var icons = new Dictionary<string, ImageConfigValue>(); * var config = new DataSourceRowConfig(primaryColumnValue); * imageName = string.Format("{0}column.png", valueTypeName.ToLower()); * icons.Add("valueTypeIcon", new ImageConfigValue(imageName)); * config.AddConfig(new DataSourceRowFirstColumnIconsConfigValue(icons));*/ }
/// <summary> /// ######## config ###### # ###### /// </summary> /// <param name="row">######## ### ######### # ##########</param> /// <returns>config ###### # ######</returns> protected virtual DataSourceRowConfig GetTreeGridRowConfig(Entity row) { var rowConfig = new DataSourceRowConfig(row.PrimaryColumnValue); string color = GetDayTypeColors()[row.GetTypedColumnValue <Guid>("DayTypeId")]; if (Regex.IsMatch(color, ColorRegExpMask, RegexOptions.IgnoreCase)) { var colorConfigValue = new DataSourceRowBackgroundColorConfigValue(color); rowConfig.AddConfig(colorConfigValue); } return(rowConfig); }
public override DataSourceRowConfig TreeGridConfigHandler(Entity row) { string primaryColumnName = "Id"; string primaryColumnValue = row.GetColumnValue(primaryColumnName).ToString(); var config = new DataSourceRowConfig(primaryColumnValue); var icons = new Dictionary <string, ImageConfigValue>(); foreach (var column in row.Schema.Columns) { if (column.Name.Contains("Can")) { bool columnValue = row.GetTypedColumnValue <bool>(column.ColumnValueName); string columnIconImageName = columnValue ? "Allow.png" : "Deny.png"; var imageConfig = new ImageConfigValue(columnIconImageName); imageConfig.DisplayImageOnly = true; imageConfig.ImagePosition = ImagePosition.Center; icons.Add(column.Name, imageConfig); } } var iconConfig = new DataSourceRowColumnIconsConfigValue(icons); config.AddConfig(iconConfig); return(config); }