I am using the following code to get an array of values from Excel;
I then try to bind the array to a GridView using;
However I get the error; "Array was not a one-dimensional array".
I have tried converting the array to an observable collection;
but this displays the error; "The best overloaded method match for 'System.Collections.ObjectModel.ObservableCollection<object>.ObservableCollection(System.Collections.Generic.IEnumerable<object>)' has some invalid arguments".
How can I bind the Excel data returned to the grid?
rng = ws.Range[sCell1, sCell2];
object
dataRows = rng.Value;
I then try to bind the array to a GridView using;
gvText.ItemsSource = dataRows;
However I get the error; "Array was not a one-dimensional array".
I have tried converting the array to an observable collection;
ObservableCollection<
object
> colRows =
new
ObservableCollection<
object
>(dataRows);
but this displays the error; "The best overloaded method match for 'System.Collections.ObjectModel.ObservableCollection<object>.ObservableCollection(System.Collections.Generic.IEnumerable<object>)' has some invalid arguments".
How can I bind the Excel data returned to the grid?