Link to home
Create AccountLog in
Avatar of camdempster
camdempster

asked on

Why is the selectedtext in the combobox aligned the to the right where every other item is aligned to the left.

Following is a code snippet

cboSystemStatus.DataSource = objRPlayer.GetSystemStatusDescriptions();   // <- Datatable prepopulated from stored procedure
cboSystemStatus.ValueMember = "systemStatusID".ToString().Trim();
cboSystemStatus.DisplayMember = "SystemStatusDescription".ToString().Trim();
//cboSystemStatus.SelectedValue = objRPlayer.SystemStatusID;


Now every thing appears perfectly when i drop down my combobox.   All Display members appear perfectly.   No problem there....


When i select an item in the combobox.  The selected displaymember appears to be cut off by the first few characters.  As if the trim function is not being preformed correctly and being aligned from the right hand side.

I'm a bit of a newbie with windows forms.  Can somebody tell my why only the selected text is out of place?????

Thanks in Advance



ASKER CERTIFIED SOLUTION
Avatar of vinhnl
vinhnl

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of camdempster
camdempster

ASKER

Bang on VINHNL,



Thanks dude, worked perfectly.  Is there not an easier way of doing it though?  I just thought I could trim the column rather than traverse through and trim each cell?