I want to bind my datagridview with my datatable where my "tableNumber" column in my datatable is eqaul to some number, but I olso want decide by self in which cell in datagridview a value from my datatable should go, because I have button cells in my datagridview I dont want to bind with the table. Can someone give a simple example? I will appreciate any help.
I have tried this query code but nothing shows up:
var dataRow = table2.AsEnumerable().Where(x => x.Field<int>("TableNumber") == Convert.ToInt16(btn.Text)).FirstOrDefault(); dataGridView1.DataSource = dataRow;