Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - ReportControl doesnt refresh when deleting a row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ReportControl doesnt refresh when deleting a row

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


Joined: 10 October 2006
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote gbrix Quote  Post ReplyReply Direct Link To This Post Topic: ReportControl doesnt refresh when deleting a row
    Posted: 10 October 2006 at 5:04am
Hi,
New to this control.
I delete a selected row like this:
    ReportControl1.FocusedRow.Record.DeleteAll
    ReportControl1.Redraw
    ReportControl1.Populate
 
however this leaves the control with broken indentation and gap.

Am I doing something wrong?
 
Thanks
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2006 at 6:58am
Hi,

.DeleteAll deletes all Items from this Record -- it's not what you need.
You'd better use the following:

ReportControl1.Records.RemoveAt ReportControl1.FocusedRow.Record.Index
ReportControl.Populate


--
WBR,
Serge
Back to Top
gbrix View Drop Down
Newbie
Newbie


Joined: 10 October 2006
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote gbrix Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2006 at 7:09am
Thanks for your quick reply
Just tried and  seems to delete them all ,I just want to delete the selected row.
Just noticed that the index is always 0.
I am loading the tree view in a kind of treeview style
 
Any more suggestions
 
 
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2006 at 7:41am
Well, if this is a tree view, you just need to delete a records not from top Records collection as it is shown above, but from the parent record collection. Something like below:

ReportControl1.FocusedRow.ParentRow.Record.Childs.RemoveAt ReportControl1.FocusedRow.Record.Index
ReportControl1.Populate


--
WBR,
Serge
Back to Top
gbrix View Drop Down
Newbie
Newbie


Joined: 10 October 2006
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote gbrix Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2006 at 7:44am
Thanks a lot it worked.Sorry for not telling you earlier that it was a treeview.
Just to say that are great controls.Are you planning more examples where you also show how to manipulate this controls like remove-find etc..
 
again thanks
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2006 at 8:57am
For some more tips and tricks you can look at "Articles and tutorials" chapter at the web site: http://www.codejock.com/support/articles/

--
WBR,
Serge
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.219 seconds.