Hi,
I use UltraGrid in virtual mode. I wanted to disable hottrack feature on cells, so I set CellHottrackInvalidationStyle to CellHottrackInvalidationStyle.Never.
_grid.DisplayLayout.CellHottrackInvalidationStyle = CellHottrackInvalidationStyle.Never;
Everything worked as I expected.
However, when I loaded an isl file (Office2010Black.isl or Office2010Silver.isl) by using StyleManager.Load, hottracking was unexpectedly enabled for ValueList columns. Here is the code I setup a value list to a column:
private void SetDropdownValueList(IFieldInfo fieldInfo, UltraGridColumn column) { var valueList = new BindableValueList { BindingContextControl = GridControl, DataSource = fieldInfo.DropdownValueList.ValueList }; if (!string.IsNullOrEmpty(fieldInfo.DropdownValueList.ValueMember)) valueList.ValueMember = fieldInfo.DropdownValueList.ValueMember; if (!string.IsNullOrEmpty(fieldInfo.DropdownValueList.DisplayMember)) valueList.DisplayMember = fieldInfo.DropdownValueList.DisplayMember; column.ValueList = valueList; column.Style = ColumnStyle.DropDownList; }
Could someone help me to solve this issue please?
Thanks,Shaolin
Hi Ivaylo,
I had to reopen this item since you never mentioned any solution to my second issue related to AppStyling. I post a separate thread for my second issue because the second issue is more troublesome. I was even able to figure out a solution for the Hottrack issue before you post your suggestion.
Best Regards,Shaolin
Thanks so much!
Hi Shaolin,
Of course you can get rid of any appearance included as a part of the style library. Just open the ISL file with your favorite text editor and you will see that the ISL file is actually an XML based document where each style node has state child nodes. The style you should be looking for is with attribute role equal to “GridCell”. In case you don’t want the style library to override a particular appearance or an element, you can just delete the entire style node or state child node corresponding to the appearance you would like to be removed.
Thanks for you reply!
Can you make some changes to an style library, for example, Office2010Black.isl to solve these two issues? I think there must be ways to get rid of appearance defined in an AppStylist.
Sample application intention was to show you how to enable and disable hot track appearance without loaded style library. As I explained above you can load different style sets, in order to enable and disable the hot track appearance of the cells using a style library.
In addition to your second question. It is completely normal that the appearance objects are not honored at runtime when a style library is loaded. The idea behind the style library is to apply all appearances in design time via the AppStylist application. In case any particular appearance is modified by the loaded style library, you can’t change it at runtime.
In a summary, you have to choose between setting the appearances with or without a style library. In case you would like to use a style library, be sure that all appearances you would like to be set are included and modified in the style library file.
Let me know if you need further assistance regarding this matter.