问题描述
HI,
我正在通过OLEDBDataAdapter从excelsheet读取数据集中的值,而不是通过数据表将它们添加到gridview中。
假设这些值在两列中,当我在绑定到gridview之前在数据表中看到它时,它显示了确切的两列和正确的数据。
但是如果我尝试检查Gridview的OnRowDatabound事件中的gridview数据,它会显示只有一个单元格在那里......如果我试图通过
获取值
I am reading values in a dataset from a excelsheet through OLEDBDataAdapter and than adding them to a gridview through a datatable.
let say those values are in two columns and when i see at the datatable before binding to gridview, it is showing exact two columns and proper data.
But if i try to check the gridview data in Gridview's "OnRowDatabound" event, it shows that only one cell is there... and if i try to get the values through
e.row.cells[1].text
比它给出的我的错误,
任何想法???
than it gives me error,
Any idea???
推荐答案
这篇关于DataTable和Gridview奇怪的行为。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!