Print Page | Close Window

Row deletion after sorting

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=21567
Printed Date: 29 April 2024 at 8:58am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Row deletion after sorting
Posted By: Benit
Subject: Row deletion after sorting
Date 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?




Replies:
Posted By: Benit
Date 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 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net