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

Delete event on client side does not work right!

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mic
Top achievements
Rank 1
Mic asked on 05 Jan 2009, 05:34 AM
hi, i'm using SQLdatasource with the Delete command:

DeleteCommand="DELETE FROM Vocabulary WHERE (ID =@id)">


this is my grid:


<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" 
        AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSourceVoca" 
        GridLines="None" onneeddatasource="RadGrid1_NeedDataSource" PageSize="100" 
        ShowGroupPanel="True" Skin="Sunset">
        <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" />
<MasterTableView AllowMultiColumnSorting="True" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSourceVoca" ShowFooter="True" AllowAutomaticDeletes="True" DataKeyNames="id,ID">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="ID" DataType="System.Int64" HeaderText="ID" 
            ReadOnly="True" SortExpression="ID" UniqueName="ID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Vocabulary" HeaderText="Vocabulary" 
            SortExpression="Vocabulary" UniqueName="Vocabulary">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Type" HeaderText="Type" 
            SortExpression="Type" UniqueName="Type">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Meaning" HeaderText="Meaning" 
            SortExpression="Meaning" UniqueName="Meaning">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Synonyms" HeaderText="Synonyms" 
            SortExpression="Synonyms" UniqueName="Synonyms">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" 
            SortExpression="Comments" UniqueName="Comments">
        </telerik:GridBoundColumn>
        <telerik:GridClientDeleteColumn ConfirmText="Are you sure you want to delete the selected row?" 
            HeaderStyle-Width="35px" ConfirmTitle="Delete item" >
<HeaderStyle Width="35px"></HeaderStyle>
        </telerik:GridClientDeleteColumn>
        <telerik:GridEditCommandColumn>
        </telerik:GridEditCommandColumn>
    </Columns>

<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>

    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" />
</MasterTableView>

        <ClientSettings AllowDragToGroup="True">
        </ClientSettings>

<FilterMenu EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
    </telerik:RadGrid>

when i click delete. The selected item inside the Rad grid disappeared , but the actually item in the database did not get deleted.

Why ?? 

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 05 Jan 2009, 08:20 AM
Hi,

GridClientDeleteColumn will delete the row on the client without any request - this action will be persisted automatically server-side once you submit the page.

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Mic
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or