I have noticed a behavior that is causing me problems; IDK if this is a Nevron bug or not. Can I get someone to look at this for me?
Since I manually load the Combo-Box picklist Items[<n>].Text with the description, I use the Items[<n>].Tag to hold the DB integer Key value of the record so I can locate it later for posting back to the DB.
Unfortunately, the Nevron NComboBox.Items[<n>].Tag is being overwritten by the contents of the .Items[<n>].Text property by the time I go to get it.
So, this operation, which works well with native components, fails:
int keyValue = int.Parse(this.ncboPreFixturesList.Items[this.ncboPreFixturesList.SelectedIndex].Tag.ToString());
Are you guys doing this? I haven't been able to find a place in my code where this could be happening...
Thanks,
-Miles
Hi Miles,
The only case where you can set the Tag property to be equal to Text property is when you use NListBoxItem(object o) constructor to create an item and o parameter is string.
However, if you set Tag property after creation of the item using this constructor it should remain as you set it.
Regards,
Angel.
Angel,
Thank you for the reply, but, perhaps I wasn't as clear as I needed to be...
I am not setting the Tag property of the NComboBox.Item to the value of the NComboBox.Text; it appears that the Neveron control is doing so.
I am setting the Tag property to the integer KEY value I need and the control is resetting the value on its own.
This is causing me to lose the KEY value pairing I need to quickly find and save the object data!
For example, I load the NComboBox:
FixtureBodyList
{
}
Then later, when I go to USE the Tag value; my Key value is gone; replaced by the control with the TEXT value...
I've checked, there is nowhere else that I modify the Key value. I do allow the user to modify the TEXT value; but that should not alter the Tag (Key); right?
I'm thinking I may be reporting a bug here! Please let me know if I need to send more information...
Try to add the items as follows:
NListBoxItem
item.Text = _FixtureBodiesList.FixtureBodies[i].Description;
item.Tag = _FixtureBodiesList.FixtureBodies[i].FixtureBody_IDX;
this.ncboFixturesFixtureBody.Items.Add(item);
Please, let me know if the problems still persist.