Hi
I'm just trying merge cell with QueryCoveredRange event shown in documentation using
https://help.syncfusion.com/windowsforms/grid-control/cell-merging
the problem is how can i remove covered range in sfdatagrid.
there is no problem at first time with below code, but data changing can cause out of index error or some can't merge.
DataTable dt = new DataTable();
dt.Columns.Add("col1", typeof(string));
dt.Columns.Add("col2", typeof(string));
dt.Columns.Add("col3", typeof(int));
dt.Columns.Add("col4", typeof(int));
dt.Columns.Add("col5", typeof(int));
List
List
var r = new Random();
foreach (var c1 in col1)
{
foreach (var c2 in col2)
{
int cnt = r.Next(3, 9);
for (int i = 1; i <= cnt; i++)
{
System.Data.DataRow dr = dt.NewRow();
dr["col1"] = c1;
dr["col2"] = c2;
dr["col3"] = i;
dr["col4"] = i + 1;
dr["col5"] = i + 2;
dt.Rows.Add(dr);
}
}
}
dgvUpdateResult.DataSource = null;
dgvUpdateResult.DataSource = dt;
dgvUpdateResult.Columns[0].CellStyle.Font.Orientation = 90;
dgvUpdateResult.Columns[0].CellStyle.Font.Bold = true;
dgvUpdateResult.Columns[0].CellStyle.HorizontalAlignment = HorizontalAlignment.Right;
dgvUpdateResult.Columns[1].CellStyle.Font.Orientation = 90;
dgvUpdateResult.Columns[1].CellStyle.Font.Bold = true;
dgvUpdateResult.Columns[1].CellStyle.HorizontalAlignment = HorizontalAlignment.Right;
dgvUpdateResult.Columns[2].CellStyle.Font.Bold = true;
dgvUpdateResult.Columns[2].CellStyle.TextColor = Color.Blue;
dgvUpdateResult.Columns[3].CellStyle.Font.Bold = true;
dgvUpdateResult.Columns[3].CellStyle.TextColor = Color.Orange;
dgvUpdateResult.Columns[4].CellStyle.Font.Bold = true;
dgvUpdateResult.Columns[4].CellStyle.TextColor = Color.Red;
dgvUpdateResult.Refresh();
Hi Angus chao,
We have checked the reported issue on our end, and we regret to let you know
that we are unable to reproduce the reported issue on our end. Here we have
attached the tested sample please have a look at this. If you still facing the
reported issue please share the below things,
It will be helpful for us to check the cause of the issue and to provide a solution at the earliest.
Regards,
Dhanasekar M.