/// <summary> /// Initializes a new instance of <see cref="Syncfusion.UI.Xaml.Grid.GridRowInfo"/> class for UnBoundRow. /// </summary> /// <param name="rowIndex"> /// Corresponding index of the UnBoundRow info. /// </param> /// <param name="unBoundRow"> /// Contains the data item of corresponding UnBoundRow. /// </param> public GridRowInfo(int rowIndex, GridUnBoundRow unBoundRow) { this.RowData = null; this.NodeEntry = null; this.RowIndex = rowIndex; this.IsAddNewRow = false; this.IsFilterRow = false; this.GridUnboundRowInfo = unBoundRow; }
internal GridRowInfo Find(GridUnBoundRow unBoundRow) { if (unBoundRow == null) { throw new InvalidOperationException("UnBoundRow is null is not a valid operation in Find"); } return(Count > 0 ? this.FirstOrDefault(rowInfo => rowInfo.GridUnboundRowInfo == unBoundRow) : null); }
/// <summary> /// Initialize a new instance of <see cref="Syncfusion.UI.Xaml.Grid.GridCellInfo"/> class for UnBoundRow. /// </summary> /// <param name="column"> /// Corresponding column of the selected cell in UnBoundRow. /// </param> /// <param name="rowIndex"> /// Corresponding index of the selected cell in UnBoundRow. /// </param> /// <param name="unBoundRow"> /// Contains the data item of the selected cell in UnBoundRow. /// </param> public GridCellInfo(GridColumn column, int rowIndex, GridUnBoundRow unBoundRow) { this.Column = column; this.RowData = null; this.NodeEntry = null; this.RowIndex = rowIndex; this.IsAddNewRow = false; this.IsFilterRow = false; this.GridUnboundRowInfo = unBoundRow; }
internal GridUnBoundRowEventsArgs(GridUnBoundRow GridUnBoundRow, UnBoundActions action, object value, GridColumn column, String cellType, object originalSource, RowColumnIndex rowColumnIndex) : base(originalSource) { this.GridUnboundRow = GridUnBoundRow; this.UnBoundAction = action; this.Value = value; this.Column = column; this.CellType = cellType; this.RowColumnIndex = rowColumnIndex; this.CellTemplate = null; this.EditTemplate = null; }
internal GridSelectedCellsInfo Find(GridUnBoundRow unBoundRow) { if (unBoundRow == null) { throw new InvalidOperationException("UnBoundRow is null is not a valid operation in Find"); } if (internalCellsList.Count > 0) { return(internalCellsList.FirstOrDefault(item => item.GridUnboundRowInfo == unBoundRow)); } return(null); }
/// <summary> /// Resolves row index for the specified <see cref="Syncfusion.UI.Xaml.Grid.GridUnBoundRow"/>. /// </summary> /// <param name="DataGrid"> /// The SfDataGrid. /// </param> /// <param name="unBoundRow"> /// Specifies the UnBoundRow to get its corresponding row index. /// </param> /// <returns> /// Returns the row index of the specified UnBoundRow. /// </returns> public static int ResolveUnboundRowToRowIndex(this SfDataGrid DataGrid, GridUnBoundRow unBoundRow) { if (!DataGrid.UnBoundRows.Any()) { return(-1); } if (unBoundRow.Position == UnBoundRowsPosition.Top) { //var rows = DataGrid.UnBoundRows.Where(ubr => ubr.Position == unBoundRow.Position && ubr.ShowBelowSummary == unBoundRow.ShowBelowSummary); if (!unBoundRow.ShowBelowSummary) { return(DataGrid.GetHeaderIndex() + unBoundRow.UnBoundRowIndex + 1); } else { return(DataGrid.HeaderLineCount + (DataGrid.AddNewRowPosition == AddNewRowPosition.Top ? 1 : 0) + (DataGrid.FilterRowPosition == FilterRowPosition.Top ? 1 : 0) + unBoundRow.UnBoundRowIndex); } } else { if (!unBoundRow.ShowBelowSummary) { return(DataGrid.VisualContainer.RowCount - (DataGrid.GetTableSummaryCount(TableSummaryRowPosition.Bottom) + (DataGrid.AddNewRowPosition == AddNewRowPosition.Bottom ? 1 : 0) + (DataGrid.FilterRowPosition == FilterRowPosition.Bottom ? 1 : 0) + DataGrid.GetUnBoundRowsCount(unBoundRow.Position)) + unBoundRow.UnBoundRowIndex); } else { return(DataGrid.VisualContainer.RowCount - DataGrid.UnBoundRows.FooterUnboundRowCount + unBoundRow.UnBoundRowIndex); } } }