Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / How do you set the value of an UltraCombo’s active row?

How do you set the value of an UltraCombo’s active row?

New Discussion
Michael Hafner
Michael Hafner asked on May 7, 2008 2:43 PM

I have a ultra combo box that has a datasource which is a collection of objects. The Valuemember is “ColorID” and the displaymember is “Name”. When the form opens I always want the ultracombo to display the row with the “ColorID” of 26. What’s the best way to accomplish this? I don’t want to loop through all of the rows looking for the value member, i’d like to find the Infragistics equivalent of:

ColorsCombo.SelectedValue = 26

to put in my form load event.

Sign In to post a reply

Replies

  • 0
    Darrell Kress
    Darrell Kress answered on Dec 27, 2007 7:31 PM

    Set the ultraCombo.Value = 26 

    • 0
      Michael Hafner
      Michael Hafner answered on Dec 27, 2007 7:45 PM

      Thanks. I'm not sure how I missed that… I guess I was stuck trying to mess with ActiveRow.

      • 0
        Travis
        Travis answered on Apr 1, 2008 9:09 PM

        For consistencies sake, why isn't it SelectedValue and not just value.  

         

        See, I came across the same thing.  Geesh! 

      • 0
        Mike Saltzman
        Mike Saltzman answered on Apr 2, 2008 2:31 PM

        Because it needs to be consistent with all of the other editor controls – they all use Value.  

      • 0
        Jim
        Jim answered on May 2, 2008 9:08 PM

        When I have a UltraCombo in a UltraWinGrid cell, setting the .Value changes the display to that value instead of the text value in the dropdown.

        For example, the dropdown text is "Default", the key value is 123, I set the .Value property to 123, and the dropdown displays cell didplays 123, instead of "Default"

        Thanks

      • 0
        Mike Saltzman
        Mike Saltzman answered on May 5, 2008 2:40 PM

        Hi James,

            What exactly do you mean when you say "UltraCombo in a UltraWinGrid cell"? Are you assign an UltraCombo to the EditorControl property of hte cell or the ValueList of the cell?

            Are you setting the Value property on the UltraCombo or on the grid cell? 

  • 0
    Mike Saltzman
    Mike Saltzman answered on May 6, 2008 2:46 PM

    Well.. there are a lot easier and more efficient ways to provide a dropdown in a cell that using UltraCombo as an EditorControl.

    Having said that, using an UltraCombo should work. Assigning the Value of the cell is the correct way to do this. Perhaps it has something to do with the event you are using? Maybe you are assigning the Value before the EditorControl? Or maybe the data type of the Value doesn’t match the data type of the items on the list.

    • 0
      Jim
      Jim answered on May 6, 2008 5:16 PM

      Thanks, I'll check out the link.

      I'm setting the Value property in the AfterRowInsert event of the grid, what event would you recommend to use?

      • 0
        Mike Saltzman
        Mike Saltzman answered on May 7, 2008 2:43 PM

        Well, asuming that you want to initialize the value of a new row that the user is just about to add, AfterRowInsert seems like a reasonable event to use.  

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Michael Hafner
Favorites
0
Replies
11
Created On
May 07, 2008
Last Post
17 years, 10 months ago

Suggested Discussions

Tags

Created by

Created on

May 7, 2008 2:43 PM

Last activity on

Feb 20, 2026 9:48 PM