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
3186
ValueBasedAppearance Decoding
posted

I have a need to be able to unwrap the contents of a ValueBasedAppearance in order to build strings etc that define how to show the same results in third party reporting package (dynamically). 

What I am seeing so far is this is not a easy task.  Can you provide any guidance on how this decoding would be accomplished?  

The way I have it running currently is to allow the user to create their own ValueBasedAppearance via a propertygrid and dialogs.  It is less desirable to have the user define this capability in the reporting package and translate that to a ValueBasedAppearance however I can do that.

Thanks for your guidance,

Nick

Parents
  • 12480
    Verified Answer
    Offline posted

    Hi Nick,

    It's possible to get at this, but it's a little tricky to do since the ValueBasedAppearance was built for the designer only. Please try out the following code. I wasn't sure how to best store the data for the needs of your project, so I just went with two separate lists as a simple example. You may want to create a data structure to associate conditions to appearances in a way that works for your application's requirements.

    private void FindConditions(UltraGrid grid, List conditionList, List appearanceList)
    {
       foreach (UltraGridColumn column in grid.DisplayLayout.Bands[0].Columns)
       {
          ConditionValueAppearance condition = column.ValueBasedAppearance as ConditionValueAppearance;

          if (condition != null)
          {
             IEnumerator enumerator = condition.Conditions;
             while (enumerator.MoveNext() == true)
             {
                OperatorCondition operatorCondition = enumerator.Current as OperatorCondition;
                conditionList.Add(operatorCondition);
                appearanceList.Add(condition[operatorCondition]);
             }
          }
       }
    }

Reply Children
No Data