IsChecked is not working

7 posts, 0 answers
  1. naveen
    naveen avatar
    6 posts
    Member since:
    May 2009

    Posted 17 Jun 2009 Link to this post

    Silverlight Version installed  - Silverlight 3.0 Beta.

    Hi,
    I want to make context menu mutually exclusive checkable, however if i checked one item other item is not becoming unchekced. I am using following function to unchecked other items

     

     

    private void UnCheckedOtherItems(RadMenuItem selectedItem)

     

    {

     

    for (var i = 0; i < itemMenu.Items.Count; i++)

     

    {

     

    var container = itemMenu.ItemContainerGenerator.ContainerFromIndex(i) ?? itemMenu.Items[i];

     

     

    var separator = container as RadSeparator;

     

     

    if (separator != null)

     

    {

     

    continue;

     

    }

     

    var subItem = container as RadMenuItem;

     

     

    if (subItem != null && subItem.Equals(selectedItem))

     

    {

    subItem.IsChecked =

    false;

     

    }

    }

    }

    Your help will be highly appreciated.

    Regards
    ncv

  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 18 Jun 2009 Link to this post

    Hello ncv,

    I prepared a simple example demonstrating the best way to create "radio-button" menu items. It uses a ViewModel that contains the logic for the radio buttons and the groups, and a RadMenu that is data-bound to that model. The application is Silverlight 2, but the code should be exactly the same in Silverlight 3, so I hope you will not have problems using it.

    All the best,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. naveen
    naveen avatar
    6 posts
    Member since:
    May 2009

    Posted 18 Jun 2009 Link to this post

    Thanks Valeri,

    Samples is running fine for both Checkbox and Radio Button Options, however I have seen some issue with Radio buttons items which was my exact requirement. E.g. Suppose I click  at Radio Button 1.1. and after that I click at Radio Button 1.2, First clicked item is not showing unchecked i.e. still checked. It refresh when I focus in Radio Button 1.1.

    Can you please suggest me the way to resolve it.

    Regards
    NCV
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 18 Jun 2009 Link to this post

    Hello NCV,

    If I understand correctly, the behavior you are observing could be related to a bug in Silverlight 3 Beta. Unfortunately I only have a virtual machine with an unofficial build of Silverlight 3 from Microsoft and it will take some time to prepare a VM with the public beta to check if it has the same problem. I shot a short movie on my existing VM, please let me know if I am missing something.

    Regards,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. naveen
    naveen avatar
    6 posts
    Member since:
    May 2009

    Posted 19 Jun 2009 Link to this post

    Yes Valeri,

    You are right, it could be bug in silverlight 3. Right now I m using Version 3.0.40307.0.

    In your demo the working of radio button is woriking perfectly, however in my case it is not.

    Now what you suggest?

    Regards
    NCV
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 19 Jun 2009 Link to this post

    Hi NCV,

    I will check what's wrong with the menu and if it can be fixed, I will include the fix in the internal build next week. However, I would recommend waiting for the official release of Silverlight 3 that is scheduled for July 10:
    http://blogs.zdnet.com/microsoft/?p=2912

    Best wishes,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. naveen
    naveen avatar
    6 posts
    Member since:
    May 2009

    Posted 19 Jun 2009 Link to this post

    Thanks Valeri,

     

    Nice to hear from your about Silverlight 3.0 Release.

     

    Regards

    NCV

     

     

Back to Top
DevCraft banner