Hello everybody,
I have a dataGridView with the result of a query, this dataGridView allows me to select the records I want:
The idea is to associate the result of this query in the grid of the frmResult form, but I don't know with what type of data to collect and associate it to the dataSource of the dataGridView.
The frmResult:
Waiting for the result of the Select as a generic object type as it is in the code is the closest I've ever been to working, but I don't know what data type to put the result in to make it work.
Can you please help me?
Regards and thanks
I have a dataGridView with the result of a query, this dataGridView allows me to select the records I want:
Code
private void button1_Click(object sender, EventArgs e)
{
var values =
from DataGridViewRow row in ewgrid1.Rows
where Convert.ToBoolean(row.Cells["colCheck"].Value) == true
select new {id = row.Cells[1],name=row.Cells[2] };
frmResult formResultat = new frmResult();
formResultat.data = values.ToList();
formResultat.Show();
}The idea is to associate the result of this query in the grid of the frmResult form, but I don't know with what type of data to collect and associate it to the dataSource of the dataGridView.
The frmResult:
Code
public partial class frmResult : Form
{
public object data { get; set; }
public frmResult()
{
InitializeComponent();
}
private void frmResult_Load(object sender, EventArgs e)
{
ewgrid1.DataSource = data;
}
}Waiting for the result of the Select as a generic object type as it is in the code is the closest I've ever been to working, but I don't know what data type to put the result in to make it work.
Can you please help me?
Regards and thanks

