odd error when i try delete row from list

3 replies. Last post: January 3, 2011 6:30 AM by Handy Surya
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

ok i got very big issue on this.

i have this code server side:

protected void grdFlowDetails_DeleteRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
if (e.Row.Type == RowType.Record)
{
if (e.Row.Table.DataMember == "parent")
{
DataRow row = e.Row.GetDataRow();
int intTemp = Convert.ToInt32(row["AppealFlowLineID"]);
Flows.Instance.DeleteFlowDetails(intTemp);
}
}
}

and the client side is this:

_openFormWindow: function (type) {
var based = this;
var url = "";
var isRootTable = true;
var selObj = based.gridObj.GetSelectedObject();
if (selObj != null && selObj.Table != undefined) {
isRootTable = selObj.Table.IsRootTable;
}
switch (type) {
case based.Config.CommandIssueActionAdd:
if (isRootTable) {
UtillObject.SetDialogBox(based.dialogObj, based.Config.Lang.AddNewFlowDetailForm);
based.dialogObj.SetContentURL(based.Config.UrlFlowDetailFormAdd);
based.dialogObj.ShowDialog();
}
break;

case based.Config.CommandIssueActionEdit:
if (isRootTable) {
UtillObject.SetDialogBox(based.dialogObj, based.Config.Lang.EditFlowDetailForm);
if (selObj != null) {
var row = selObj.GetRowObject();
var cells = row.GetCells();
var id = cells.GetNamedItem("AppealFlowLineID").Text;
if (id == null) {
alert(based.Config.Lang.FlowNotSelected);
return false;
}
based.dialogObj.SetContentURL(UtillObject.StringFormat(based.Config.UrlFlowDetailFormEdit, id));
based.dialogObj.ShowDialog();
}
else {
alert(based.Config.Lang.FlowNotSelected);
return false;
}
}
break;

case based.Config.CommandIssueActionDelete:
if (selObj != null) {
if (confirm(based.Config.Lang.AreYouSureDeleteItem)) {
based.gridObj.GetSelectedObject().GetRowObject().Delete();
}
}
else {
alert(based.Config.Lang.FlowNotSelected);
return false;
}
break;
}
}

and asp.net is this:

<ISWebGrid:WebGrid ID="grdFlowDetails" runat="server" Height="700px" UseDefaultStyle="True" 
DataMember="parent" OnAddRow="grdFlowDetails_AddRow" OnDeleteRow="grdFlowDetails_DeleteRow"
OnInitializeDataSource="grdFlowDetails_InitializeDataSource" OnRowChanged="grdFlowDetails_RowChanged"
OnUpdateRow="grdFlowDetails_UpdateRow">
<LayoutSettings AllowAddNew="Yes" AllowDelete="Yes" AllowEdit="Yes" AllowSorting="Yes" EditOnClick="false"
Hierarchical="true" CellClickAction="CellSelect" AllowContextMenu="true" AllowBatchUpdate="true">
<ClientSideEvents OnCellSelect="grdFlowDetails_OnCellSelect" OnRowSelect="grdFlowDetails_OnRowSelect" OnRowContextMenu="grdFlowDetails_OnRowContextMenu" />
</LayoutSettings>
<RootTable DataMember="parent">
<ChildTables>
<ISWebGrid:WebGridTable DataMember="child" DataKeyField="FlowDetailID">
<PreviewRowSettings DefaultExpanded="False" LoadOnDemand="True">
</PreviewRowSettings>
<Columns>
<ISWebGrid:WebGridColumn Caption="קוד" DataMember="FlowDetailID" Visible="false"
EditType="NoEdit" Name="FlowDetailID">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="שם נמען" DataMember="EmpID" DataType="System.Int32"
Name="EmpID" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="תפקיד נמען" DataMember="EmployeePositionID" DataType="System.Int32"
Name="EmployeePositionID" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="יחידה" DataMember="FactorID" DataType="System.Int32"
Name="FactorID" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="פעולה \ ידיעה" DataMember="ForAction" DataType="System.Int32"
Name="ForAction" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
</Columns>
</ISWebGrid:WebGridTable>
</ChildTables>
<Columns>
<ISWebGrid:WebGridColumn Caption="מספר" DataMember="AppealFlowLineID" DataType="System.Int32"
EditType="NoEdit" Name="AppealFlowLineID" Width="100px">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="סוג אירוע" DataMember="FlowEventTypeId" DataType="System.Int32"
Name="FlowEventTypeId" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="ימים לביצוע" DataMember="DaysToExec" DataType="System.Int32"
Name="DaysToExec" Width="100px">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="סוג מכתב" DataMember="LetterTypeId" DataType="System.Int32"
Name="LetterTypeId" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="אישור מנהל" DataMember="ManagerApproval" DataType="System.Boolean"
Name="ManagerApproval" Width="100px" ColumnType="CheckBox" EditType="Checkbox">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="שיוך מכתב ללקוח" DataMember="OtherAddressee" DataType="System.Boolean"
Name="OtherAddressee" Width="100px" ColumnType="CheckBox" EditType="Checkbox">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="עובד מטפל" DataMember="HandelingEmp" DataType="System.Int32"
Name="HandelingEmp" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="ימים להתייחסות" DataMember="DaysToAction" DataType="System.Int32"
Name="DaysToAction" Width="100px">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="שלב" DataMember="FlowStage" DataType="System.Int32"
Name="FlowStage" Width="100px" EditType="DropdownList">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="דקות להתייחסות" DataMember="MinToAction" DataType="System.Int32"
Name="MinToAction" Width="100px">
</ISWebGrid:WebGridColumn>
<ISWebGrid:WebGridColumn Caption="דקות לביצוע" DataMember="MinToExec" DataType="System.Int32"
Name="MinToExec" Width="100px">
</ISWebGrid:WebGridColumn>
</Columns>
</RootTable>
</ISWebGrid:WebGrid>



now for the problem i got error when i try do delete

that say:

element' is null or not an object

and code line is:
wg17580.m7fc47(activeCell.element,false,true);

now please help here what do i do wrong its not even go to sql (the event yet to be fire)

i kinda clue less here.

Thanks to the helpers.


All times are GMT -5. The time now is 6:39 PM.
Previous Next