Dear all,
I have below code and don't know why in datasource=, it throw exception??
DataSet ds1 = new DataSet(); ds1.Tables.Add(this.itemListTable); ds1.Tables.Add(this.productListTable); ds1.Tables.Add(this.categoryListTable); ds1.Relations.Add(ds1.Tables["List1"].Columns["PromoCode"], ds1.Tables["ProductInfo"].Columns["PromoCode"]); ds1.Relations.Add(ds1.Tables["List1"].Columns["PromoCode"], ds1.Tables["CategoryInfo"].Columns["PromoCode"]);
this.ultraGrid1.DataSource = ds1; // throw exception here
Are you sure this is the call stack of the same exception? According to this call stack, the exception is not coming from the grid, it's coming from the refreshItemList method of your US_PromotionList class.
Neither the WinGrid nor any Infragistics assembly is listed anywhere in this call stack.
Actually, I don't find any datamember set or any events of the grid which is newly added.
at POS.UserControls.US_PromotionList.refreshItemList() in C:\VS2010\SingleStore\POS\POS.UserControls\UC_PromotionList.cs:line 575 at POS.UserControls.US_PromotionList..ctor() in C:\VS2010\SingleStore\POS\POS.UserControls\UC_PromotionList.cs:line 52 at POS.GUI.MainForm.InitializeComponent() in C:\VS2010\SingleStore\POS\POS.GUI\MainForm.Designer.cs:line 104 at POS.GUI.MainForm..ctor() in C:\VS2010\SingleStore\POS\POS.GUI\MainForm.cs:line 554 at POS.Terminal.Program.Main(String[] args) in C:\VS2010\SingleStore\POS\POS.Terminal\Program.cs:line 78
Hi,
Can you post the Call Stack of the exception?
It's hard to guess without that information. But my guesses would be: