This is a hack that needs some help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • A

    This is a hack that needs some help

    Hi Group,

    I am trying to find how to insert a blank combo box option in my list of
    available choices thus representing no choice. I have a total hack right
    now below



    DataTable dt = Facility.GetDat aTable;

    //hack starts

    DataRow dr = dt.NewRow();
    dr["colA"] = string.Empty;
    dr["colB"] = string.Empty;
    dt.Rows.InsertA t(dr,0);

    cboRef.DataSour ce = dt;
    cboRef.ValueMem ber = "colA";
    cboef.DisplayMe mber= "colB";


    As you can see, I am using data binding and so I am not sure how to insert a
    blanck row any other way than throught the data rows collection. This is
    causing a crash when I try to set the SelectedItem property later.



    Any help?


Working...