How to clear Selected Items in the RadGrid...

8 posts, 0 answers
  1. mark
    mark avatar
    50 posts
    Member since:
    Mar 2009

    Posted 16 Mar 2010 Link to this post

    I know this should be simple and it's probably a stupid question, but I have a button called "Reset".  When the user clicks it, I would like the radgrid to show that 0 Rows are selected.  I've tried:

    radgridFeatures.UnselectAll();
    radgridFeatures.SelectedItems.Clear();
    radgridFeatures.SelectedItem = null;
    radgridFeatures.UpdateLayout();
    radgridFeatures.CurrentItem = null;

    But there is still 1 item selected in the RadGrid.  I am using the latest build(2010).  What am I missing?

    Thank you very much.


  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 17 Mar 2010 Link to this post

    Hi mark,

    radgridFeatures.SelectedItems.Clear(); should do the trick. If there is indeed one selected item after that it would be really helpful to take a look at your application since we cannot reproduce the problem.


    All the best,
    Milan
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. mark baer
    mark baer avatar
    142 posts
    Member since:
    Sep 2009

    Posted 17 Mar 2010 Link to this post

    I opened support Ticket:  291315 and uploaded my project there.

    Thanks

    Mark
  4. M
    M avatar
    3 posts
    Member since:
    Dec 2010

    Posted 25 Feb 2011 Link to this post

    For the record, the line is :

    radgridFeatures.SelectedIndexes.Clear();
    

    The SelectedItems property does not have a Clear() method.
  5. DaveBarkshire
    DaveBarkshire avatar
    9 posts
    Member since:
    May 2012

    Posted 28 May 2012 Link to this post

    I'm having the same problem and don't know if there is some confusion over terminology. Does 'selected' mean 'in edit mode'?

    I have a row which has had the row update button clicked so that it is in edit mode. If I then change the sql with a button on the form and rebind the grid it still shows the third row as being in edit mode.

    rgdGrid.SelectedIndexes.Clear() // This does not clear it.
    rgdGrid.SelectedItems.Count // This is = 0
    rgdGrid.EditItems.Count  // This is = 1
    rgdGrid.EditItems[0].IsInEditMode // This is true (ready only property)

    I can get a handle to rgdGrid.EditItems[0] but can see no method to cancel the edit mode.

    Any ideas?

     



  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 28 May 2012 Link to this post

    Hello,

     Are you sure your question is related to RadGridView for Silverlight? 

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. DaveBarkshire
    DaveBarkshire avatar
    9 posts
    Member since:
    May 2012

    Posted 28 May 2012 Link to this post

    This is ajax asp.net

    I have found a way to get around this problem. There are a few postings about this so I hope that it will be useful for others.

     

    foreach (GridItem item in rgdGrid.MasterTableView.Items)

     

    {

     

    if (item is GridEditableItem)

     

    {

     

    GridEditableItem editableItem = item as GridDataItem;

     

    editableItem.Edit =

    false;

     

    }

    }

  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 28 May 2012 Link to this post

    Hello,

     Please use relevant forum category!

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top