Jump to content


Photo

Multiselect consultations


  • Please log in to reply
18 replies to this topic

#1 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 January 2007 - 12:33 AM

Dear Visitors,

From version 3.9.7 multiselect feature will be returned to NextDBGrid, and I like to introduce you with this feature.

Same as in NextGrid, property Selected[RowIndex] specify if row is selected.

Example:

CODE
var
  i: Integer;
begin
  ListBox1.Clear;
  for i := 0 to NextDBGrid1.RowCount - 1 do
  begin
    if NextDBGrid1.Selected[i] then ListBox1.Items.Add(NextDBGrid1.Cells[0, i]);
  end;
end;


You may spot that approach is slightly different from multiselect in standard TDBGrid (with using TBookmarks list), but I hope that this one is better.

If you have any comments, please post it.

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.

#2 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 09 January 2007 - 11:57 PM

this is much better!

#3 SIYAHKALE

SIYAHKALE
  • Members
  • 26 posts

Posted 24 January 2007 - 10:32 AM

QUOTE (Boki (Berg) @ Jan 9 2007, 01:33 AM) <{POST_SNAPBACK}>
Dear Visitors,

From version 3.9.7 multiselect feature will be returned to NextDBGrid, and I like to introduce you with this feature.

Same as in NextGrid, property Selected[RowIndex] specify if row is selected.

Example:

CODE
var
  i: Integer;
begin
  ListBox1.Clear;
  for i := 0 to NextDBGrid1.RowCount - 1 do
  begin
    if NextDBGrid1.Selected[i] then ListBox1.Items.Add(NextDBGrid1.Cells[0, i]);
  end;
end;


You may spot that approach is slightly different from multiselect in standard TDBGrid (with using TBookmarks list), but I hope that this one is better.

If you have any comments, please post it.

regards

when will be this version released? ...In download section there is still 3.9.7. This is better, but a bookmark list is better, otherwise we have to implement some unvisible columns for needed data and it takes more time for coding , and grows source, not?

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 24 January 2007 - 06:26 PM

Hello,

It will released today night.

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 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 24 January 2007 - 08:07 PM

QUOTE (SIYAHKALE @ Jan 24 2007, 11:32 AM) <{POST_SNAPBACK}>
when will be this version released? ...In download section there is still 3.9.7. This is better, but a bookmark list is better, otherwise we have to implement some unvisible columns for needed data and it takes more time for coding , and grows source, not?


not sure why u said bookmark list is better
i didnt understand the connection between the above and an invisible column for needed data
boki's solution is as simple as possible, and for each record to check if its selected or not

#6 SIYAHKALE

SIYAHKALE
  • Members
  • 26 posts

Posted 25 January 2007 - 12:02 PM

QUOTE (emailaya @ Jan 24 2007, 09:07 PM) <{POST_SNAPBACK}>
not sure why u said bookmark list is better
i didnt understand the connection between the above and an invisible column for needed data
boki's solution is as simple as possible, and for each record to check if its selected or not


First, if you have a result set like thousands rows, then it will spend more time then a bookmarklist for searching whole grid. And by bookmarklist we can jump to a specified row on the result set.

Second, if we need to get an invisible field on the result set, after we create the list of selected row then we have to use another function to find index of row in the result set. That is why Datasets have bookmark property, am I wrong?

Regards

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 25 January 2007 - 10:54 PM

Hello,

Yes, this is a cons. I will try to add Bookmark to each selected row if is possible.

I have look into TBookmarksList and it is very similar to my code.

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.

#8 Andreas

Andreas
  • Members
  • 17 posts
  • Gender:Male
  • Location:Munich, Germany

Posted 09 February 2007 - 11:47 PM

QUOTE (Boki (Berg) @ Jan 9 2007, 12:33 AM) <{POST_SNAPBACK}>
CODE
var
  i: Integer;
begin
  ListBox1.Clear;
  for i := 0 to NextDBGrid1.RowCount - 1 do
  begin
    if NextDBGrid1.Selected[i] then ListBox1.Items.Add(NextDBGrid1.Cells[0, i]);
  end;
end;


