Jump to content


Photo

NxCheckComboBox6, Name/Value items


  • Please log in to reply
3 replies to this topic

#1 stefanw

stefanw
  • Members
  • 16 posts

Posted 18 April 2017 - 06:14 PM

Hi,

How I can prevent to show the name part of the items in value of a NxCheckComboBox6?

 

Attached File  NxCheckComboBox6.GIF   12.32KB   0 downloads

 

In the dropdown list the name/value pair is shown correct.

DisplayMode = dmIndentlist or dmValue is equal.

 

Thanks, Stefan



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 April 2017 - 09:19 PM

Hi,

Try to update next procedure:

procedure TNxCheckComboBox6.UpdateText;
var
  i: Integer;
  s: WideString;
begin
  s := EmptyStr;

  for i := 0 to Pred(Items.Count) do
    if State[i] = cbChecked then
    begin
      if s <> EmptyStr then s := s + Delimiter;
//      s := s + Items[i]; 
      s := s + GetDisplayText(i); // <--- new line
    end;

  Text := s;
end;
Please tell me how it works now.
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 stefanw

stefanw
  • Members
  • 16 posts

Posted 20 April 2017 - 11:18 AM

Hi,

it is only one step.

The edit control will be correct diplayed but the selection and result is wrong.

 

You can se a screenshot before and after your changes.

 

Check this behaviour with my test-prog, see attached file (Dlephi XE)

 

Thanks.

Stefan

 

Attached Files



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 April 2017 - 11:14 PM

Hi,

Unfortunately now we have:

FCheckedStrings.DelimitedText := Text;
We don't have name=value pairs anymore.

I will need to do another approach on this.

If is possible, maybe you can write own routine (Names/Values for this purpose) until I create official one?

I will need to take some thinking about how to do it right and not rush.
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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users