Husam Al Madain
Top achievements
Rank 1
Husam Al Madain
asked on 21 Apr 2010, 08:22 AM
I need to get only the filterd data from the grid to show it in a report
example: I have grid with 10 rows binded from data set then I have filtered the data, and now the grid is showing only 4 rows,
how can I get only these 4 rows?
thank you
example: I have grid with 10 rows binded from data set then I have filtered the data, and now the grid is showing only 4 rows,
how can I get only these 4 rows?
thank you
5 Answers, 1 is accepted
0
Hello Husam Al Madain,
Kind regards,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You can use the Rows collection of the RadGridView control for this scenario:
private void radButton1_Click(object sender, EventArgs e){ BindingList<object> filteredRows = new BindingList<object>(); foreach (GridViewDataRowInfo row in this.radGridView1.Rows) { filteredRows.Add(row.DataBoundItem); } //use filteredRows collection for your report...}Kind regards,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Husam Al Madain
Top achievements
Rank 1
answered on 28 Apr 2010, 10:24 AM
Thank you for your reply
But I need another help please
How can I convert the “filteredRows” to Datatable
Because the report can’t see the rows from the filteredRows
or
If you can tell me how to bind it to datatable I’ll be very thankful
0
Hello Husam Al Madain,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Please send me a code snippet for your filtering operation and binding so that we can give you the best solution for your scenario (please copy the source code in your Form object). Thank you in advance.
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Husam Al Madain
Top achievements
Rank 1
answered on 02 May 2010, 07:47 AM
| ' Loading the Datagrid |
| Dim obj As New ClsSearch |
| Dim ds As DataSet |
| ds = obj.Load_Search(SP_Report) |
| If ds Is Nothing Then Exit Sub |
| RadGridView1.DataSource = ds.Tables(0) |
| 'after filtering from the grid filter area I need to get only the filtered data in it |
| 'and use it in a report source(as datatable or dataset) |
0
Hello Husam Al Madain,
Greetings,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You can use this code snippet:
Dim reportTable As New DataTable()For Each column As GridViewDataColumn In Me.radGridView1.Columns reportTable.Columns.Add(column.UniqueName, column.DataType)NextFor Each row As GridViewDataRowInfo In Me.radGridView1.Rows Dim dataRow As DataRow = reportTable.NewRow() For Each dataColumn As DataColumn In reportTable.Columns dataRow(dataColumn) = row.Cells(dataColumn.ColumnName).Value Next reportTable.Rows.Add(dataRow)Next'reportTable usage...Greetings,
Julian Benkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.