Solved

Deactivate an item in a valuelist based on a tag property

Posted on 2009-05-08
6
451 Views
Last Modified: 2012-08-14
I have some items in an Infragistics (using 2008 volume 3 WinForms) valuelist which are active and some are inactive but need to be displayed for historical records purposes.  

My ideal situation would be to display them but not select the item.  The second best scenario would be to do a strikethrough on the text of the Inactive records.
0
Comment
Question by:busapps
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:PlatoConsultant
ID: 24344430
there is a before drop down event you can handle it and then depend upon the data present in the grid row u will handle the enabling or disabling of this drop down...





0
 
LVL 1

Author Comment

by:busapps
ID: 24344447
Not quite what I'm looking for.  I need to allow some ValueListItems to be selected within a ValueList, but other ValueListItems within the ValueList to be not selected.  
0
 
LVL 11

Expert Comment

by:PlatoConsultant
ID: 24344768
can u use the filter items, if u want to disable some items in the valuelist there need to do too much programming.

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:busapps
ID: 24344774
not sure what you mean, please expound.
0
 
LVL 11

Accepted Solution

by:
PlatoConsultant earned 500 total points
ID: 24344850
it is difficult to enable / disable  items in the value list at run time ... change the popluating of value list logic as shown in the infragisitcs sample.




    private void PopulateSpacePortsValueList()
	{
        if ( this.gridValueLists.DisplayLayout.ValueLists.Exists("SpacePorts") )
			return;
 
        ValueList objValueList = this.gridValueLists.DisplayLayout.ValueLists.Add("SpacePorts");
 
        DataTable ds = new SpaceFlightsData().SpacePorts;
 
        for ( int i = 0; i < ds.Rows.Count; i++ )
            objValueList.ValueListItems.Add((int)(ds.Rows[i].ItemArray[0]), ds.Rows[i].ItemArray[1].ToString());
 
	}

Open in new window

0
 
LVL 1

Author Closing Comment

by:busapps
ID: 31579696
The 2 valuelists is a good idea.  Just change them on the before dropdown event and set it back on the afterExitEntryMode event.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question