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

Updated (etc.) commands not firing in sharepoint

4 Answers 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Evlo
Top achievements
Rank 1
Evlo asked on 09 Dec 2010, 03:47 PM
Hello,

My problem is that commands like itemupdated are not firing when i add radgrid to sharepoint 2007 (wss3).

I have searched forums and did my own attempts to fix this issue, but without success. For example i tried adding and setting radajax manager, but it still did not fix the issue.

Here is very simple example webpart code where itemupdated, nor ittemcommand events are not firing.

using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
 
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
 
using Telerik.Web.UI;
 
using System.Collections.Generic;
 
using Evlo.SPBase;
using System.Data;
 
 
namespace Evlo.Faktury.WebParts
{
    [Guid("93f15f95-ec1f-4564-9763-dd8599edaef6")]
    public class TSWPRadGridTest : System.Web.UI.WebControls.WebParts.WebPart
    {
        public TSWPRadGridTest()
        {
        }
 
        public RadGrid testGrid = new RadGrid();
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            testGrid.NeedDataSource += new GridNeedDataSourceEventHandler(polozkyFakturyGrid_NeedDataSource);
 
            testGrid.UpdateCommand += new GridCommandEventHandler(testGrid_UpdateCommand);
            testGrid.EditCommand += new GridCommandEventHandler(testGrid_EditCommand);
            testGrid.ItemCommand += new GridCommandEventHandler(testGrid_ItemCommand);
        }
 
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
 
             
            testGrid.ID = "testovaciGrid";
            testGrid.AutoGenerateColumns = false;
            testGrid.MasterTableView.EditMode = GridEditMode.InPlace;
 
             
 
            using (SPSite site = new SPSite(SPContext.Current.Site.ID))
            {
                using (SPWeb web = site.OpenWeb(SPContext.Current.Web.ID))
                {
                    testGrid.Columns.Add(new GridBoundColumn
                    {
                        HeaderText = "Testovaci polozka",
                        DataField = "TestovaciField"
                    });
 
                    testGrid.Columns.Add(new GridEditCommandColumn
                    {
                        HeaderText = "Upravit",
                        ButtonType = GridButtonColumnType.LinkButton
                    });
                }
            }
 
            this.Controls.Add(testGrid);
        }
 
        void testGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
            //e.CommandName
            //throw new NotImplementedException();
        }
 
        void testGrid_EditCommand(object sender, GridCommandEventArgs e)
        {
            //throw new NotImplementedException();
        }
 
        void testGrid_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            //throw new NotImplementedException();
        }
 
        void polozkyFakturyGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            DataTable dataTable=new DataTable("testGridDataTable");
 
            DataColumn dc1 = new DataColumn("TestovaciField", System.Type.GetType("System.String"));
            dataTable.Columns.Add(dc1);
 
            DataRow dr1 = dataTable.NewRow();
            dr1["TestovaciField"] = "Test1";
 
            dataTable.Rows.Add(dr1);
 
            RadGrid testGrid = (RadGrid)sender;
            testGrid.DataSource = dataTable;
        }
    }
}

Thank you very much for your help.

4 Answers, 1 is accepted

Sort by
0
Evlo
Top achievements
Rank 1
answered on 10 Dec 2010, 09:29 AM
Anybody?
0
Tsvetoslav
Telerik team
answered on 13 Dec 2010, 01:47 PM
Hi Evlo,

You need to closely follow the guidelines in the following help article in order to get your web-part working under MOSS 2007:
http://www.telerik.com/help/aspnet-ajax/create-ajax-enabled-sharepoint-webpart-radcontrols.html

Best wishes,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Evlo
Top achievements
Rank 1
answered on 13 Dec 2010, 01:56 PM
I ried adding codes described in article in your link to my webpart without success. It is however possible that i did something wrong - i think that best in this case would be if you can please create working example of grid with where update command actually work, since i really can't find where can be the problem.

Thank you.
0
Tsvetoslav
Telerik team
answered on 14 Dec 2010, 02:35 PM
Hi Evlo,

I could not see from your code the guidelines in the help article having been implemented. Please, open up a formal support ticket and send your files for inspection.

All the best,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Evlo
Top achievements
Rank 1
Answers by
Evlo
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or