Hi sir...
I want to.
filtering records from 1st combobox to 2nd combobox and 2nd to 1rd combobox
using window form..
I have try but it only Working for 1st combo box
plz give me solution as early as possible..
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jitendra KumarRank #760 · 3K reputationPosted Dec 26, 2014, 6:03 PM EST
Kindly share your code for more explain.
Nikhil BichewarRank #8,588 · 219 reputationPosted Dec 26, 2014, 10:01 PM EST
i have trying bind 1st combobox to 2nd but not bind 2nd combobox to first combobox
//customername combobox bind code:
protected void bindcust()
{
var a = (from p in ap.Addaccounts select new { fullname = p.FirstNm + " " + p.MiddelNm + " " + p.LastNm, p.CustID }).ToList();
comCustName.DataSource = a;
comCustName.DisplayMember = "fullname";
comCustName.ValueMember = "CustId";
}
//acccount combobox bind code:-
protected void bindacno()
{
var acno = (from n in ap.Addaccounts select new { n.CustID, n.AcNo }).ToList();
cmbacno.DataSource = acno;
cmbacno.DisplayMember = "AcNo";
cmbacno.ValueMember = "CustId";
}
//comboboxcustomername selectedindexchanged
{
var custid = (from p in ap.Addaccounts where p.CustID == Convert.ToInt32(comCustName.SelectedValue) select new { p.AcNo }).ToList();
foreach (var i in custid)
{
comAcNo.SelectedIndex = -1;
string accountno = (i.AcNo);
comAcNo.Text = accountno;
}
}
//combo box accountno selected index changed
{
var name = (from v in ap.Addaccounts where (v.AcNo) == (comAcNo.SelectedText) select new { fullname = v.FirstNm + " " + v.MiddelNm + "" + v.LastNm, v.CustID }).ToList();
foreach (var j in name)
{
//custname.SelectedItem = -1;
string fname = j.fullname;
comCustName.Text = fname;
}
}