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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nikhil BichewarPosted Dec 27, 2014, 3:01 AM
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;
}
}
Jitendra KumarPosted Dec 26, 2014, 11:03 PM
Kindly share your code for more explain.