RadPageView didn't release the previous page selection.

3 posts, 0 answers
  1. Johnny
    Johnny avatar
    86 posts
    Member since:
    Dec 2010

    Posted 16 Jun 2011 Link to this post

    Hi!
    Im using VB.NET and had created a RadPageView with 2 page.

    1st page call = A
    2nd page call = B

    When first time load A is an default selected page.
    When i click on page B it will do checking either file is exist.
    if not exist than msgbox will popup and use code to select back the page A

    Display page of A is correct but the B button is still in selected mode.
    Mean i can see 2 page is selected.

    My viewmode for the RadPageVIew is STACK

    Hope to get the reply soon.

    Thank you!

    Regards
    Johnny
  2. Jasenko
    Jasenko avatar
    3 posts
    Member since:
    Sep 2010

    Posted 17 Jun 2011 Link to this post

    Hi,

    I just had the exact same problem, and after fiddling with it for a while I found a really awful workaround.

    If the page whose button is still selected is called "radpageviewpage1", this code will fix it.

    radpageviewpage1.enabled = false
    radpageviewpage1.enabled = true

    That's it.  Just disable and re-enable.

    Good luck.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 21 Jun 2011 Link to this post

    Hello everyone,

    Thank you for writing.

    The reported behavior is a known issue of RadPageView. This issue is already logged into our PITS system and it will be addressed in a future release. Feel free to follow this link, where you can add your vote for this issue and also subscribe for its status updates.

    Meanwhile, you can work around this issue by setting its VisualState as shown in the following example:

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
           
            radPageView1.SelectedPageChanging += new EventHandler<Telerik.WinControls.UI.RadPageViewCancelEventArgs>(radPageView1_SelectedPageChanging);
            radPageViewPage2.Item.MouseLeave += new EventHandler(Item_MouseLeave);
        }
     
        void Item_MouseLeave(object sender, EventArgs e)
        {
            RadPageViewStackItem item = sender as RadPageViewStackItem;
            if (item.IsSelected == false)
            {
                item.VisualState = "RadPageViewStackItem";
            }
        }
     
        void radPageView1_SelectedPageChanging(object sender, Telerik.WinControls.UI.RadPageViewCancelEventArgs e)
        {
            if (e.Page == radPageViewPage2 && RadMessageBox.Show("", "", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.No)
            {
                e.Cancel = true;
                e.Page.Item.VisualState = "RadPageViewStackItem";
            }
        }

    I hope you find this information helpful. Should you have any other questions, do not hesitate to contact us.
     
    Regards,
    Stefan
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Back to Top