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

Manually deleting from grid without sqldatasource

0 Answers 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 02 Aug 2012, 07:18 PM
I have a grid

<telerik:RadGrid ID="RadGridFeedings" runat="server" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"  AllowAutomaticDeletes="True" AutoGenerateColumns="false" AllowPaging="True" AllowSorting="True" PageSize="10" skin="Default">
                            <PagerStyle Mode="NumericPages" />
                            <GroupingSettings CaseSensitive="false" />
                            <MasterTableView TableLayout="Fixed" Width="100%" CommandItemDisplay="top" DataKeyNames="FeedID" AutoGenerateColumns="false">
                                <Columns>
                                    <telerik:GridDateTimeColumn HeaderText="Date" DataField="FeedDate" UniqueName="FeedDate"
                                        SortExpression="FeedDate" HeaderStyle-Width="20%" ShowFilterIcon="false" DataFormatString="{0:dd/MM/yyyy}" />
                                    <telerik:GridBoundColumn HeaderText="Type" DataField="FoodType" UniqueName="FoodType"
                                        SortExpression="FoodType" HeaderStyle-Width="23%" ShowFilterIcon="false" />
                                    <telerik:GridBoundColumn HeaderText="Size" DataField="FoodSize" UniqueName="FoodSize"
                                        SortExpression="FoodSize" HeaderStyle-Width="22%" ShowFilterIcon="false" />
                                    <telerik:GridBoundColumn HeaderText="Result" DataField="Result" UniqueName="Result"
                                        SortExpression="Result" HeaderStyle-Width="22%" ShowFilterIcon="false" />
                                    <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center"/>
                </telerik:GridButtonColumn>
                                </Columns>                                
                            </MasterTableView>
                        </telerik:RadGrid>

that is being loaded using a datatable via the code behind

Dim dtFeedings As DataTable = RVSelect.SelectFeedings(-1, -1, Request.QueryString("AnimalID"), "", -1, -1, "").Tables(0)
RadGridFeedings.DataSource = dtFeedings
RadGridFeedings.DataBind()

How do I get the edit/delete buttons working in this scenario as all the examples use sqldatasources or linqdatasources?

Many thanks
Simon

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Share this question
or