How to insert a row in a Grid?

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
User avatar
zolysoftsolutions
Posts: 101
Joined: Wed Feb 29, 2012 3:33 am
Location: Gyulakuta, Erdélyország
Contact:

How to insert a row in a Grid?

Post by zolysoftsolutions » Fri Nov 03, 2017 7:46 pm

Hello,

How can I insert a row in a Grid?
By example I have 4 records in a grid and I have to insert a new row as first and the rest I want to move down.

The single solution is to move the data in array, sort and move back to the grid? ..or have somebody some more elegant solution?

Thank You.

Zoli B.
_______________________________
Open eyes for you!

User avatar
mol
Posts: 2879
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 136 times
Been thanked: 76 times
Contact:

Post by mol » Fri Nov 03, 2017 8:15 pm

With virtualgrid it's easy :-)

KDJ
Posts: 182
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland
Been thanked: 200 times

Post by KDJ » Fri Nov 03, 2017 9:29 pm

Zoli B.

Use AddItemEx method.

From HMG documentation:
<ParentWindowName>.<GridControlName>.AddItemEx ( aItem, nRow )

Set nRow := 1

User avatar
zolysoftsolutions
Posts: 101
Joined: Wed Feb 29, 2012 3:33 am
Location: Gyulakuta, Erdélyország
Contact:

Post by zolysoftsolutions » Sat Nov 04, 2017 11:20 am

Thank you very much my friends.
_______________________________
Open eyes for you!

Post Reply