المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Datagridview DataSource Change Auotmatically without need



C# Programming
01-15-2013, 10:40 AM
i set the dataSource to datagridview
DatTbl = CustomerManger.SelectCustomersAllDT(); //dattbl is datatable ds.Tables.Add(DatTbl); //ds is dataset DatTbl.TableName = "Customers"; dgvCustomers.DataSource = null; dgvCustomers.DataSource = ds; dgvCustomers.DataMember = "Customers"; then is selectionChange event i Select another data in list and before set it to listbox datasource .. datasource of datagrid change http://www.barakasoft.com/script/Forums/Images/smiley_mad.gif http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif and all columns and data of customer cleared and replaced by Notices ???????
private void dgvCustomers_SelectionChanged(object sender, EventArgs e) { NoticList NL=NoticeManager.SelectNoticesbyCustCD(newCust.CustId); } if i comment this line datasource of datagrid view doesn't change