I am having a strange problem with asp.net GridView . I have a GridView related to LinqDataSource . In the GridView row delete event, I delete the row from the database, but the grid is not updated (even after BINDING to the data source).
When I set a breakpoint, I could see that the OnRowDeleting event is OnRowDeleting after the LinqDS_Selecting event. But he was not fired after the deletion event! Maybe this is the reason? What am I doing wrong?
Can someone please help. Thanks a lot at Advance.
.aspx file:
<asp:LinqDataSource ID="LinqDS" runat="server" OnSelecting="LinqDS_Selecting"> </asp:LinqDataSource> <asp:GridView DataSourceID = "LinqDS" ID = "gv1" runat = "server" DataKeyNames = "InstructionId" EnableViewState = "false" OnRowDataBound = "gv1_RowDataBound" OnRowDeleting = "gv1_RowDeleting" OnRowCommand = "gv1_RowCommand" PageSize = "30" > <Columns> </Columns> </asp:GridView>
.aspx.cs
protected void Page_Load(object sender, EventArgs e) { } protected void LinqDS_Selecting(object sender, LinqDataSourceSelectEventArgs e) {
source share