Conditional rendering based on the binding data

new go.Binding("figure","fig", v=> {
					if(v !== "Circle") {
				 return this.make(go.RowColumnDefinition, {
				 	row: 0,
				 	sizing: go.RowColumnDefinition.None
I need to get the value and based on that I want to conditionally return the statement, Is there a way to do that?

A Binding cannot modify the structure of the visual tree of the node or link. The return value for a binding conversion function is used as the new value for the target property and thus must be of the type that the property setter expects.

But you could bind the RowColumnDefinition.sizing property, if that is what you want to set based on the data.fig property value.

Thanks walter,
The issue i’m having is, The Node shape should be a rectangle or a circle based on the value. I’m able to change the shape of the node But, I need to change the panelType from go.Panel.Table to go.Panel.Auto based on the value and Since, the go.Panel.Auto configuration doesn’t allow RowColumnDefinition. I want to conditional render the RowColumnDefinition, if the go.Panel is Table and return ; if it is Auto.

It isn’t clear to me that you want to change the Panel.type. Could you show small screenshots showing what you want?

Also, it might be easiest to define two different templates, and just switch the data.category or Node.category.

1 Like

Sorry walter, I couldn’t share the screenshot.

I want to switch from the go.panel.Table to go.Panel.Auto based on the value.

I guess, the Node.categorytemplateMaps would work for my situation.

Thanks for the help, walter.