Group: Forum Members
Last Active: 13 Years Ago
Posts: 22,
Visits: 1
|
Hi,
I have a data table bound to an NTreeList via an NTreeListTableData object. Right after I bind the data, I set some additional property values on the NTreeListColumns like this:
NTreeListTableData data = new NTreeListTableData(); data.Table = _dtHoldings; data.Bind(dgHoldings);
foreach (DataColumn dc in _dtHoldings.Columns) { NTreeListColumn col = dgHoldings.Columns[dc.ColumnName]; col.Width = int.Parse(dc.ExtendedProperties["width"].ToString()); col.Visible = bool.Parse(dc.ExtendedProperties["isVisible"].ToString()); col.ContentAlign = (ContentAlignment)dc.ExtendedProperties["contentAlignment"]; }
Unforutnately, when the underlying data table (the _dtHoldings object) changes - all of the NTreeListColumns lose the properties I set above (width/visible/contentAlign). Here is the code that updates the data table:
dgHoldings.SuspendLayout();
foreach (DataRow drv in _dtHoldings.Rows) { if (drv["Symbol"].ToString() == newEventArgs.Tick.SymbolName) drv["CurrentPrice"] = newEventArgs.Tick.LastPrice.ToString(_nonCurrencyPrice); }
dgHoldings.ResumeLayout();
What am I doing wrong? How can I change the data in the data table and have it reflected in the NTreeList without losing the property values for width, visible and contentAlign?
Thank you,
Lars
|