Jump to content


Photo

Adding or changing the values of a NxListColumn6

ListColumn6 NextGrid6

  • Please log in to reply
5 replies to this topic

#1 ouiji

ouiji
  • Members
  • 10 posts

Posted 18 April 2024 - 08:01 PM

I am certain this is extremely simple, but my years away from coding have taken a toll..

 

I am trying to Add to, or Edit the contents of a NxListColumn on the fly, like you would change a textcolumn with something along the lines of

 grid_huge.Cell[4,pPos].AsString := tVal; 

but I cannot for the life of me figure out how to edit items in a Listcolumn..  Any chance you could point me in the right direction?

 

Intended end result..ish..

 

grid_huge.cell[4,pPos] := items.list;  

 

 

 

Many Thanks



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 18 April 2024 - 10:17 PM

Hello,

 

if you need to change what a cell need to display, you only need to set AsInteger to the index of some of the strings in Items property of the column.

 

Like:

 

MyGrid.Cell[1, 1].AsInteger := <index of string>;

 

Hope that this is what you need :)


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.

#3 ouiji

ouiji
  • Members
  • 10 posts

Posted 19 April 2024 - 02:27 AM

Thank you for your swift reply, but I am still struggling to add lines into the listbox columns.  

 

Adding 3 lines to each listboxcoloumn on each row should be pretty simple, right? But nothing I try manages to put text into the list boxes.



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 22 April 2024 - 08:00 PM

Hello,

 

Unfortunately it seems that I’m unable to understand it correctly.

 

If you want to add/edit items in run-time, you probably want to access Items property which is standard TStrings type property. You can use standard methods like Add, for example: MyColumn.Items.Add(‘new item’);


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 ouiji

ouiji
  • Members
  • 10 posts

Posted 18 June 2024 - 05:39 AM

My apologies,

 

It appears I was far more tired than I thought when I attempted to ask the question, and I failed to come up with anything close to a coherent thought. 

 

I am searching through the NextGrid using this command to locate the desired row, no problems with this.

 

     pPos := grid_huge.FindText( [NxTextColumn61.Index], tID, 0, grid_huge.RowCount - 1, [] , moExactMatch );

 

 

Once the row is located, I cannot figure out how I can access the specific row on the column as a list box. Changing the information on a TextColumn or a MemoColumn is not an issue as long as I am able to treat is simply as a String.  For example

 

 

 grid_huge.Cell[4,pPos].AsString := tVal;    Will set the Text Column to the value of tVal.

 grid_huge.Cell[6,pPos].AsString :=  (tYP + ':' + tVal + #13#10 + tst);    Will set the content in a MemoColumn.

 

 

Thank you again for all the help!



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 28 June 2024 - 12:36 AM

Hello,

 

No worries, we can try to solve this  :)

 

Maybe, if you are using ComboBox or ListColumn you can simply access Items sub-property of the column. You will only need to typecast Grid.Columns[x] with type of the column.

 

I hope that this helps, if no we can try something else.


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 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users