RadGrid Insert, Update, Delete events not firing - General Discussions - General Discussions - Progress Community
 General Discussions

RadGrid Insert, Update, Delete events not firing

  • RadGrid Insert, Update, Delete events not firing
  • 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

  • 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
  • Does this apply to GridView and DataGrid controls too?
  • 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
  • Hi,

    this issue isn't solved?

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

    Any idea how to solve?

    thanks
  • 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
  • 16/01/2011 This is still the case in final version - This is a MAJOR problem. 
  • 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
  • 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
  • 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
  • Hello,

    When will the issue of not registering insert, update and cancel events commands be fixed in Sitefinity 4.0?
    Thanks!
  • 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
  • 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.
  • 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