Print Page | Close Window

assign value to .PropertyItemEnum

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=7310
Printed Date: 20 May 2024 at 4:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: assign value to .PropertyItemEnum
Posted By: kippa
Subject: assign value to .PropertyItemEnum
Date Posted: 05 June 2007 at 9:01pm
Hi,
I can add constraints to a item .PropertyItemEnum, but how can I assign a value to this item?
if an object property has one of the constraints value of the Pgrid item how can I have it selected or set for the item?
.value doesn't work (VB2005)

thanks



Replies:
Posted By: Oleg
Date Posted: 06 June 2007 at 1:15am
Hi,
 
Think you didn't specify values for contrstrants.
 

Category.AddChildItem(PropertyItemType.PropertyItemEnum, "Language")

Item.Constraints.Add("Neutral", 0)

Item.Constraints.Add("Arabic", 1)

Item.Constraints.Add("German", 2)

Item.Constraints.Add("Chinese(Taiwan)", 3)

Item.Constraints.Add("English (United States)", 4)

Item.Constraints.Add("France", 5)

Item.Constraints.Add("Russian", 6)

Item.Value = 3

 
it works for me.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: kippa
Date Posted: 06 June 2007 at 8:06am
Thanks,
but it means that I have to use a cycle for (or similar) to compare all the item in the list. And if the value is not among them I have to add it, right?.
it is not like the combobox control, where you can just assign a text property.
Ok. thanks again



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net