Monday, November 24, 2014

Make the Visio Drop Down List from Variable List to Fixed List Dynamically by C#.

Variable List and Fixed List are two datatypes of Visio Shape Property. We had a requirement to populate the dropdown in Visio through database.

In Fixed List i was unable to bind the rows so i picked variable list to bind the column. There is a problem with Variable List you can type the values in it run time. So i have decided to convert the Variable list into Fixed List so user can only select the values from Drop Down.

Here is the Code sample which converts the Variable list into Fixed List.


Visio = Microsoft.Office.Interop.Visio

Shape.get_CellsSRC((short)Visio.VisSectionIndices.visSectionProp, 0, (short)Visio.VisCellIndices.visCustPropsType).FormulaForceU = "1";

Here the number denotes as follows
0  = String
1  = Fixed List
2  = Number
3  = Boolean
4  = Variable List
5  = Date
6  = Duration
7  = Currency

No comments:

Post a Comment