• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Delete Grid Row(FC Grid, literal)

Hi,

In a custom form i need to sequence the grid record based on expiry date. After sequencing, the cursor goes to the last record in the grid.
To bring it up to the first position i'm deleting the first row and again inserting the gb data in the first row.

When i use delete grid row(FC Grid, 1) it deletes the entire row instead of deleting first row. why it is happening?? or

Anyone please tell some other logic to bring the cursor from last record to first record.
 

peterbruce

Legendary Poster
aravindjo,

Some preliminary things:

1) Congratulations on your first post.
2) This thread probably should be in the developer forum instead of the applications forum.
3) It would be very helpful for you to post your system configuration. See mine in my signature as an example.
4) It seems like English is not your first language.

What you describe is not that clear to me. Is it possible to post the event rules? That would help to understand your problem.

Are you saying that when you use delete grid row(FC Grid, 1) it delete all the rows in the grid instead of just the first row?
 
Yes Peter,

when i use delete grid row(FC Grid, 1) it delete all the rows in the grid instead of just the first row.





Thanks,
Aravindh

E9.1.4, Enterprise Server: Linux, Database Server: Linux, Oracle DB: 11g, Weblogic.
Streamserve
 

OneWorld_Only

Active Member
Aravindjo,

If you have the system function 'Change Row Selection' (depending on the tools release), you can use that function to set the cursor wherever you want to.
Hope this helps.

Thanks
PJ
 

Gov

VIP Member
Aravindh,

I suspect deleting all rows is happening because you may be using the system function in a wrong event or in a while loop

I was surprised when i see some forms showing control with first grid row and some other with last grid row. Not sure why. I will investigate when time allows

Try following code. In my case there were 2 grid rows and it was highlighting the first row by default. i wrote code to highlight second row. see if it works with you

=======================================================================
CONTROL: FORM
EVENT: Last Grid Record Has Been Read
-----------------------------------------------------------------------
OPT: Using Defaults
0002 Copy Grid Row To Grid Buffer(FC Grid, "2")
0003 Delete Grid Row(FC Grid, "2")
0004 Insert Grid Buffer Row(FC Grid, "2", <Yes>, <No>, <Yes>, <No>, <Yes>)

Before i close, one question - why are you trying to change focus to first row? I think you are in headerless detail/ header detail. Highlighting the last row is best practice as user may want to edit it (usually).

Thanks, Gov
 
Gov,

I'm highlighting first row because it has to sequence the grid based on least expiry date. Code was written in a checkbox--> selection change event. In Xe, the same code working fine.(deletes first row) but in E1 its deleting entire row. Tried your code too but still its deleting entire rows in E1. Thanks for your comments.

PJ

'Change Row Selection' worked. It focused the grid to first row. Thanks a lot.





Regards,
Aravindh

E9.1.4, Enterprise Server: Linux, Database Server: Linux, Oracle DB: 11g, Weblogic.
Streamserve
 
Top