Jump to content


Photo

Things I miss...


  • Please log in to reply
4 replies to this topic

#1 OlafSt

OlafSt
  • Members
  • 14 posts

Posted 15 March 2006 - 03:09 PM

[snipped several hundred words of talking about how great NextGrid is - I think you get the point anyway biggrin.gif]

I'm missing some features around the sorting capabilities of NextGrid:

1. Disable/Enable Sorting temporarily

Okay, there is a way to iterate through the columns and disable sorting. This requires me to keep in mind, which one was sorted, how it was sorted and so on.

Well, NG already knows all these facts. A simple Boolean property "EnableSorting" would to the trick, too. Put in the right place, NG doesn't even need to remember the sorted column... This property should be "on top" - if EnableSorting=false, no sorting occurs except sorting on Header click. Switching from "false" to "true" does not execute a sorting-cycle - see Number 3 down below.

2. Automatic sort on "Add"/"Insert"

When adding/inserting a new Row into NG, it is always placed at the last position, NG dosen't care about sorting-state of any column. An automatic Sort-cycle would be nice.

I'm not sure if sorting can be accomplished automatically, as AddRow simply adds an empty row, which is bad for sorting. To solve this problem, we come to

3. Let me tell NG, when to sort

As automatic sorting may be impossible to implement, a simple call to "ReSort" and NG uses its fast routines to resort the Grid. This one would come in handy, too - in combination with BeginUpdate and EndUpdate to keep up the speed on bulk inserts.

If all this already exists - tell me, where and how. I haven't digged it out then.

#2 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 15 March 2006 - 04:14 PM

Hi,

Do the beginupdate/endupdate procedures not do what you need (block updates and thus sorting)?
G.W. van der Vegt

#3 OlafSt

OlafSt
  • Members
  • 14 posts

Posted 16 March 2006 - 12:10 PM

No, sir.

I'm just doing the same as lots of other coders:

- Created a NextGrid
- Set my Columns
- Picked a numeric column, set "Sorted" to true, SortKind "skAscending", SortType "stNumeric"

All this is done during Designtime.

In runtime, I open up my File, read the Data and pump it into the Grid, line by line. It is of no interest, if I use BeginUpdate/EndUpdate during this filling or not. The Data is displayed the way I added it to the Grid:

Reading from File into the sorted Column: 101,102,852,951,104,106
Display in NextGrid (Top to Bottom): 101,102,852,951,104,106

A Workaround is to set the according Column "Sorted=false" and then "Sorted=true". Well, this can IMHO only be a Workaround, as my Application is forced to gather information the Grid already knows of.

Several circumstances require a reread of File and refill the grid - but it is not guaranteed the initial column is still the one the user wants to be sorted by.

That's why I asked for a "ReSort"-Procedure, No. 3 on the list.

Under some circumstances I'm forced to prevent User-initiated Resorting of the Grid by clicking the header. To do this, I'm forced to iterate through the columns, remind which one was sorted and how it was sorted. Afterwards I need to reconstruct this.

Again I'm forced to gather and keep information the Grid already knows of - here we have my No. 1 on the list.

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 16 March 2006 - 10:23 PM

Hello Olaf,

I will back to this topic as soon I release v3.5 (in 2 days) with FixedCols. Then I will have more time.

regards!
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 21 March 2006 - 12:46 PM

Hi All,

As I could not find a function to force sorting I wrote one and posted it in the user contribution forum.
G.W. van der Vegt




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users