Hi,
I'm trying to use pageview backstage mode in my multi-threading application, but I always get the following error:
"Object reference not set to an instance of an object"
Basically, I create a new thread and in that thread I am trying to make a specific item button and the related page selected. Below is the code:
Is it because I call the pageview control in a thread-unsafe way? How can I get rid of that error?
Thanks in advance!
I'm trying to use pageview backstage mode in my multi-threading application, but I always get the following error:
"Object reference not set to an instance of an object"
Basically, I create a new thread and in that thread I am trying to make a specific item button and the related page selected. Below is the code:
Dim CurrentTask As Integer = 1
Dim backStageElement As RadPageViewBackstageElement
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Control.CheckForIllegalCrossThreadCalls = False
Dim checkcurrenttaskthread As New Threading.Thread(AddressOf checkcurrenttask)
checkcurrenttaskthread.Start()
End Sub
Public Sub checkcurrenttask()
While True
If CurrentTask = 1 Then
backStageElement =
TryCast(RadPageView1.ViewElement, RadPageViewBackstageElement)
backStageElement.Items(0).IsSelected = True
RadPageView1.SelectedPage = RadPageView1.Pages(0)
End If
End While
End Sub
Is it because I call the pageview control in a thread-unsafe way? How can I get rid of that error?
Thanks in advance!