3
Answers

how to use radcombobox

Carlos kambui

Carlos kambui

8y
412
1
below are my codes, working excellent but problem is ,whenever i select item from combobox it selects well but whenever i insert it insert only the first item i.e i have selected item no 2 and its primary key is 1 it will keep inserting the first item 
private void Load()
{
tsuppliertrans = SvcClient.GetSuppliertrans();
drvSupptrans.DataSource = tsuppliertrans;
drvSupptrans.DataBind();
tproducts = SvcClient.GetAccs();
rdcAccesoryid.DataSource = tproducts;
rdcAccesoryid.DataValueField = "acc_id";
rdcAccesoryid.DataTextField = "acc_description";
rdcAccesoryid.DataBind();
tsupplier = SvcClient.GetSuppliers();
rdsuppid.DataSource = tsupplier;
rdsuppid.DataValueField = "supplier_id";
rdsuppid.DataTextField = "supplier_name";
rdsuppid.DataBind();
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
suppliertrans.product_id = Convert.ToInt32(rdcAccesoryid.SelectedValue);
suppliertrans.supplier_id = Convert.ToInt32(rdsuppid.SelectedValue.ToString());
suppliertrans.date_of_purchase = Convert.ToDateTime(rdtpDate.SelectedDate);
suppliertrans.Mode_of_payments = rdcmodeofpayment.SelectedValue.ToString();
suppliertrans.amount_paid = Convert.ToDecimal(tdtAmount.Text);
suppliertrans.balance = Convert.ToDecimal(rdtxtRuningbalance.Text);
suppliertrans = SvcClient.SetSuppliertrans(suppliertrans);
 
kindly help 
Answers (3)