I have a DropDown that I set as the ValueList to a column in a WinGrid(2008 vol 3). The dropdown values are built from LINK to SQl call. I return a List<Table>. However, everytime I try to change the value I get this error.
Here is the code I use.
private void ugSystem_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { Infragistics.Win.UltraWinGrid.UltraDropDown udd;
udd = new Infragistics.Win.UltraWinGrid.UltraDropDown(); udd.DataSource = b.PIFactory.GetFactSystemAttributeName().GetDropDown(); udd.ValueMember = "attributeNameID"; udd.DisplayMember = "description";
e.Layout.Bands["SystemAttributes"].Columns["attributeNameID"].ValueList = udd; }
That's probably because linq doesn't allow you to change a foreign key value if the parent table is loaded. I'm using WCF between the UI and data layers, but if you don't use that, you can try:
1. Don't bind Table<> but an array.
2. If the above doesn't help, try loading the value list with a different context.
There is also an article about that:
http://news.infragistics.com/winforms/codesamples/changing-foreign-key-using-linq-to-sql-and-ultracombo.aspx