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.
Thank you very much for your help.
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.