I'm using 2014.1.2283 Infragistics
I found that if i have several grids in a <asp:MultiView> control, the reference of the webdatagrid control(which is in an inactive view) itself will be null in a postback.
The according behavior is reproduced and attached.
As I'm migrating a project from UltraDataGrid to WebDataGrid, it worked fine with UltraDataGrid.
The page has different states for displaying different content for users.
Is there any method could avoid the null referencing on the webdatagrid itself?
Hello Edgar,
Your attachment contains only the packages folder and the .sln file, so I am not able to run it neither to see your aspx and cs files.
I tried to reproduce this but I was not able to. I followed a quite similar scenario with different grids in different views. When I triggered a postback I was able to get reference to grids from all views - regardless active or inactive.
Please provide your whole sample that I would be able run or provide more details on your scenario so that I could be able to reproduce it on my side. Looking forward to hearing from you.
Hi Hristo,I'm sorry to attached a wrong file. here's the one .Thanks!
Thank you for this attachment. I was able to see your scenario and duplicate the issue. I believe it is better to take reference to the control from the WebTab1 control, since it is their parent. I have slightly modified the code inside BindData() to get around the NullReferenceException that was occurring there.
Please test it on your side and let me know if it works ok for you.
Hi Hristo ,
I'm sorry that what should I actually modify in my code in order to take reference to the control from the WebTab1?
I tried to set breakpoint in BindData() and watched WebTab1.Controls[0].Controls[0].Controls , but its empty... the grid is missing.
Hi Edgar,
Did you try to get it just as in my sample ? It runs and words as you expect I hope. Please review it and let me know if my sample works ok when you do a postback on your machine. I believe it should as I tested this, so please try it and let me know the result.
Looking forward to hearing from you.
m..sorry, am I suppose to see an attached sample in your reply? I can't see any attachment
Oh, sorry I didn't notice uploading attachment has failed. Please find the sample below.
I could reference the webTabGrid now after trying to reference once in BindData().
Thank you!