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)
Public Sub checkcurrenttask()
If CurrentTask = 1 Then
backStageElement.Items(0).IsSelected = True
RadPageView1.SelectedPage = RadPageView1.Pages(0)
Is it because I call the pageview control in a thread-unsafe way? How can I get rid of that error?
Thanks in advance!