This is a migrated thread and some comments may be shown as answers.

Avoid grid selection changed event.

4 Answers 126 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 2
Rahul asked on 24 Jan 2012, 05:22 AM
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

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 24 Jan 2012, 07:17 AM
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 >>

0
Rahul
Top achievements
Rank 2
answered on 24 Jan 2012, 07:56 AM
Hi Maya,

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

Thanks in Advance

Regards
Rahul
0
Maya
Telerik team
answered on 24 Jan 2012, 08:01 AM
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 >>

0
Rahul
Top achievements
Rank 2
answered on 24 Jan 2012, 08:16 AM
Hello Maya,

            Thanks for reply. I'll work on it.

Regards
Rahul
Tags
GridView
Asked by
Rahul
Top achievements
Rank 2
Answers by
Maya
Telerik team
Rahul
Top achievements
Rank 2
Share this question
or