I am working on WPF application. I have a window which has “Combobox” and “Textboxes”. Well, I want to display the selected combobox values in textbox. (Combo Box displays the concatenated string firstname+lastname+initials). But I have two text box for firstname & second name. I want to display only “firstname” in first text box and “last name” in second text box.
I wrote the below code. IT displays the values but concatenated. IS there any way I can just display first name in first text box and last name in second text box.
Thanks.
FNSysEngnrTextBox.Text = SysEngnrCB.SelectedItem.ToString
LNSysEngnrTextBox.Text = SysEngnrCB.SelectedItem.ToString
Since
SelectedItemis anObjectyou get the full Type prefacing your data when you use theToStringMethod. I was able to get the result you were looking for by using String.Split. See if this works for you.