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

Batch Edit RadGrid.EditItems on Save

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 21 Jan 2015, 10:42 PM
I have a grid as follows. EditMode=Batch, AllowMultiRowSelection, AllowMultiRowEdit = true

<telerik:RadGrid ID="RadGrid1" runat="server" ClientSettings-Selecting-AllowRowSelect="true" AutoGenerateColumns="False" AllowMultiRowSelection="true" OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowEdit="true">
       <MasterTableView EditMode="Batch" DataKeyNames="Discipline_ID" CommandItemDisplay="Top">
           <BatchEditingSettings EditType="Row" OpenEditingEvent="DblClick" />
           <CommandItemTemplate>
               <asp:ImageButton ID="Button_Save" runat="server" ToolTip="Save" ImageUrl="~/dhtmlx/imgs/save.png" Height="20" Width="20" style="padding:5px 0 0 5px;" OnClick="Button_Save_Click" />   
           </CommandItemTemplate>
           <Columns>
               <telerik:GridBoundColumn DataField="Discipline_ID" Display="false" UniqueName="Discipline_ID"></telerik:GridBoundColumn>
               <telerik:GridClientSelectColumn UniqueName="SelectCheckBox" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"></telerik:GridClientSelectColumn>
               <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name" AllowSorting="true"></telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description" AllowSorting="true"></telerik:GridBoundColumn>
           </Columns>
       </MasterTableView>
   </telerik:RadGrid>


When I click the save button in the CommandItemTemplate it fires this event:

protected void Button_Save_Click(object sender, ImageClickEventArgs e)
    {
        foreach (GridDataItem item in RadGrid1.EditItems)
        {
            Hashtable newValues = new Hashtable();
            item.OwnerTableView.ExtractValuesFromItem(newValues, item);
        }
    }


When I try to update the items that have been edited in the grid the RadGrid1.EditItems.Count is always 0.

Why aren't the items that I have edited marked as edited when I try to save them?

Thanks





















1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 23 Jan 2015, 08:02 AM
Hi Kevin,

Can you please refer to the answer in the support ticket that you have opened on the same matter (Ticket ID: 899475).

If any further assistance is needed, I could suggest that we continue the communication in the ticket.



Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or