Hi staff,
i have a big problem. I can't read a cell value.
I use infragistics 13.1, framework 4.0
I have the event: grd1_RowSelectionChanged [grd1: name of ultrawebgrid]
i've tried with this codes:
mytextbox.Text = Me.grd1.Rows(0).Items(0).Value.ToString
mytextbox.Text = me.webdatagrid1.behaviors.selection.selectedrows(0).dataitem("status").tostring
mytextbox.Text = e.CurrentSelectedRows(0).Items(0).Text.ToString
but i have this error: An object reference not set to an instance of an object.
can someone help me?
Thanks.
So, there is no way?
Hello Marco,
Thank you for posting in our forum.
Your code seems to be correct. I'm not sure why the exception may be thrown. Just to clarify - are you using WebDataGrid and not UltraWebGrid, is that correct? What is the exact version you are using?
Thanks for answering Nikolay, i still have that nullreferenceexception problem.
I'm using WebDataGrid, version 13.1.20131.1012,
thank for now.
Hi Marco,
Please note that you have to rebind the grid using the DataBind method on each page load or if you are binding only once, set EnableDataViewState property to true.
Let me know if this helps.
i bind my grid only once on the page load:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack ThenCall LOAD_GRID()End If
but EnableDataViewState propriety is True.
The grid's propriety are default, except "Columuns" (i don't autogenerate column). Ajax is enabled...
I am attaching a small sample that replicates your scenario - the textbox value is changed on row selection of the grid. Note that EnableAjax should be set to false in order for the textbox to be updated. Please have a look at the sample and let me know if you have any questions.
I'm glad you managed to resolve your issue.
If you have any other questions or concerns, please don't hesitate to ask.
Now it works!
Thank you Nikolay. When you told me "set EnableDataViewState property to true", i confuse EnableViewState with EnableDataViewState.
EnableViewState was set to true, but EnableDataViewState to false. That was the problem!
Thank you, you were very kind.
However, your code is similar to my.
in your scenario, you have used infragistics v.13.2, in this PC i have 13.1.
Exhaust v.13.2 and i will try your scenario.
Thank you for now, you're very kind.