For me the example does not work. The NextDBGrid1.Cells[0, i] is always empty (''). Do i miss something or is it a bug? Thank you for checking this out, i need the multiselect urgently.
Andreas

#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 10 February 2007 - 02:29 AM

Hello,

Can you please check Demo 2 in Demos\Next DBGrid\ subfolder, and how it work.

Thank you,

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.

#10 Andreas

Andreas
  • Members
  • 17 posts
  • Gender:Male
  • Location:Munich, Germany

Posted 11 February 2007 - 10:10 PM

QUOTE (Boki (Berg) @ Feb 10 2007, 02:29 AM) <{POST_SNAPBACK}>
Can you please check Demo 2 in Demos\Next DBGrid\ subfolder, and how it work.


OK, the Demo works. I found the problem im my App: if "DisableTableControls" is called before, the "Cells"-Array is empty afterwards. Maybe it would be better to avoid that, or is there a reason for this behavior?
regards
Andreas

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 12 February 2007 - 08:21 AM

Hello Andreas,

Do you think about DisableControls maybe?

I didn't check it yet, but you may try to comment line:

CODE
    if DataSet.ControlsDisabled then Exit; // <---- comment this line


in TNxDbGrid (NxDBGrid.pas)

Maybe is better that way. I will test it more.

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.

#12 Andreas

Andreas
  • Members
  • 17 posts
  • Gender:Male
  • Location:Munich, Germany

Posted 12 February 2007 - 11:14 AM

QUOTE (Boki (Berg) @ Feb 12 2007, 08:21 AM) <{POST_SNAPBACK}>
Hello Andreas,

Do you think about DisableControls maybe?


Yes, of course. I will also test your suggestion. Thank you!
Andreas

#13 Dmitry

Dmitry
  • Members
  • 34 posts

Posted 28 February 2007 - 10:25 PM

QUOTE (Boki (Berg) @ Jan 26 2007, 12:54 AM) <{POST_SNAPBACK}>
I will try to add Bookmark to each selected row if is possible.
I have look into TBookmarksList and it is very similar to my code.


Hello Berg, are there any results in this? It will be very usefull to have a bookmark on every selected item (every selected row in my case, because i'm using the grid in SelectFullRow mode).

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 28 February 2007 - 10:40 PM

Hello,

I am working on it, I hope that first results will be in next release.

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.

#15 tarnschaf

tarnschaf
  • Members
  • 14 posts

Posted 23 November 2011 - 01:36 AM

Hi,

I have the same problem trying to migrate the standard DBGrid code to NextDBGrid.
Is it possible to access the bookmark in current version? If so, how?

Thanks,
tarnschaf

#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 23 November 2011 - 01:44 AM

Hi,

Unfortunately not yet. I have try to add this feature but gives me a troubles. I will need to use another approach in next try.
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.

#17 tarnschaf

tarnschaf
  • Members
  • 14 posts

Posted 23 November 2011 - 01:45 AM

I just wanted to wrote that I found out how to do it. At least this seems to work:

gridResults.DataSource.DataSet.Bookmark := gridResults.CellField[0, I].Origin;

But it isn't correct?

#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 23 November 2011 - 01:49 AM

Hi,

I think about to add TBookmark property to TNxSelectionList object. Maybe it will not be as in DBGrid, but it may help.

Best 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.

#19 Tibor

Tibor
  • Members
  • 4 posts
  • Gender:Male
  • Location:Hungary

Posted 13 February 2013 - 01:39 AM

Hi,

I'm experimenting with NextDBGrid. I've set goSelectFullRow, goMultiSelect to true.
Now when a row is selected and I scroll the list so that the selected row disappear, the I simply click to an item in the list, the previously selected item (that is not visible) remains select.
It gets even worse if I use arrows (down/up keys) to scroll the list, as soon as an item appears from the area that was not visible befor (down/up), all the newly visible items gets selected.
I've checked from code, those items are indeed selected, it's not just a paint issue.

I don't know if there are other options turned on/off that make this effect, or it's really a bug.

I've tried with you NextDBGrid/ADO example. Opened, set goSelectFullRow, goMultiSelect to true and got the same effect.

Can you please explain this to me?

Thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users