Oct 15, 2015, 11:23 AM
[CLOSED] Showing selected gridpanel row in property grid
Hello,
We have a scenario where we want to show selected row of grid panel in property grid. So we set a listener in grid panel, to fill up property grid, on select change like this:
How can I tell to property grid to fill it self up from this object, but only properties which I told to show?
Bellow you see the pictures.
We have a scenario where we want to show selected row of grid panel in property grid. So we set a listener in grid panel, to fill up property grid, on select change like this:
.Listeners(l =>
{
l.SelectionChange.Handler = "if (selected[0]) { this.next('propertygrid').setSource(selected[0].data); }";
})
This works, but it shows more columns then we initially configured for property grid. I guess it is because data property of selected row contains data that we didn't want to reveal. On the other hand it hides special fields (separator) if it is not in data (this separator I wanted to use to group properties).Html.X().PropertyGrid().Editable(false).SortableColumns(false).Flex(2).Title("Properties")
.Source(source =>
{
PropertyGridParameter pgpString = new PropertyGridParameter("StringProperty", "");
PropertyGridParameter pgpBoolean = new PropertyGridParameter("BooleanProperty", "");
PropertyGridParameter pgpSep = new PropertyGridParameter("separator", "");
PropertyGridParameter pgpDate = new PropertyGridParameter("DateProperty", "");
PropertyGridParameter pgpInt = new PropertyGridParameter("IntegerProperty", "");
PropertyGridParameter pgpFloat = new PropertyGridParameter("FloatProperty", "");
source.AddRange(new PropertyGridParameter[] { pgpString, pgpBoolean, pgpSep, pgpDate, pgpInt, pgpFloat });
})
.View
(
Html.X().GridView().GetRowClass(grc => grc.Handler = "return record.data.name == 'separator' ? 'my-class' : '';"))
)
How can I tell to property grid to fill it self up from this object, but only properties which I told to show?
Bellow you see the pictures.
Last edited by Daniil; Oct 27, 2015 at 2:01 PM.
Reason: [CLOSED]