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
1060
UltraCombo Image With Text as DisplayMember
posted

I have a case where I have a datasource with an ID, a Code and an Image.

I have no problems data binding a tlist of that entity to a grid or an ultracombo to display it.

For this particular requirement, I want to have my usercontrol which uses a picture box and a ultralabel to show as the displaytext of the ultracombo.

So no only with I see the code and the image when i drop down (which I can do now) but whatever I choose, I will be able to see it in the display value area (the not dropped down combo)

 

Is that something that is doable ?

 

Thanks in advance

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    Okay... in that case, this is really easy. All you have to do is apply the image to the cell with the DisplayMember and the image of the selected item will show up in the edit portion of the control automatically. 

    If you image is in a separate column in the dropdown, then what I would do is hide that column:


            private void ultraCombo1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
               
                e.Layout.Bands[0].Columns["Image 1"].Hidden = true;
            }

     

    And then use InitializeRow to show that image in the DisplayMember column:


            private void ultraCombo1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
            {
                e.Row.Cells["String 1"].Appearance.Image = e.Row.Cells["Image 1"].Value;
            }

     

Children