I binded a xamDataGrid to a data table. By default, after the binding, there's an extra column at the begining showing a plus sign. If I click on it, it will become a minus sign.
why do we have that column? and how do we remove it? Thanks.
Excellent! It works with this setting. Thanks.
Hello,
You can use the ExpansionIndicatorDisplayMode property. You can set it to CheckOnDisplay, which will check if the collection has items (nested records) and will show/hide the expansion indicator accordingly.
Hi,
Question on this. I have a grid that is bind to an object contains 3 fields where the 3rd field is a list (something like below). For this setup grid would display the + sign as it has hierarchical data.
But list field would either null or contains zero rows or contains 1 or more rows. I would like the + sign to be displayed only when the list field contains 1 or more rows otherwise I don't want the + sign to be displayed.
Please advise what is the best way to handle this requirement (when the list is null or list.Count is zero)
public class RecordKeyValue { public string Key { get; private set; } public object Value { get; private set; } public IList<RecordKeyValue> NestedValues { get; private set; }
public RecordKeyValue(string key, object value, IList<RecordKeyValue> nestedValues) { Key = key; Value = value; NestedValues = nestedValues; } }
This is the expansion indicator of the XamDataGrid. It is shown when the grid displays hierarchical data.
When you click it, it expands the nested records.
You can remove it by setting the ExpandableFieldRecordHeaderDisplayMode of the FieldSettings.
Regards,
Alex.