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

GridEditCommandColumn is not working when ClientIDMode="AutoID"

2 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 24 Sep 2015, 09:19 PM

 Hi Team,

 

 In the RadGrid, I have to do drag and drop option as well as edit the row using batch edit mode. If I set the clientIDMode = "Static" while click on the edit buttonI can see the Update and Cancel button. But I cann't do drag and drop. So I changed the ClientIDMode="AutoID" now drag and drop is working fine but in edit mode the Update and Cancel button in the batch it is not displaying.

Please let me know how to resolve this issue.

 

Regards,

Rajesh

 

 

<telerik:RadGrid ID="Parts" runat="server" ClientIDMode="AutoID" AllowPaging="True" AllowSorting="True" ClientSettings-AllowAutoScrollOnDragDrop="true"
AutoGenerateColumns="False" GridLines="None" ShowStatusBar="True" CssClass="Parts" ClientSettings-AllowDragToGroup="true" ClientSettings-AllowRowsDragDrop="true">
<ClientSettings AllowRowsDragDrop="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="false"></Selecting>
<ClientEvents OnRowDropping="onRowDropping"></ClientEvents>
<Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
</ClientSettings>
<MasterTableView Name="PartsTableView" DataKeyNames="InventoryID" AllowSorting="True" NoDetailRecordsText="No Items" HierarchyLoadMode="ServerBind"
NoMasterRecordsText="No Items Added" CommandItemDisplay="Bottom" EditMode="Batch">
<CommandItemSettings ShowAddNewRecordButton="false" />
<BatchEditingSettings EditType="Cell" />
<DetailTables>
<telerik:GridTableView Name="ComponentDetails" Caption="Component Details" DataKeyNames="InventoryID"
runat="server">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="InventoryID" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn DataField="ParentID" Display="false" UniqueName="ParentID" />
<telerik:GridBoundColumn DataField="InventoryID" HeaderText="InventoryID" ReadOnly="true"
UniqueName="InventoryID" />
<telerik:GridBoundColumn DataField="FormNumber" HeaderText="Form #" UniqueName="FormNumber" />
<telerik:GridBoundColumn DataField="Description" HeaderText="Description" ReadOnly="true"
UniqueName="Description" Display="True" />
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridTemplateColumn UniqueName="ThumbNail">
<ItemTemplate>
<asp:Image ID="imgThumbNail" runat="server" ImageUrl='<%#Eval("ImageUrl")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="InventoryID" UniqueName="FormNumber" Display="false" />
<telerik:GridBoundColumn DataField="Text" ItemStyle-Width="150px" HeaderText="Product Code" />
<telerik:GridBoundColumn DataField="Description" Display="false" />
<telerik:GridTemplateColumn UniqueName="Description" HeaderText="Title">
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server" Text='<%#Eval("Description") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDescription" runat="server" Text='<%#Eval("Description") %>'>
</asp:TextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Type" Display="false" />
<telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit" UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ButtonType="ImageButton"
CommandName="DeleteInventory" Text="Remove" UniqueName="Delete">
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
<HeaderStyle ></HeaderStyle>
</telerik:GridButtonColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<asp:XmlDataSource ID="XMLBookBuilderSource" runat="server" EnableCaching="false">
</asp:XmlDataSource>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxEditor" runat="server" TextBoxStyle-Width="230px"></telerik:GridTextBoxColumnEditor>

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 29 Sep 2015, 08:38 PM
Hello,

When batch editing is enabled update and cancel buttons do not appear in the edited row. Instead Save Changes and Cancel Changes buttons are created in the GridCommandItem:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

For more information you can go through the Batch Editing article:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rajesh
Top achievements
Rank 1
answered on 06 Oct 2015, 05:08 PM

Hi Pavlina,

 

I want to save the modified value in the main Save button click event not the SaveChanges button in the Radgrid control.

 Please let me know how to get it without using BatchEditCommand event.

 

The below code is called in the main Save button click event. I am not getting the modified value in the grid Item cell.

For Each item As GridDataItem In Parts.MasterTableView.Items
strDescription AS String = DirectCast(item.Cells.Item(5), Telerik.Web.UI.GridTableCell).Text
Next

 

Regards,

Rajesh

Tags
Grid
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Rajesh
Top achievements
Rank 1
Share this question
or