RadGrid Insert, Update, Delete events not firing

Posted by Community Admin on 03-Aug-2018 18:32

RadGrid Insert, Update, Delete events not firing

All Replies

Posted by Community Admin on 03-Nov-2010 00:00

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

Posted by Community Admin on 03-Nov-2010 00:00

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

Posted by Community Admin on 03-Nov-2010 00:00

Does this apply to GridView and DataGrid controls too?

Posted by Community Admin on 04-Nov-2010 00:00

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

Posted by Community Admin on 24-Nov-2010 00:00

Hi,

this issue isn't solved?

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

Any idea how to solve?

thanks

Posted by Community Admin on 24-Nov-2010 00:00

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

Posted by Community Admin on 16-Jan-2011 00:00

16/01/2011 This is still the case in final version - This is a MAJOR problem. 

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 31-Jan-2011 00:00

Hello,

When will the issue of not registering insert, update and cancel events commands be fixed in Sitefinity 4.0?
Thanks!

Posted by Community Admin on 01-Feb-2011 00:00

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

Posted by Community Admin on 25-Mar-2011 00:00

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.

Posted by Community Admin on 28-Mar-2011 00:00

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

Posted by Community Admin on 07-Apr-2011 00:00

Woohoo! can't wait!

Posted by Community Admin on 13-Apr-2011 00:00

No sign of Q1 today, when is it going to be released?

Posted by Community Admin on 15-Apr-2011 00:00

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

Posted by Community Admin on 19-Apr-2011 00:00

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

Posted by Community Admin on 20-Apr-2011 00:00

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



Posted by Community Admin on 28-Apr-2011 00:00

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.

Posted by Community Admin on 28-Apr-2011 00:00

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

Posted by Community Admin on 28-Apr-2011 00:00

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

Posted by Community Admin on 28-Apr-2011 00:00

I use ItemCommand on mine at it works ok, just check for the commandname being sent in

if

 

 

(e.CommandName == "Delete")

 

Posted by Community Admin on 28-Apr-2011 00:00

@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

Posted by Community Admin on 28-Apr-2011 00:00

@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

Posted by Community Admin on 28-Apr-2011 00:00

@Jim:

as in this wonderful forum we cannot attach a zip-file I put it onto my page: 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

Posted by Community Admin on 06-May-2011 00:00

@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

Posted by Community Admin on 12-May-2011 00:00

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

This thread is closed