Print Page | Close Window

Deleting Rows?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=2703
Printed Date: 19 April 2024 at 11:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Deleting Rows?
Posted By: VivantL
Subject: Deleting Rows?
Date Posted: 08 August 2005 at 2:48pm

I'm having trouble figuring out how to delete rows from a Report that has been sorted / has groups enabled.

Currently my code looks like this:

private void axReportControl1_KeyDownEvent(object sender, AxXtremeReportControl._DReportControlEvents_KeyDownEvent e)

{

if (e.keyCode == 46)

{

for (int i = axReportControl1.SelectedRows.Count - 1; i >= 0; i--)

{

axReportControl1.Records.RemoveAt(axReportControl1.SelectedR ows.Index);

}

axReportControl1.Populate();

}

}

This works just fine if the list has not been sorted. However, if the list is sorted then the indexes returned by SelectedRows do not match the internal representation in the list and the wrong rows are deleted. Is there a method to work around this? In the standard ListView the rows correspond to each other.

Thanks!




Replies:
Posted By: VivantL
Date Posted: 08 August 2005 at 3:59pm

Ah, nevermind I figured out how to do it.

I just needed to use axReportControl1.SelectedRows.Record.Index

Sorry about that!




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