Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Deleting Rows?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Deleting Rows?

 Post Reply Post Reply
Author
Message
VivantL View Drop Down
Newbie
Newbie


Joined: 08 August 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote VivantL Quote  Post ReplyReply Direct Link To This Post Topic: Deleting Rows?
    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!



Edited by VivantL
Back to Top
VivantL View Drop Down
Newbie
Newbie


Joined: 08 August 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote VivantL Quote  Post ReplyReply Direct Link To This Post 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!

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.143 seconds.