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


Data binding to NTreeList - Columns loose width/alignment/visibility...
Author
Message
lars knox
lars knox
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
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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search