SfdataGrid.QueryUnBoundRow += SfdataGrid_QueryUnBoundRow; void SfdataGrid_QueryUnBoundRow(object sender, GridUnBoundRowEventsArgs e) { if ((this.SfdataGrid.DataContext as ViewModel).GDCSource.Count == 0) { e.Value = "No Data"; e.Handled = true; } } |
Solution 1 : var ch = (this.SfdataGrid.DataContext as ViewModel).GDCSource.Count; Solution 2 : var ch1 = (this.SfdataGrid.View.SourceCollection as IList).Count; |