This is a migrated thread and some comments may be shown as answers.
Overflow area
5 Answers 6 Views
This is a migrated thread and some comments may be shown as answers.
Kim
Top achievements
Rank 1
Kim asked on 22 Feb 2014, 01:13 AM
Hi, I want to save the state of the page view and restore it when a user logs back in.

I am trying to find out how to;

1) inspect the pageviews and determine if they are a) in the overflow area and if so b) is their button visible or hidden.

2) set the pageviews back to the state they were at in the overflow area and whether the button is hidden

Thanks,



5 Answers, 1 is accepted

Sort by
0
Kim
Top achievements
Rank 1
answered on 24 Feb 2014, 08:01 PM

I have made some progress but I am getting an "Object reference not set to an instance of an object." when i try to use outlookelement.UncheckItem,. All the objects are valid and the  OutlookElement_ItemUnchecked even fires. 

i can use the exact sameobject and call the outlookelement.CheckItem without an error.

Is this forum monitored?

Help
0
Kim
Top achievements
Rank 1
answered on 25 Feb 2014, 05:21 PM
Hello? 
0
George
Telerik team
answered on 26 Feb 2014, 03:14 PM
Hi Kim,

Thank you for writing.

Yes, the forum is monitored and although we do not guarantee that forum posts will be answered (as per our forum rules) we usually address forum posts from our customers within 72 hours.

As to your question at hand, you can get all hidden items as follows:
pageView.ViewMode = PageViewMode.Outlook;
RadPageViewOutlookElement outlookElement = pageView.ViewElement as RadPageViewOutlookElement;
RadPageViewOutlookItem[] hiddenItems = outlookElement.GetHiddenItems();

Now you can easily check which RadPageViewPage is visible and which is not:
foreach (RadPageViewPage page in pageView.Pages)
{
    bool visible = true;
    if (Array.IndexOf(hiddenItems, page) == -1)
    {
        visible = false;
    }
}

Do not hesitate to write back, should you have further questions.

Regards,
George
Telerik
0
Kim
Top achievements
Rank 1
answered on 26 Feb 2014, 03:58 PM
Thank you George.

1) What about the error I am receiving? I have everything else working but I can't manually UnCheck and Item as it throws an "Object reference not set to an instance of an object" error. If I call outlookelement.CheckItem with the same object it doesn't error.

2) Is the only way to hide a page header is call the "DragGripDown" method?




0
Peter
Telerik team
answered on 03 Mar 2014, 04:02 PM
Hello Kim,

Thank you for writing.

I have tested the described approach, but such an exception did not appear on my end.
Attached you can find the test application that I used. 

It is a long shot, but it is possible that the code called is at a place where RadPageView was not initialized yet.  Please, try to move the code at point where the RadPageView are initialized - for example on Form's Load event. If that is not the case please, modify my test project on a way to replicate the experienced exception and get back to me with it, so I can investigate the reasons causing it and provide you with further assistance.

I would like to confirm that the calling OutlookElement's DragGripDown method is correct and for the time being is only way to hide the outlook element.

Thank you for your cooperation. I am looking forward to your reply.

Regards,
Peter
Telerik
Asked by
Kim
Top achievements
Rank 1
Answers by
Kim
Top achievements
Rank 1
George
Telerik team
Peter
Telerik team
Share this question
or