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

[Solved] Rad Grid - "RowDeleting" and "RowDeleted" events not get fired

1 Answer 187 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ajay Khedekar
Top achievements
Rank 1
Ajay Khedekar asked on 07 Jan 2010, 11:18 AM

Hello,

We are using Latest Telerik dll version "2009.3.1103.35".

We have Radgrid and use Cleint side inline Row deleting functionality.

We have set "OnRowDeleting" and "OnRowDeleted" Attributes to fire respective methods.It was working fine in previous versions ,but not now.

I have read somewhere that "RowDeleted" and "RowDeleting" events are replaced by "RowChanged" and "RowChanging" events,is that true?

And if Yes, Kindly provide us demo code / Project to achive above functionality...


Code :

 

 

 

<telerik:RadGrid ID="radGridSupplierDetails" Height="250px" runat="server" GridLines="None"

 

 

 

 

 

 

PageSize="200" AutoGenerateColumns="False" EnableEmbeddedSkins="False" EnableViewState="False">

 

 

 

 

 

 

<ClientSettings EnableRowHoverStyle="true" >

 

 

 

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

 

 

 

<ClientEvents OnCommand="radGridSupplierDetails_Command" OnRowClick="RowSupplierDblClick"

 

 

 

 

 

 

OnRowDeleting="SupplierRowDeleting" OnRowDeleted="RowDeletedSupplier" OnRowMouseOver="OnRowMouseOver_radGridSupplierDetails"/>

 

 

 

 

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="false">

 

 

 

 

 

 

</Scrolling>

 

 

 

 

 

 

</ClientSettings>

 

 

 

 

 

 

<FilterMenu EnableEmbeddedSkins="False">

 

 

 

 

 

 

</FilterMenu>

 

 

 

 

 

 

<SortingSettings SortedBackColor="BurlyWood" />

 

 

 

 

 

 

<HeaderContextMenu EnableEmbeddedSkins="False">

 

 

 

 

 

 

</HeaderContextMenu>

 

 

 

 

 

 

<MasterTableView ClientDataKeyNames="No" CssClass="RadGrid_Web20" EditMode="InPlace"

 

 

 

 

 

 

TableLayout="Fixed" Width="95%">

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Serial_Number" Display="false" HeaderStyle-HorizontalAlign="Center"

 

 

 

 

 

 

HeaderText="SrNo" ItemStyle-HorizontalAlign="Center" SortExpression="Serial_Number"

 

 

 

 

 

 

UniqueName="Serial_Number">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" />

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="SupplierId" HeaderStyle-HorizontalAlign="Right"

 

 

 

 

 

 

HeaderStyle-Width="80px" HeaderText="SupplierId" ItemStyle-HorizontalAlign="Right"

 

 

 

 

 

 

Display="false" SortExpression="SupplierId">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" Width="100px" />

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="SupplierName" HeaderStyle-HorizontalAlign="Right"

 

 

 

 

 

 

HeaderStyle-Width="80px" HeaderText="Supplier" ItemStyle-HorizontalAlign="Right"

 

 

 

 

 

 

SortExpression="SupplierName">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" Width="80px" />

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="ContactName" HeaderStyle-HorizontalAlign="Right"

 

 

 

 

 

 

HeaderStyle-Width="50px" HeaderText="Contact" ItemStyle-HorizontalAlign="Right"

 

 

 

 

 

 

SortExpression="ContactName">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" Width="75px" />

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Email" HeaderStyle-HorizontalAlign="Right" HeaderStyle-Width="0px"

 

 

 

 

 

 

HeaderText="Email" ItemStyle-HorizontalAlign="Right" SortExpression="Email">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" Width="75px" />

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Address" HeaderStyle-HorizontalAlign="Right"

 

 

 

 

 

 

HeaderStyle-Width="80px" HeaderText="Address" ItemStyle-HorizontalAlign="Right"

 

 

 

 

 

 

SortExpression="Address">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" Width="80px" />

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="CommentToSupplier" HeaderStyle-HorizontalAlign="Left"

 

 

 

 

 

 

HeaderText="Comment" ItemStyle-HorizontalAlign="Left" SortExpression="CommentToSupplier">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" />

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Notes" Display="True" HeaderStyle-HorizontalAlign="Left"

 

 

 

 

 

 

HeaderText="Note" ItemStyle-HorizontalAlign="Left" SortExpression="Notes">

 

 

 

 

 

 

<HeaderStyle HorizontalAlign="Center" Width="80px"/>

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

<telerik:GridClientDeleteColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow"

 

 

 

 

 

 

ConfirmText="Are you sure you want to delete this row?" HeaderStyle-Width="25"

 

 

 

 

 

 

ImageUrl="../../Images/Delete.gif" ItemStyle-Width="25">

 

 

 

 

 

 

<HeaderStyle Width="25px" />

 

 

 

 

 

 

<ItemStyle Width="25px" />

 

 

 

 

 

 

</telerik:GridClientDeleteColumn>

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

<EditFormSettings>

 

 

 

 

 

 

<EditColumn CancelImageUrl="Cancel.gif" EditImageUrl="Edit.gif" InsertImageUrl="Update.gif"

 

 

 

 

 

 

UpdateImageUrl="Update.gif">

 

 

 

 

 

 

</EditColumn>

 

 

 

 

 

 

</EditFormSettings>

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

</telerik:RadGrid>


Functions :

 

 

 

 

// event fires after Row Deleted - Supplier Grid

 

 

 

 

 

 

function RowDeletedSupplier(sender, args) {

 

 

 

 

 

//this function is empty but its compulsory as this is a bug from telrik

 

 

 

 

 

 

//Known issue the Grid will miss a row after delete a row if this function is not defined.

 

 

 

 

 

}

 


 

 

//Delete row from grid. - Supplier Grid

 

 

 

 

 

function SupplierRowDeleting(sender, args) {

 

 

 

 

 

var editedRow = args.get_itemIndexHierarchical();

 

 

var item = args.get_gridDataItem();

 

 

var strSupplierId = "";

 

 

var objArrParts = JSON.parse(jsonStringSupplier);

 

 

var objArrPartsDeleted = ""; //To store the element which needs to be deleted.

 

 

 

 

 

 

if (item != null) {

 

strSupplierId = sender.get_masterTableView().getCellByColumnUniqueName(item,

"Serial_Number").innerHTML;

 

document.getElementById(

"<%= hdnLabelSupplierSerialNumber.ClientID%>").innerHTML = sender.get_masterTableView().getCellByColumnUniqueName(item, "Serial_Number").innerHTML;

 

}

 

for (var i = 0; i < objArrParts.length; i++) {

 

 

if ((objArrParts[i].Serial_Number) == strSupplierId) {

 

objArrPartsDeleted = objArrParts[i];

objArrParts.splice(i, 1);

}

}

jsonStringSupplier =

"";

 

jsonStringSupplier = JSON.stringify(objArrParts);

setSupplierDelete();

}


any help will be highly appreciated..

 

 

 

 

 


Thanks,
Ajay Khedekar 

 

1 Answer, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 08 Jan 2010, 04:12 PM
Hello Ajay,

I am not able to reproduce the problem you describe. You can find attached to this message a simple page which shows that the events are fired correctly. Take a look at it and let me know what I may be missing.

Sincerely yours,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Ajay Khedekar
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Share this question
or