Profile Picture

Data binding to NTreeList - Columns loose width/alignment/visibility settings when data source...

Posted By lars knox 13 Years Ago

Data binding to NTreeList - Columns loose width/alignment/visibility...

Author
Message
lars knox
Posted 13 Years Ago
View Quick Profile
Junior Member

Junior Member (22 reputation)Junior Member (22 reputation)Junior Member (22 reputation)Junior Member (22 reputation)Junior Member (22 reputation)Junior Member (22 reputation)Junior Member (22 reputation)Junior Member (22 reputation)Junior Member (22 reputation)

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





Similar Topics


Reading This Topic