DataGridView + Combobox set default and selected value

Get data from an Dataset and make it as selected value, of not select

Page 1 of 1

0 Replies - 5164 Views - Last Post: 05 August 2009 - 01:36 PM Rate Topic: -----

#1 micke   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 56
  • Joined: 25-August 08

DataGridView + Combobox set default and selected value

Post icon  Posted 05 August 2009 - 01:36 PM

Hi,

I have an DataGridView, that contains some columns this is filled from an DataSet

DataSet assetDS = assetsObj.GetAssetBySerialNumber(this.SelectedPortalId, this.sn); 


In one of the column i have an Combobox, that i have added 3 values

combo1.Items.Add("test1");
combo1.Items.Add("test2");
combo1.Items.Add("test3");


What i try to do is that if ex value test2 exist in the DataSet (assetDS) then it should make it Selected in the
comboBox, if not make value test1 as default

private string fieldStatus= "";
assetDS.Tables[0].Rows[0]["status"] = fieldStatus;


Thanks

Is This A Good Question/Topic? 0
  • +

Page 1 of 1