Hi,
I want to set allowaddnewrow on my columnlayout based on the content of my datasource in the columnlayoutassigned event. How can I get the datasource for the columnlayout being assigned?
You can use the ColumnLayoutAssignedEventArgs to get information about the data source:
private void XGrid_ColumnLayoutAssigned(object sender, ColumnLayoutAssignedEventArgs e) { // The type of data that this ColumnLayout will represent. Type type = e.DataType; // The collection of rows or row island that this particular ColumnLayout will represent. RowCollection rowCollection = e.Rows; RowBase row = rowCollection.FirstOrDefault(); if (row != null) { var itemsSource = ((RowsManager)row.Manager).ItemsSource; } }
HTH