For atoz = 1 To arrChannel.Length - 2
For atoz2 = 2 To 10
Dim recordindex
recordindex = dgStockInfo.ResolveToRecordIndex(atoz)
Dim columnindex = dgStockInfo.ResolveToGridVisibleColumnIndex(atoz2)
Dim mappingname = dgStockInfo.Columns(columnindex).MappingName
Dim record = dgStockInfo.View.Records.GetItemAt(recordindex)
Dim cellvalue = dgStockInfo.View.GetPropertyAccessProvider().GetValue(record, mappingname)
If cellvalue = "" Then
dgStockInfo.AddRange(New Syncfusion.UI.Xaml.Grid.CoveredCellInfo(atoz2 - 1, 2, atoz, 1))
End If
Next
Next
dgStockInfo.GetVisualContainer().InvalidateMeasureInfo()
Thanks for your help,
Larry
dataGrid.QueryCoveredRange += dataGrid_QueryCoveredRange; void dataGrid _QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e) { Dim mappingname = e.GridColumn.MappingName Dim record = e.Record Dim cellvalue = dgStockInfo.View.GetPropertyAccessProvider().GetValue(record, mappingname) If cellvalue = "" Then e.Range = New Syncfusion.UI.Xaml.Grid.CoveredCellInfo(e.RowColumnIndex.ColumnIndex - 1, 2, e.RowColumnIndex.RowIndex, 1)) End If |
this.dataGrid.QueryCoveredRange += DataGrid_QueryCoveredRange; IPropertyAccessProvider reflector = null; private void DataGrid_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e) { if (reflector == null) reflector = this.dataGrid.View.GetPropertyAccessProvider(); if (e.Record == null) return;
var colindex = this.dataGrid.Columns.IndexOf(e.GridColumn); if (colindex == this.dataGrid.Columns.Count - 1) return;
var val = reflector.GetValue(e.Record, dataGrid.Columns[colindex + 1].MappingName);
if (val == null || string.IsNullOrEmpty(val.ToString())) { e.Range = new CoveredCellInfo(e.RowColumnIndex.ColumnIndex, e.RowColumnIndex.ColumnIndex + 1, e.RowColumnIndex.RowIndex, e.RowColumnIndex.RowIndex); e.Handled = true; } |