Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

ListBox Item ==> VALUE?

[es] :: .NET :: ListBox Item ==> VALUE?

[ Pregleda: 685 | Odgovora: 2 ]

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

VerbatimBOT
Aleksandar Dragosavac
Senior .NET Developer
Serbia, Belgrade

Član broj: 84129
Poruke: 223
*.kalik.info.

Sajt: https://www.xing.com/prof..


Profil

icon ListBox Item ==> VALUE?21.10.2006. u 00:12

Znači jednostavno: Kako da prilikom punjenja ListBox-a svakom Item-u dodam i Value?
U 2003. to beše: listBox1.Items[index].Value
"I think it is obscene that we should believe that we are entitled to end somebody's life, no matter what that person has supposedly done or not done."
Richard Attenborough
21.10.2006. u 00:12 

DarkMan
Darko Matesic

Član broj: 20445
Poruke: 467
217.169.219.*



Profil

icon Re: ListBox Item ==> VALUE?21.10.2006. u 18:36
Code:

    public class ComboBoxItem
    {
        public static String DisplayMember = "DisplayText";
        public static String ValueMember = "ItemValue";
        private String m_DisplayText;
        private object m_ItemValue;
        public ComboBoxItem(String DisplayText, object ItemValue)
        {
            this.m_DisplayText = DisplayText;
            this.m_ItemValue = ItemValue;
        }

        public String DisplayText
        {
            get { return this.m_DisplayText; }
            set { this.m_DisplayText = value; }
        }

        public object ItemValue
        {
            get { return this.m_ItemValue; }
            set { this.m_ItemValue = value; }
        }

        public override String ToString()
        {
            return this.m_DisplayText;
        }
    }


Code:

    ArrayList Items = new ArrayList();
    Items.Add(new ComboBoxItem("item 1", 1);
    Items.Add(new ComboBoxItem("item 2", 2);
    Items.Add(new ComboBoxItem("item 3", 3);
    comboBox.DataSource = Items;
    comboBox.DisplayMember = ComboBoxItem.DisplayMember;
    comboBox.ValueMember = ComboBoxItem.ValueMember;


Vrednost citas i postavljas u property comboBox.SelectedValue
21.10.2006. u 18:36 

VerbatimBOT
Aleksandar Dragosavac
Senior .NET Developer
Serbia, Belgrade

Član broj: 84129
Poruke: 223
217.24.18.*

Sajt: https://www.xing.com/prof..


Profil

icon Re: ListBox Item ==> VALUE?23.10.2006. u 08:43
Hvala čovek!
Živ bio! :)
"I think it is obscene that we should believe that we are entitled to end somebody's life, no matter what that person has supposedly done or not done."
Richard Attenborough
23.10.2006. u 08:43 

[es] :: .NET :: ListBox Item ==> VALUE?

[ Pregleda: 685 | Odgovora: 2 ]

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.