title: multicolumn combo box in asp.net
body: <p>I have a Database table with two fields MainAccount and MainDescription table have following data MainAccount 10 MainDescription Capital,MainAccount 20 MainDescription Account Receiable,MainAccount 30 MainDescription Account Payable</p>
  
  <p>I have a asp.net page with DropDownList and a text box. I want to get all data in DropDownList here is my code</p>
  
  <pre><code>  protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
           using (SqlDataAdapter adapter = new SqlDataAdapter("select distinct MainAccount,MainDescription from chart", db.con))
          {
              DataTable datatable = new DataTable();
              adapter.Fill(datatable);
  
              List&lt;ListItem&gt; list = new List&lt;ListItem&gt;();
  
              foreach (DataRow dr in datatable.Rows)
              {
                  string descr = string.Format("{0} | {1}", dr[0].ToString(), dr[1].ToString());
                  list.Add(new ListItem(descr));
              }
  
              list = list.OrderBy(a =&gt; a.Text).ToList();
              DropDownList1.DataSource = list;
  
              DropDownList1.DataBind();
  
          }
      }
      }
  </code></pre>
  
  <p>this code is working fine to display all MainAccount and Main Description in DropDownList.</p>
  
  <p>This is what I have now:</p>
  
  <p><img src="https://i.stack.imgur.com/e8hli.png" alt="enter image description here"></p>
  
  <p>And this is the result I'm looking for:</p>
  
  <p><img src="https://i.stack.imgur.com/BNbTO.png" alt="enter image description here"></p>