Actually, you do not have to use the row number returned from the database, you can generate the row number in running order programmatically in c#.
I have recreated your scenario using the following code and you will get the running row number.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
static DataTable GetMergeTable()
{
DataTable mergeTable = new DataTable();
mergeTable.Columns.Add("rowno", typeof(int));
mergeTable.Columns.Add("name", typeof(string));
mergeTable.Rows.Add(1, "christ");
mergeTable.Rows.Add(2, "william");
mergeTable.Rows.Add(3, "albert");
mergeTable.Rows.Add(1, "martin");
mergeTable.Rows.Add(2, "allen");
mergeTable.Rows.Add(3, "moorthy");
return mergeTable;
}
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
DataTable mergeTable = GetMergeTable();
int i = 1;
foreach (DataRow row in mergeTable.Rows)
{
row["rowno"] = i;
i++;
}
dataGridView1.DataSource = mergeTable;
}
}
}