Hi,
We use UltraCombo and sometimes data will be displayed in the drop down to user like "* HIIAMHERE" wherin "* " (asterisk and space) indicates it is some important information etc. What we would like to have is when user selects this row, text must be set as "HIIAMHERE" in the combo's textbox and then TextChanged event must get fired.
Thanks in Advance.
It sounds to me like you just need to use the ValueMember and DIsplayMember properties. You could add an unbound column to your UltraCombo and use the InitializeRow event to populate this unbound column with the strings you want the user to see. Then you just set the DisplayMember property to the key of the unbound column. You would set the ValueMember property to the "real" column and so the combo would return the ValueMember column value as the control's Value and the unbound column text as the Text property.
Hi Mike,
Thanks for your quick reply. If would be great if you could provide us with a sample code snippet which will illustrate the intended behaviour as we are pretty new to Infragistics.
Him
It's hard to give you sample code since I'm really not clear on what your data source looks like.
Typically, you could not use a string as the Value of a combo - most of the time, you would use a numeric key of some sort and then use the ValueMember and DisplayMember so that the user sees a more user-friendly string while at the same time you application deals with the key value.
I'm not sure what you mean in your last post about the first column. The position of the columns is irrelevant. You tell the Combo which column is the value column using the ValueMember property. And you tell the combo which column is the display column via the DisplayMember property.
Here's a simple code snippet which shows you how to add an unbound column to the combo called "My Column". And also shows how to use InitializeRow to get the text from the real column ("Column 0") and set the value of "My Column" to a modified string.
private void ultraCombo1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { if (false == e.Layout.Bands[0].Columns.Exists("My Column")) { UltraGridColumn column = e.Layout.Bands[0].Columns.Add("My Column"); } } private void ultraCombo1_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells.Exists("My Column")) { string originalText = e.Row.Cells["Column 0"].Text; e.Row.Cells["My Column"].Value = originalText.Substring(5); } }
One more point to be noted here is that we have multiple columns and display of text is w.r.t first column. So the special characters come into picture w.r.t first column and when user selects it, we would like to have the text stripped of all special characters.