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

Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Lars,

Sorry, that we didn't respond to your problem. We are trying to reproduce the exception that you described but without success.

I would like to ask you a couple of questions that might help us to identify the problem:

Is this problem appears after you override PopulateColumns?

Could you send us the settings of the NTreeList control and what data you are trying to bind?

Thanks and sorry for the inconvenience.



Best Regards,
Nevron Support Team


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