In winforms, I try to merge cell using cell border style.
There are some problem in cell border color.
attached file is screen shot.
plz help me
private void BtnDel_Click(object sender, EventArgs e)
{
MergeCell(GvMain, new int[] { 1, 2, 3, 4, 5 });
}
private void MergeCell(RadGridView gv, int [] idx)
{
GridViewRowInfo Prev = null;
foreach (GridViewRowInfo item in gv.Rows)
{
if (Prev != null)
{
string s1 = string.Empty;
string s2 = string.Empty;
foreach (int i in idx)
{
GridViewCellInfo c1 = Prev.Cells[i];
GridViewCellInfo c2 = item.Cells[i];
//s1 += "|" + (c1 != null && c1.Value != null ? c1.Value.ToString() : string.Empty);
//s2 += "|" + (c2 != null && c2.Value != null ? c2.Value.ToString() : string.Empty);
s1 = (c1 != null && c1.Value != null ? c1.Value.ToString() : string.Empty);
s2 = (c2 != null && c2.Value != null ? c2.Value.ToString() : string.Empty);
if (s1 == s2)
{
//c2.Value = string.Empty;
c2.Style.ForeColor = Color.Transparent;
//c2.Style.DrawBorder = true;
c2.Style.CustomizeBorder = true;
c2.Style.BorderTopWidth = 0;
//c2.Style.BorderTopColor = Color.Transparent;
}
else
{
//c2.Style.CustomizeBorder = false;
Prev = item;
break;
}
}
}
else
{
Prev = item;
}
}
}