We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to set Settings for a Shape on Palette

Hallo

i have created a Palette with shapes in it.
Palette.Items.Add(new FlowShape() { Name = "Frage", Height = 40, Width = 44, Shape = FlowShapes.Process, AddInfo = new Dictionary<string, string>() { { "ssgdata", "datenssg" } } });

All work fine bit the AddInfo will not set when I Drag&Drop a Shape form the Palette to Diagram.


2 Replies

SG Shyam G Syncfusion Team August 24, 2017 06:12 AM UTC

Hi Stephan, 
 
Please refer to the code example below in which we have shown how to set addInfo(custom property) to an node. 
 
Code example: 
 
//define addInfo property 
Dictionary<string, object> addinfo = new Dictionary<string, object>(); 
addinfo.Add("ssgdata", "datenssg"); 
 
Palette.Items.Add(new FlowShape() { Name = "Frage", Height = 40, Width = 44, Shape = FlowShapes.Process, AddInfo = addinfo }); 
 
 
Regards, 
Shyam G 



SG Shyam G Syncfusion Team August 24, 2017 09:22 AM UTC

Hi Stephan, 
 
Please ignore our previous update 
 
Please use Dictionary<string,object>() instead of Dictionary<string,string>() to resolve your reported issue. 
 
Code example: 
 
 Palette.Items.Add(new FlowShape() { Name = "Frage", Height = 40, Width = 44, Shape = FlowShapes.Process, AddInfo = new Dictionary<string, object>() { { "ssgdata", "datenssg" } } }); 
 
Regards, 
Shyam G 


Loader.
Up arrow icon