Hi everybody! How can i read data from invisible column? when i select a row and try to use "GetSubItem" on invisible column (IsVisible = false) it will throw "NullReferenceException" .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[In general, if you're an exception, it's best to include the stack trace. It's normally very helpful. It's also a good idea to include a snippet of your code so we can see what you are actually doing.]
Normally, there is no reason to read data from an invisible column. Invisible columns are simply so the user can choose which columns they want to see. You never need them programmatically. You just get the model object from the row you want, and then read the desired property from it directly.
For example, if your invisible column was holding the GUID that was the database key of the selected row, you'd do something like this:
If you really, really have to read from your invisible column, you'll need to keep a reference to your invisible column, and then use the GetValue() method:
Hi everybody! How can i read data from invisible column? when i select a row and try to use "GetSubItem" on invisible column (IsVisible = false) it will throw "NullReferenceException" .
Hi there,
[In general, if you're an exception, it's best to include the stack trace. It's normally very helpful. It's also a good idea to include a snippet of your code so we can see what you are actually doing.]
Normally, there is no reason to read data from an invisible column. Invisible columns are simply so the user can choose which columns they want to see. You never need them programmatically. You just get the model object from the row you want, and then read the desired property from it directly.
For example, if your invisible column was holding the GUID that was the database key of the selected row, you'd do something like this:
If you really, really have to read from your invisible column, you'll need to keep a reference to your invisible column, and then use the
GetValue()method:Though I can't off the top of my head think of any use case for this pattern.
Last edit: Phillip Piper 2018-05-29
Hi Phillip
Thank you for helpful reply. that’s right, if i use model object there is no need to read data from invisible column.
Last edit: a bahman 2018-05-30