 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guillem Guest
|
Posted: Tue Feb 15, 2005 12:45 pm Post subject: Sorting and unsorting |
|
|
Hi,
I've got a TDBGrid which shows the data from a TADOdataset. I also have
added an OnTitleClick event handler to allow the user to sort by whatever
field he wants, and a Tcheckbox for enabling/disabling the usage of the
OnTitleClick event. It works fine but i have 2 questions:
1- If I have the data sorted (for any field) and I insert a new record, it
is immediately ordered. This is ok, but if I have a lot of records the user
does not know where the record actually is, and could have the impression
the data is gone. So I would like to have the last record inserted focused
but I'm not sure how to do this. Any idea?
2- If I sort by any column and then disable the ordering by column i would
like the records to stay "ordered" as they are at that moment, and if I
insert a new record that it also stays at the position where I insert it.
Problem is if I put the Sort property to '' then the dataset is
automatically "ordered" as it was when the data was loaded for the first
time, and if I do not touch the Sort property it still sorts. Is it possible
to do what i want?
--
Thanks in advance for help & best regards :)
Guillem Vicens
Dep. informática Green Service SA
[email]guillemvicens (AT) clubgreenoasis (DOT) com[/email]
www.clubgreenoasis.com
|
|
| Back to top |
|
 |
Guillem Guest
|
Posted: Wed Feb 16, 2005 10:15 am Post subject: Re: Sorting and unsorting |
|
|
"Brian Bushay TeamB" <BBushay (AT) Nmpls (DOT) com> escribió en el mensaje
news:k9e5111bkb75areb1g0evt6397utmr1m68 (AT) 4ax (DOT) com...
| Quote: |
1- If I have the data sorted (for any field) and I insert a new record, it
is immediately ordered. This is ok, but if I have a lot of records the
user
does not know where the record actually is, and could have the impression
the data is gone. So I would like to have the last record inserted focused
but I'm not sure how to do this. Any idea?
The behavior I see is for the cursor to stay with the cursor when a record
posts. Can you describe the circumstances under which you loose the
posted
record"
|
Actually, I'm not posting the record to the database immediately. The client
works on a snapshot of it, and when he decides to either accept the changes
and leave, or save the changes they are posted. Doing further tests i have
seen that it actually focuses the next record considering the order
established (if i insert a record which would be in position 2 it focuses
position 3). This is not really so bad, but i would like the cursor to stay
on the last inserted (in example before position 2).
I was thinking about using the RecNo property for it, but I'm not sure how
to do it. Any help would be appreciated
--
Best regards :)
Guillem Vicens
Dep. informática Green Service SA
[email]guillemvicens (AT) clubgreenoasis (DOT) com[/email]
www.clubgreenoasis.com
|
|
| Back to top |
|
 |
Guillem Guest
|
Posted: Wed Feb 16, 2005 4:05 pm Post subject: Re: Sorting and unsorting |
|
|
"Brian Bushay TeamB" <BBushay (AT) Nmpls (DOT) com> escribió en el mensaje
news:k9e5111bkb75areb1g0evt6397utmr1m68 (AT) 4ax (DOT) com...
| Quote: |
1- If I have the data sorted (for any field) and I insert a new record, it
is immediately ordered. This is ok, but if I have a lot of records the
user
does not know where the record actually is, and could have the impression
the data is gone. So I would like to have the last record inserted focused
but I'm not sure how to do this. Any idea?
The behavior I see is for the cursor to stay with the cursor when a record
posts. Can you describe the circumstances under which you loose the
posted
record"
|
Actually, I'm not posting the record to the database immediately. The client
works on a snapshot of it, and when he decides to either accept the changes
and leave, or save the changes they are posted. Doing further tests i have
seen that it actually focuses the next record considering the order
established (if i insert a record which would be in position 2 it focuses
position 3). This is not really so bad, but i would like the cursor to stay
on the last inserted (in example before, position 2).
I was thinking about using the RecNo property for it, but I'm not sure how
to do it. Any help would be appreciated
--
Best regards :)
Guillem Vicens
Dep. informática Green Service SA
[email]guillemvicens (AT) clubgreenoasis (DOT) com[/email]
www.clubgreenoasis.com
|
|
| Back to top |
|
 |
Guillem Guest
|
Posted: Thu Feb 17, 2005 3:10 pm Post subject: Re: Sorting and unsorting |
|
|
Hi,
well, somehow it's fixed now. I have no idea what it was because i was
changing something else. Anyway, thanks for your help Brian
--
Best regards :)
Guillem Vicens
Dep. informática Green Service SA
[email]guillemvicens (AT) clubgreenoasis (DOT) com[/email]
www.clubgreenoasis.com
"Brian Bushay TeamB" <BBushay (AT) Nmpls (DOT) com> escribió en el mensaje
news:4u18111ogo9epr9v4fta8h9shp354kdjun (AT) 4ax (DOT) com...
| Quote: |
Actually, I'm not posting the record to the database immediately. The
client
works on a snapshot of it, and when he decides to either accept the
changes
and leave, or save the changes they are posted. Doing further tests i have
seen that it actually focuses the next record considering the order
established (if i insert a record which would be in position 2 it focuses
position 3). This is not really so bad, but i would like the cursor to
stay
on the last inserted (in example before position 2).
I can't reproduce the next record behavior.
--
Brian Bushay (TeamB)
[email]Bbushay (AT) NMPLS (DOT) com[/email]
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|