Storing filtered rows of dataGridView in a DataTable
<p>I have a RadGridView control in my form. I bind DataGriView by one parameter by a search control. I use this code to store my selected rows in a DataTable and show in a report: </p>

<pre><code>DataTable table = new DataTable("dt1");

        foreach (Telerik.WinControls.UI.GridViewDataColumn column in radGridView1.Columns)
        {
            table.Columns.Add(column.Name, typeof(string));
        }
        for (int i = 0; i &lt; radGridView1.Rows.Count; i++)
        {
                table.Rows.Add();
                for (int j = 0; j &lt; radGridView1.Columns.Count; j++)
                {
                    table.Rows[i][j] = radGridView1.Rows[i].Cells[j].Value;
                }                
        }

        DataSet ds = new DataSet();
        ds.Tables.Add(table);
        StiReport stiReport = new StiReport();
        stiReport.Load("Report.mrt");
        stiReport.RegData(table);
        StiOptions.Viewer.Windows.ShowPageDesignButton = false;
        StiOptions.Viewer.Windows.ShowOpenButton = false;
        //stiReport.Design();
        stiReport.Show();
</code></pre>

<p>This code works, but when I use filter of RadDataGridView for selecting rows, the above code doesn't work good and all rows are displayed. How can change this code for storing only filtered rows in a DataTable.</p>