I having problem with c# combo box control with multiple columns.
I have one combox with 2 columns:
code(char 5) desc(char10)
I using Add items to add in those code and desc, but the column position is out. I was thinking of taking the 5 minus the length of the code, say x = 5 - code.length(), and then put it as space(x), how can i add spaces string in c#? and how to get the CODE only as selected display value instead of code+desc ?
Is there any simple way to do it? Below is the code
private void Form1_Load(object sender, System.EventArgs e)
for (int i=0;i<2;i++)
s=5-col1.ToString ().Length ();
space=new String ("",s);
comboBox1.Items .Add (col1+space+col2);
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
//MessageBox.Show (comboBox1.Text.Substring (0,5));