Avoid grid selection changed event.

5 posts, 0 answers
  1. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 23 Jan 2012 Link to this post

    Hi All,

                 I'm having one image template column in gridview. Gridview has a selection changed event.
    When user clicks on any image in image template column. that time gridview selection changed event is firing.
    In that case i want avoid gridview selection event call.

    Somehow i'm trying to avoid that event for those two template columns in grid but its not working perfectly.
    Check the below code.
    private void radGridTaskBundles_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
            {
                if ((((Telerik.Windows.Controls.GridView.GridViewDataControl)(e.OriginalSource)).CurrentColumn) != null)
                {
                    if (((((Telerik.Windows.Controls.GridView.GridViewDataControl)(e.OriginalSource)).CurrentColumn).Header).ToString() != "Diseases")
                    {
                        if (((((Telerik.Windows.Controls.GridView.GridViewDataControl)(e.OriginalSource)).CurrentColumn).Header).ToString() != "Measures")
                        {
     
                            //   MessageBox.Show("Row Selected");
                        }
                        else
                            return;
                    }
                    else
                        return;
                }


    Please find attached screenshot for more information.


    Thanks & Regards
    Rahul
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 24 Jan 2012 Link to this post

    Hello Rahul,

    You can work with SelectionChanging event instead and cancel it when required (through e.Cancel=true;). 

    All the best,
    Maya
    the Telerik team

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

  3. DevCraft banner
  4. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 24 Jan 2012 Link to this post

    Hi Maya,

                I'm not much familiar with RadGridView. Can u give me some sample
    application for described issue.

    Thanks in Advance

    Regards
    Rahul
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 24 Jan 2012 Link to this post

    Hi Rahul,

    I would recommend you to run through our online documentation and demos for a reference. Considering Selection functionality of the grid, you can find more information in this section.  

    Kind regards,
    Maya
    the Telerik team

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

  6. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 24 Jan 2012 Link to this post

    Hello Maya,

                Thanks for reply. I'll work on it.

    Regards
    Rahul
Back to Top
DevCraft banner