We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Delete Row Problems

Hi, In my grouping grid, when I attempt to delete a row using: mygrid.Table.CurrentRecord.Delete(); I get a strange behaviour. The row is removed from the grid, but when I click on another row in the grid, the deleted row re-appears! Then I delete it again, and this time it is gone for good. Any ideas? Thanks, Kav

4 Replies

AD Administrator Syncfusion Team July 10, 2006 10:28 PM UTC

Hi Kav, We tried to reproduce this issue in Essential Studio 4.2 with .Net 2003 + Windows XP sp2, but could not get this issue. Maybe I am not following the steps that you are doing. Attached sample working fine here. Could you please try running the same at your end and send me back the modified sample if still the problem exists? Also please let me know about the current version of Essential Studio/.Net FrameWork you are using Here is a sample. http://www.syncfusion.com/Support/user/uploads/DeleteRecords_c5c556a0.zip Best Regards, Haneef


AD Administrator Syncfusion Team July 10, 2006 10:48 PM UTC

Hi Haneef, Thanks for the quick reply. I tried the sample you provided, and it worked perfectly. I am using Essential Studion 3.3. However, my code does not work still. I think the problem is with the way I am adding to the grid. The rows I am trying to delete are rows that have been added using the add new record row. I tried deleting other records (previously in the dataset) and I was able to delete them just fine. But when I try deleting a row that has been just added, I get the behaviour I mentionned before. The following method is used to add a new record.... private void gridStoreGroups_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e) { Record r = e.Record as Record; if(e.Action == CurrentRecordAction.EndEditCalled && e.Record is GridAddNewRecord) { int groupNumb = storeGroupsDAO.getNextStoreGroupNumb(); DataRow newGroupRow = storeGroupsdt.NewRow(); newGroupRow["group_numb"] = groupNumb; newGroupRow["group_name"] = r.GetValue("group_name"); newGroupRow["date_eff"] = r.GetValue("date_eff"); newGroupRow["date_inac"] = r.GetValue("date_inac"); newGroupRow["dirty"] = 1; storeGroupsdt.Rows.Add(newGroupRow); } }


AD Administrator Syncfusion Team July 11, 2006 03:23 PM UTC

Hi Kav, Try this code to resolve the mentioned issue. But I am not able to see the issue in the normal grid that add the record in CurrentRecordContextChange event. private void gridStoreGroups_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e) { Record r = e.Record as Record; if(e.Action == CurrentRecordAction.EndEditCalled && e.Record is GridAddNewRecord) { int groupNumb = storeGroupsDAO.getNextStoreGroupNumb(); r.SetValue("group_numb", groupNumb); r.SetValue("dirty", 1); } } If I did not answer your question, please explain a little more about what you want, and I’ll try again Best Regards, Haneef


AD Administrator Syncfusion Team July 11, 2006 03:37 PM UTC

Thank you, This has solved the problem! >Hi Kav, > >Try this code to resolve the mentioned issue. But I am not able to see the issue in the normal grid that add the record in CurrentRecordContextChange event. > >private void gridStoreGroups_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e) >{ > Record r = e.Record as Record; > > if(e.Action == CurrentRecordAction.EndEditCalled && e.Record is GridAddNewRecord) > { > int groupNumb = storeGroupsDAO.getNextStoreGroupNumb(); > r.SetValue("group_numb", groupNumb); > r.SetValue("dirty", 1); > } >} > >If I did not answer your question, please explain a little more about what you want, and I’ll try again > >Best Regards, >Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon