error on griedview

2 posts, 0 answers
  1. Ij
    Ij avatar
    1 posts
    Member since:
    Dec 2014

    Posted 29 Dec 2014 Link to this post

    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?



  2. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 30 Dec 2014 Link to this post

    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.

     
Back to Top