3 Answers, 1 is accepted
Hi, Udo,
RadGridView offers ChildRows collection which returns the data rows that are currently represented by RadGridView in the order in which they appear. The collection is modified every time a data operation (e.g. filtering) occurs. It is possible to populate programmatically a DataTable considering the content of the ChildRows collection. Then, use this DataTable for generating the report.
For the reporting part, you need to create a report definition that reflects the desired layout. You may check our Getting Started articles for details. You will have to use an ObjectDataSource component that points to the DataTable generated from the RadGridView. Finally, you may display the report in our WinForms Report Viewer.
Regards,
Todor
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi there,
how can I write the ChildRowSelection to a Datatable?
I need Help please!!.
Thanks for Help
Udo
I have prepared a sample code snippet demonstrating how to generate a DataTable populated with the data from the filtered RadGridView:
DataTable dt = new DataTable();
foreach (GridViewColumn col in this.radGridView1.Columns)
{
dt.Columns.Add(col.Name);
}
foreach (GridViewRowInfo row in this.radGridView1.ChildRows)
{
DataRow dr = dt.NewRow();
foreach (GridViewColumn col in this.radGridView1.Columns)
{
dr[col.Name] = row.Cells[col.Name].Value;
}
dt.Rows.Add(dr);
}
Tank You.
It works perfect