Hi Everyone,
I would like to know whether we can display e,g, Full Name , thats is " [first_name] + " "+ [surname]" as the display text?
I have set the combo's DataSource and DataMember as the [first_name]. But I need to display first name and surname as the Full name for the combo values.
e.g.
Ann Smith
David Brown
Mary Cornell
ultraGridColumn.Formula = "[surname] & \", \" & [first_name]";
Any suggestions?? Urgent!
Thanks in Advance.
NW
I'm not sure if this is the issue, but one thing I notice here is that you are setting the DisplayMember in the InitializeRow event. This is probably not a good idea and it's certainly not very efficient. You only need to set this property once in the InitializeLayout. Setting it in InitializeRow sets it over and over again for no reason.
Also, you kinda lost me at the end of your description there. If the ValueMember of the combo is using the "oper_nam" field, then why are you saetting the Value to a recipient value? The Value of the combo has to match up to an item on the list exactly. So why not use the "oper_name"?
HI Mike!
Theres one more problem. When the form loads, i want to set a particular value selected in the UltraCombo . e.g. John Smith, wihch is retrive from the DataTable,.When I read the other posts that can be done setting the Value property.
I have set my ValueMember as "oper_name", which is a string:
this.ucMsgSentTo.ValueMember = "oper_name";
this.ucMsgSentTo.DataSource = this.operatorBindingSource;
this.ucMsgSentTo.DropDownStyle =DropDownList
And also set the Display Member:
{
}
Then i have set the oper_name string value, which is similar to "reciepeint" value, to ucMsgSentTo.Value e.g. "johns"
ucMsgSentTo.Value = _row["recipient"].ToString();
Now when we set like this, it should show the "John Smith" on the combo wehn loading, BUT IT IS NOT!!! it shows blank in the Combo Text, but when i select the drop down button, it shows the "John Smith" on top of the list. I want to show the "John Smith" when loading.
Whats wrong with this coding? Please help ..its urgent...
Thanks alot.
Thanks Mike! Works wonderfully!!
Hi,
What you can do is add an unbound column to your UltraCombo. I would recommend using the InitializeLayout for this.
You can then apply a formula to this column like you have above. Or, you could use the InitializeRow event to populate this unbound column with whatever text you want. Then you just set the DisplayMember to the unbound column.