/// <summary> /// Create a row in the data grid, create empty cells matching the columns. /// </summary> /// <param name="DataGrid"></param> /// <returns></returns> public IGridRow CreateRowWithCells(IDynDataGrid dataGrid, object obj) { IGridRow row = new GridRow(dataGrid, obj); // create a cell for each column foreach (IGridColumn column in dataGrid.ListColumn) { IGridCell cell = CreateCell(dataGrid, column, row); row.AddCell(cell); } dataGrid.AddRow(row); return(row); }
/// <summary> /// Create a row with (empty) cells, at the end. /// create row and cells models and ViewModel. /// Use this method for a basic usage: you use the component dataGrid as your application dataGrid model. /// </summary> /// <returns></returns> public IGridRow CreateRowWithCells() { IGridRow row = new GridRow(_dynDataGrid); // get columns foreach (IGridColumn col in _dynDataGrid.ListColumn) { // create the cell, matching the type defined in the column IGridCell cell = _gridFactory.CreateCell(_dynDataGrid, col, row); row.AddCell(cell); } // add the row to the dataGrid _dynDataGrid.AddRow(row); // add it to the view: create VM IGridRowVM rowVM = new GridRowVM(row); _collDataRow.Add(rowVM); RaisePropertyChanged("CollDataRow"); return(row); }