Jump to content


Photo

NextGrid6.Columns.Delete ?

NextGrid6 Columns Delete

  • Please log in to reply
6 replies to this topic

#1 jaimak

jaimak
  • Members
  • 7 posts
  • Gender:Male

Posted 06 June 2019 - 01:11 PM

Hello,

 

I have a Grid with 6 Columns (Column1.. Column6) and I want delete Column2 and Column4, depend of cell content of this Columns, but it deleted erverytime the last 2 columns.

 

NextGrid.Columns.Delete(const Index: Integer); --> Index is not index/position of Column ?

 

What I make wrong?

 

source:

  for c := AColumn2 downto AColumn1 do
    begin
      b := false;
      for r := 0 to NextGrid.RowCount - 1 do
        begin
          if (ANextGrid.Cell[c,r].AsFloat = AValue) then begin b := true; Break; end;
        end;
      if b then NextGrid.Columns.Delete©;
    end;

 

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,831 posts
  • Gender:Male

Posted 06 June 2019 - 11:43 PM

Hi,

Your code seems to be fine, as far I can see at first look. But, maybe you can try with while loop since indexes are shifted if some of column is deleted.

If this hint won’t help, maybe I can write you small demo project.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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.

#3 jaimak

jaimak
  • Members
  • 7 posts
  • Gender:Male

Posted 08 June 2019 - 10:27 AM

Hello Boki,

yes, send me a small demo project, then I can see what is my mistake. At the moment I don't understand the function NextGrid.Columns.Delete

 

I test only NextGrid.Columns.Delete() with direct indicies.

- NextGrid.Columns.Delete(0) --> delete the last column

- NextGrid.Columns.Delete(1) --> delete the last column

- NextGrid.Columns.Delete(2) --> delete the last column

- NextGrid.Columns.Delete(3) --> delete the last column; NextGrid.Columns.Delete(3) --> delete the last column; NextGrid.Columns.Delete(3) --> ERROR: Column(3) out of bounds (correct: grid have only 2 columns now)



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,831 posts
  • Gender:Male

Posted 08 June 2019 - 01:16 PM

Hello,

I found why it doesn’t work in your case. I’m working in this bug now. Sorry for problems.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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 jaimak

jaimak
  • Members
  • 7 posts
  • Gender:Male

Posted 09 June 2019 - 09:50 AM

Hello Boki,

thank you for your fast answer and work. I will wait for the next update.



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,831 posts
  • Gender:Male

Posted 27 June 2019 - 01:33 PM

Hi jaimak,

 

I think that I have fixed the bug. If you have time, please download latest update.

 

Thank you for reporting as allways!


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.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.

#7 jaimak

jaimak
  • Members
  • 7 posts
  • Gender:Male

Posted 11 July 2019 - 11:05 AM

Hello Boki,

I install the newest version (NextGrid6 v6.3.7). It work correct now.

Thank you very match for your support.

Jaimak






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users