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

error on griedview

1 Answer 126 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ij
Top achievements
Rank 1
Ij asked on 30 Dec 2014, 02:49 AM
hi, i'm new with telerik and i need some help
i have some error when i try to build my application
the error is...

--Cannot implicitly convert type 'System.ComponentModel.CancelEventHandler' to 'Telerik.WinControls.UI.GridViewSelectionCancelEventHandler'

this is some of my code

             this.cxGrid2.TabIndex = 0;
            this.cxGrid2.Text = "radGridView1";
            this.cxGrid2.SelectionChanging += new System.ComponentModel.CancelEventHandler(this.cxGrid2_SelectionChanging);
            this.cxGrid2.RowsChanging += new Telerik.WinControls.UI.GridViewCollectionChangingEventHandler(this.cxGrid2_RowsChanging);


 private void cxGrid2_SelectionChanging(object sender, CancelEventArgs e)
        {
            
            SetEdit(false);
        }

can someone help me how to fix this error?



1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 Dec 2014, 02:02 PM
Hello Ij,

Thank you for writing.

Change this line of code:
this.cxGrid2.SelectionChanging += new System.ComponentModel.CancelEventHandler(this.cxGrid2_SelectionChanging);

to either this:
this.cxGrid2.SelectionChanging += new Telerik.WinControls.UI.GridViewSelectionCancelEventArgs(this.cxGrid2_SelectionChanging);

or this:
radGridView1.SelectionChanging+=radGridView1_SelectionChanging;

More information about subscribing to events is available here: http://msdn.microsoft.com/en-us/library/ms366768.aspx.

I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Ij
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or