Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Disable some items in a valuelist in a WinGrid
posted

I have an ultraWinGrid and have a value list in one of the columns and everything looks great. I have all the data I need and this is working fine.

I now want to prevent the user from selecting certain items in the list. So If I have a "your Pet" list of Cat, Dog and Dragon I want to display all 3, but prevent the user from being able to slect Dragon. Is that possible? I would also like to change the color to a greyed out disabled color.

See my code below.

for (int

i = 0; i < dataRowCollection.Count; i++)

{

 

 

if (dataRowCollection[i]["Validated"].ToString() == "True")

{

 

 

ValueListItem

item = ultraWinGrid.DisplayLayout.ValueLists[valueListName].ValueListItems.Add(dataRowCollection[i][dataValueField], dataRowCollection[i][displayTextField].ToString());

}

 

 

else

{

 

 

 

ValueListItem

item = ultraWinGrid.DisplayLayout.ValueLists[valueListName].ValueListItems.Add(dataRowCollection[i][dataValueField], dataRowCollection[i][displayTextField].ToString());

 

 

//Disable and do not let the user select this item

}

}

Parents Reply Children
No Data