+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / RadGrid Insert, Update, Delete events not firing

RadGrid Insert, Update, Delete events not firing

28 posts, 0 answered
  1. Bryan
    Bryan avatar
    62 posts
    Registered:
    20 Jul 2010
    03 Nov 2010
    Link to this post
    I have created a custom module (using JobsModule as a guide) and have successfully installed and configured it. The module page extends SimpleView.

    I am working on developing some functionality using a RadGrid. The page loads fine.  I am able put the grid into insert mode using:

            protected void AddButton_Command(object sender, CommandEventArgs e)
            {
                EmployeesGrid.MasterTableView.InsertItem();
            }

    This displays a simple insert form in the RadGrid but when I submit the form the InsertCommand handler does not get called.  Here is my InitializeControls code:

    protected override void InitializeControls(GenericContainer container)
    {
        this.EmployeesGrid.NeedDataSource += new GridNeedDataSourceEventHandler(EmployeesGrid_NeedDataSource);
        this.EmployeesGrid.ItemDataBound += new GridItemEventHandler(EmployeesGrid_ItemDataBound);
        this.EmployeesGrid.InsertCommand += new GridCommandEventHandler(EmployeesGrid_InsertCommand);
        this.EmployeesGrid.UpdateCommand += new GridCommandEventHandler(EmployeesGrid_UpdateCommand);
        this.EmployeesGrid.DeleteCommand += new GridCommandEventHandler(EmployeesGrid_DeleteCommand);
        this.AddButton.Command += new CommandEventHandler(AddButton_Command);
    }

    And my getter for the RadGrid:

    private RadGrid employeesGrid;
    protected virtual RadGrid EmployeesGrid
    {
        get
        {
            if (employeesGrid == null)
                employeesGrid = base.Container.GetControl<RadGrid>("EmployeesGrid", true);
            return employeesGrid;
        }
    }

    And my ASCX code:

            <telerik:RadGrid id="EmployeesGrid" AllowSorting="true" PageSize="20" AllowPaging="true"
                AllowMultiRowSelection="false" runat="server" Gridlines="None"
                AutoGenerateColumns="False" Width="97%" ShowStatusBar="True">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <MasterTableView AutoGenerateColumns="False" Summary="Employees">
                    <CommandItemSettings AddNewRecordText="Add Photo" RefreshText="Refresh"
                     ShowAddNewRecordButton="true" ShowRefreshButton="true" />
                    <Columns>
    [...]
     
                    </Columns>
                    <EditFormSettings>
                        <EditColumn ButtonType="ImageButton" />
                    </EditFormSettings>
                </MasterTableView>
            </telerik:RadGrid>

    I did not include my command handler code since the code is not even getting called.

    Thanks in advance for your help.

    Bryan

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    03 Nov 2010
    Link to this post
    Hello Bryan,

    There are issues with the RadGrid control commands in Sitefinity 4.0 BETA and BETA2 release. Please take a look at this post for more detailed information.

    All the best,
    Ivan Dimitrov
    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. Bryan
    Bryan avatar
    62 posts
    Registered:
    20 Jul 2010
    03 Nov 2010
    Link to this post
    Does this apply to GridView and DataGrid controls too?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    04 Nov 2010
    Link to this post
    Hello Bryan,

    There should not be an issue if you use GridView control

    sample

    <asp:GridView runat="server" ID="GridView1"  allowpaging="true" PageSize="10" autogeneratecolumns="false" AutoGenerateDeleteButton="True" >
      <columns>
       <asp:buttonfield buttontype="Link" commandname="Add" text="Add"/>
       <asp:boundfield datafield="_title" headertext="title"/>
       <asp:boundfield datafield="_name" headertext="name"/>
      </columns>
    </asp:GridView>


    cs

    public partial class ButtonControl : System.Web.UI.UserControl
       {
           protected void Page_Load(object sender, EventArgs e)
           {
     
               GridView1.RowCommand += new GridViewCommandEventHandler(GridView1_RowCommand);
               GridView1.RowDeleting += new GridViewDeleteEventHandler(GridView1_RowDeleting);
               GridView1.DataSource = GetDataSource();
               GridView1.DataBind();
     
           }
     
           void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
           {
               
           }
     
           void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
           {
                
           }
     
           public IList<TestSource> GetDataSource()
           {
     
               var list =  new List<TestSource>();
     
               for (int i=0; i < 100; i++)
               {
                   var s = "name" + i;
                   var t = "title" + i;
                   list.Add(new TestSource(t, s));
               }
               return list;
           }
          
     
       }
     
     
       public class TestSource
       {
           public TestSource(string title, string name)
           {
               _title = title;
               _name = name;
           }
     
           public string _title
           {
               get;
               set;
           }
     
           public string _name
           {
               get;
               set;
           }
     
       }


    Regards,
    Ivan Dimitrov
    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
  5. Le Corbu
    Le Corbu avatar
    16 posts
    Registered:
    27 Apr 2006
    24 Nov 2010
    Link to this post
    Hi,

    this issue isn't solved?

    I still can't get Insert, update events firing in Release candidate.

    Any idea how to solve?

    thanks
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    24 Nov 2010
    Link to this post
    Hello,

    The problem with the RadGrid is not fixed in the RC. The problem is not in the RadGrid control and it comes from our code. Unfortunately we have to fix this in our code and there is no workaround t the issues. I will try to escalate the issue with higher priority so it will get included in the next build.

    All the best,
    Ivan Dimitrov
    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
  7. CRanaboldo
    CRanaboldo avatar
    18 posts
    Registered:
    09 Jul 2007
    16 Jan 2011
    Link to this post
    16/01/2011 This is still the case in final version - This is a MAJOR problem. 
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Jan 2011
    Link to this post
    Hello CRanaboldo,

    The issue still occurs if you bind the control on the server. If you use client side binding and WCF there should not be a problem to subscribe for the events.

    All the best,
    Ivan Dimitrov
    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
  9. CRanaboldo
    CRanaboldo avatar
    18 posts
    Registered:
    09 Jul 2007
    17 Jan 2011
    Link to this post
    Dear Ivan

    Thanks, I understand, when will server side be fixed?  Do you have an example of the approach that you suggested - client side binding and WCF - for me to use as a template

    Many thanks

    Charles
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Jan 2011
    Link to this post
    Hello,

    Here is a a link that shows how to bind the RadGrid to WCF. This links shows how to bind the control with client side binding.

    If you want to bind the content items you can use ItemsGrid control.

    Kind regards,
    Ivan Dimitrov
    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
  11. JOHN STRUCHYNSKI
    JOHN STRUCHYNSKI avatar
    14 posts
    Registered:
    30 May 2008
    31 Jan 2011
    Link to this post
    Hello,

    When will the issue of not registering insert, update and cancel events commands be fixed in Sitefinity 4.0?
    Thanks!
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    01 Feb 2011
    Link to this post
    Hello,

    We started working on this and we made progress, but we will need some more time. It turns out that the problem is also related to the ViewState and it will require to change some basics. I hope that we will manage to provide a fix within the next few weeks with one of our internal builds.

    Best wishes,
    Ivan Dimitrov
    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
  13. Ian
    Ian avatar
    1 posts
    Registered:
    08 Apr 2009
    25 Mar 2011
    Link to this post
    I am having this issue in the 2011 Q1 release. I am just evaluating the quality Telerik so am not familiar with the controls. Is this issue fixed? Hopefully it is just something I am doing. I have used the markup and code from the demo site in my own project but still get the issue.

    Any feedback would be appreciated.
  14. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    28 Mar 2011
    Link to this post
    Hello Ian,

    the problem you are talking about is going to be fixed in 2011 Q1 release of Sitefinity, which is due to be released on April 13th. The issue is not related to Telerik RadControls for ASP.NET Ajax, but rather to Sitefinity.

    We have resolved the issue already and we are now in the process of testing the implementation.

    Regards,
    Ivan
    the Telerik team
  15. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    07 Apr 2011
    Link to this post
    Woohoo! can't wait!
  16. CRanaboldo
    CRanaboldo avatar
    18 posts
    Registered:
    09 Jul 2007
    13 Apr 2011
    Link to this post
    No sign of Q1 today, when is it going to be released?
  17. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    15 Apr 2011
    Link to this post
    Hello CRanaboldo,

    We have an official statement here - http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/sitefinity-2011-q1-postponed-by-one-week.aspx

    All the best,
    Georgi
    the Telerik team

  18. RobertZ121
    RobertZ121 avatar
    64 posts
    Registered:
    14 Aug 2006
    19 Apr 2011
    Link to this post
    Hi all,

    the new SF version 4.1 is rolled out, but as I can see, the problem with firing updates of grids within a sitefinity application is not solved.

    I built a user control with a simple table that performs inserts, updates and deletes. - After then I integrated it into the toolbox as widget. - It appears at the page, you can do sort and so on, but NO update ......

    To check if I would be wrong I made an empty webform outside of sitefinity, linked my user control into this test page and: it updates !!!!! Surprise !!!

    So does anybody know why this does not perform in SF projects ?????

    Regards, Robert
  19. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    20 Apr 2011
    Link to this post
    Did you change the layouttemplatename and layouttemplatepath + add virtual paths according to slavo's post?
    If not, you are still using the old sitefinity parser



  20. Jim
    Jim avatar
    22 posts
    Registered:
    09 Sep 2010
    28 Apr 2011
    Link to this post
    Has anyone figured this problem out yet?  I am experiencing issues with RadGrid updates/deletes when used in Sitefinity 4.1.  I have a ticket open with Telerik right now, but the "progress" has been slow.  This is a major showstopper for me.  If anyone has any ideas, it would be extremely helpful to me.
  21. RobertZ121
    RobertZ121 avatar
    64 posts
    Registered:
    14 Aug 2006
    28 Apr 2011
    Link to this post
    Hello Jim,

    I got a tip to make the page Viewstate = active.

    Since I did it, my radgrids are firing inserts, updates and deletes ...

    May it be also helpful to you.

    Regards, robert
  22. Jim
    Jim avatar
    22 posts
    Registered:
    09 Sep 2010
    28 Apr 2011
    Link to this post
    Robert,

    Thanks for the reply.  I received the same tip from Telerik, but they told me to enable the viewstate on the grid as well.  I tried that and am still having the problem.  Are you using the ItemCommand event to handle your processing, or are you using the UpdateCommand, DeleteCommand, etc?

    Thanks,
    Jim
  23. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    28 Apr 2011
    Link to this post
    I use ItemCommand on mine at it works ok, just check for the commandname being sent in

    if

     

     

    (e.CommandName == "Delete")

     

  24. RobertZ121
    RobertZ121 avatar
    64 posts
    Registered:
    14 Aug 2006
    28 Apr 2011
    Link to this post
    @Jim

    I made a SF 4.1. test-website, there you can see how i used it. - I have a developer license for TELERIK RADtools ASP.NET AJAX made an .ASCX and embedded this into this page:

    http://sf41.zehetleitner.at/vis111 

    Regards, Robert
  25. Jim
    Jim avatar
    22 posts
    Registered:
    09 Sep 2010
    28 Apr 2011
    Link to this post
    @Robert

    Robert - would it be possible for you to zip up the actual ASCX file that you created so I could look at that?  Obviously, yours works, but mine doesn't.  All I can see by the link that you posted is the page source, not the control source.

    Thanks for the help,
    Jim
  26. RobertZ121
    RobertZ121 avatar
    64 posts
    Registered:
    14 Aug 2006
    28 Apr 2011
    Link to this post
    @Jim:

    as in this wonderful forum we cannot attach a zip-file I put it onto my page: http://sf41.zehetleitner.at/vis111 and you can download it from there. - Screenshot attached. remarks: there were also problems to open it with Safari 5.05 so please try to use MS IE.

    Enjoy your grid .... ;-))

    Regards, Robert
  27. Jim
    Jim avatar
    22 posts
    Registered:
    09 Sep 2010
    06 May 2011
    Link to this post
    @Robert:

    Thanks for your help on this.  I found the problem, but not sure how to fix.  It has something to do with my development machine.  I have been working with Telerik (Ivan) on this for the last few days.  He supplied a fresh project that had a grid in a user control.  I tried to run it on my machine and it failed.  I tried to run it on another machine, and it also failed (copied the project from my machine to the other).  Then I tried running it on a colleague's machine and it worked perfectly.  The difference was the code never touched my machine.  I don't understand what causes it or why it happens, but it would seem that any code generated on my machine is somehow "infected" with the issue.  I don't know if it is a DLL version issue, windows patch, or what.  I don't even know where to begin in finding the root cause.  If you have any ideas or suggestions, I would be very grateful.

    Jim
  28. CRanaboldo
    CRanaboldo avatar
    18 posts
    Registered:
    09 Jul 2007
    12 May 2011
    Link to this post
    Dear All 

    I have now tested grids, and many other RAD Ajax controls in SF 4.1. Provided you follow  Salvo's post  and set 
     enable Viewstate under advanced options for each backend page, they all work fine.  

    Best wishes

    Charles
28 posts, 0 answered