Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Row deletion after sorting
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Row deletion after sorting

 Post Reply Post Reply
Author
Message
Benit View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2011
Location: India
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Benit Quote  Post ReplyReply Direct Link To This Post Topic: Row deletion after sorting
    Posted: 28 March 2013 at 1:51am
I have a grid containing "n" records, the grid has a property to sort , add and delete rows .
When user add a row and then sort it the sort order is reflected visibly .
But when i am trying to delete after sorting, the focussed row is not getting deleted. Deletion occurs for the row which was selected before sorting was deleted.

EXAMPLE:
row before sorting  is 1,2,3,4,5
row after sorting     is 5,3,1,2,4
Now if i want to delete row 5 it is till deleting ROW 1.

Can any one tell me why this happens?
Do i need to set any thing before deletion if records has been sorted?

Back to Top
Benit View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2011
Location: India
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Benit Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2013 at 1:58am


Here is my code for deleting rows:
CXTPReportRow *ptrSelRow = NULL;
CXTPReportRecords *pAllRecords = NULL;
ptrSelRow = GetFocusedRow();
int nSelRow = -1;
if(ptrSelRow != NULL)
{
nSelRow = ptrSelRow->GetIndex();
pAllRecords = GetRecords(); 
pAllRecords->RemoveAt(nSelRow);
Populate();
}
Is there any thing to add up for gird after sorting 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.