try
{
if (MSGrid1.Col == 0)
{
putslno();
}
else if (MSGrid1.Col == 2)
{
int currow = MSGrid1.Row;
for (int i = 1; i <= MSGrid1.Rows - 1; i++)
{
for (int j = i + 1; j <= MSGrid1.Rows - 1; j++)
{
if ((MSGrid1.get_TextMatrix(j, 1) == MSGrid1.get_TextMatrix(i, 1)))
{
if (MSGrid1.get_TextMatrix(j, 1) != "")
{
MessageBox.Show("This Item Name is already selected");
MSGrid1.set_TextMatrix(j, 1, "");
MSGrid1.set_TextMatrix(j, 2, "");
MSGrid1.set_TextMatrix(j, 3, "");
MSGrid1.set_TextMatrix(j, 4, "");
MSGrid1.set_TextMatrix(j, 5, "");
MSGrid1.Focus();
MSGrid1.Col = 1;
return;
}
}
}
}
PlaceTxtBox();
}
else if (MSGrid1.Col == 4)
{
PlaceTxtBox();
}
else if (MSGrid1.Col == 6)
{
GridCombo();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
i have used msfluxgirid u can chk same logic with data grid