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

Batch Editing in Rad Grid ?

3 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkata
Top achievements
Rank 1
Venkata asked on 25 Jul 2013, 02:08 PM
Hello Everyone,

I have tried with "http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/batchediting/defaultcs.aspx" demo with trail version. I afraid, got so many errors below.

1) Type or namespace 'InformationBox' not found.
2) Type or namespace 'ConfiguratorPanel ' not found.
3) OnItemDeleted="RadGrid1_ItemDeleted" event is not firing ?

And temporarily, row is deleting and after "Refresh" the deleted row again showing in the grid.

How can i delete gridview row logically and not from database.

Can anyone please suggest me how can i resolve these errors.

Thanks,
Venkata.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 31 Jul 2013, 01:25 PM
Hi Venkata,

Please try the below code snippet.Make sure that after each operation to save the changes you make.Then try the OnDeleteCommand to delete the row.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" DataSourceID="SqlDataSource1"
     AllowPaging="true"  AutoGenerateDeleteColumn="true"
    AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true">
    <MasterTableView EditMode="Batch" CommandItemDisplay="Top" DataKeyNames="OrderID"
        InsertItemPageIndexAction="ShowItemOnCurrentPage">
        <BatchEditingSettings EditType="Cell" />
        <Columns>
            <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID" />
            <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" UniqueName="ShipCity" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Northwind_newConnectionString3 %>"
    SelectCommand="SELECT  [OrderID], [ShipCity] FROM [Orders]" DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @OrderID"
    InsertCommand="INSERT INTO [Orders] ([OrderID],[ShipCity]) VALUES (@OrderID,@ShipCity)"
    UpdateCommand="UPDATE [Orders] SET [ShipCity] = @ShipCity WHERE [OrderID] = @OrderID">
    <DeleteParameters>
        <asp:Parameter Name="OrderID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="OrderID" Type="Int32" />
        <asp:Parameter Name="ShipCity" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="ShipCity" Type="String" />
    </UpdateParameters>
</asp:SqlDataSource>

Hope this helps.

Thanks,
Princy
0
Noushad
Top achievements
Rank 1
answered on 27 Dec 2013, 04:58 PM

Hi Friends,


When I am trying to use 'InformationBox' & ConfiguratorPanel getting 'Not registered' message
Can anyone please help me how can i resolve these errors.

Thanks,
Noushad Kunnapully
0
Ivan Zhekov
Telerik team
answered on 31 Dec 2013, 01:34 PM
Hi, Noushad.

The InformationBox and ConfigatorPanel are custom user controls specific to the demos. In this particular case (as with most other) you can replace the tags with asp:Panel (if you need to access it from server side) or with DIV elements otherwise.

Regards,
Ivan Zhekov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Venkata
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Noushad
Top achievements
Rank 1
Ivan Zhekov
Telerik team
Share this question
or