It’s a very silly question, but I can’t get it to work, and I can’t find a solution now I need it. Yes I can get it to work in VB.NET (using the items collector, but C# doesn’t have it…), but in C# it won’t work…
I have pasted a DataTable from a DataSet to a DataGrid.
When someone double clicks a row within a DataGrid I would like to return a value from the column path within the DataTable. So I do the following:
And then I got the following error:
What stupid mistake have I made?
Thanks!
I have pasted a DataTable from a DataSet to a DataGrid.
When someone double clicks a row within a DataGrid I would like to return a value from the column path within the DataTable. So I do the following:
Code:
return ((DataTable)grdResult.DataSource).Rows[grdResult.CurrentRowIndex][1].ToString();
And then I got the following error:
Code:
error: object '(DataTable)grdResult.DataSource.Rows' doesn't have an indexer
What stupid mistake have I made?
Thanks!