Hi, all,
I was tangled by the DataGridItem.Da taItem property. I tried to invoke
that property to get and display the contents that was bound to the
currently selected row. However, an exception surprised me that it said
"Object reference not set to an instance of an object." How could it happen?
I have set the data source, and called the DataBind().
I looked up the MSDN documents, and just find some inessential
descriptions, and a code example. I didn't try that example by myself, but I
noticed a difference that, the example uses the single-file code (i.e code
was written in the .aspx file) while I wrote my code in the code-behind
mode. So I wonder if this is the reason? But I'm afraid I would be puzzled
if MS says the DataItem property will not be available through code-behind:)
Any help, please?
I was tangled by the DataGridItem.Da taItem property. I tried to invoke
that property to get and display the contents that was bound to the
currently selected row. However, an exception surprised me that it said
"Object reference not set to an instance of an object." How could it happen?
I have set the data source, and called the DataBind().
I looked up the MSDN documents, and just find some inessential
descriptions, and a code example. I didn't try that example by myself, but I
noticed a difference that, the example uses the single-file code (i.e code
was written in the .aspx file) while I wrote my code in the code-behind
mode. So I wonder if this is the reason? But I'm afraid I would be puzzled
if MS says the DataItem property will not be available through code-behind:)
Any help, please?
Comment