Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
columnset dynamically in ultratree
posted

Hello

I am facing problem in setting the columnset dynamically in ultratree,

Ex: I am modifing the node's columnset in one of the events after the initial columnset is set
for (int i = 0; i < nodes.Length && nodes[i] != "value"; i++)
                        {                            
                            node = GetNode();
                        }
                        if (mapEntry.stringarray == null)
                        {
                            node.Cells["Value"].EditorComponent = GetVariableParameter();
                            node.Override.ColumnSet = this.Criterias.CriteriaTree.ColumnSettings.ColumnSets["STRING"];
                            node.Cells["Value"].Value = mapEntry.@string[1];
                        }
//Designer
            ultraTreeNodeColumn31.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.ActivateOnly;
            ultraTreeNodeColumn31.DataType = typeof(string);
            ultraTreeNodeColumn31.Key = "Err";
            ultraTreeNodeColumn31.LayoutInfo.PreferredCellSize = new System.Drawing.Size(26, 24);
            ultraTreeNodeColumn32.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.ActivateOnly;
            ultraTreeNodeColumn32.Key = "Field";
            ultraTreeNodeColumn32.LayoutInfo.PreferredCellSize = new System.Drawing.Size(200, 24);
            ultraTreeNodeColumn33.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn33.DataType = typeof(string);
            ultraTreeNodeColumn33.Key = "Operator";
            ultraTreeNodeColumn33.LayoutInfo.PreferredCellSize = new System.Drawing.Size(100, 24);
            ultraTreeNodeColumn34.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn34.DataType = typeof(string);
            ultraTreeNodeColumn34.Key = "Value";
            ultraTreeNodeColumn34.LayoutInfo.PreferredCellSize = new System.Drawing.Size(150, 24);
            ultraTreeNodeColumn35.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn35.DataType = typeof(bool);
            ultraTreeNodeColumn35.Key = "Ask";
            ultraTreeNodeColumn35.LayoutInfo.PreferredCellSize = new System.Drawing.Size(40, 24);
            ultraTreeNodeColumn36.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn36.Key = "Remove";
            ultraTreeNodeColumn36.LayoutInfo.PreferredCellSize = new System.Drawing.Size(75, 24);
            ultraTreeNodeColumn54.Key = "Temp";
            ultraTreeNodeColumn54.Visible = false;
            ultraTreeColumnSet6.Columns.Add(ultraTreeNodeColumn31);
            ultraTreeColumnSet6.Columns.Add(ultraTreeNodeColumn32);
            ultraTreeColumnSet6.Columns.Add(ultraTreeNodeColumn33);
            ultraTreeColumnSet6.Columns.Add(ultraTreeNodeColumn34);
            ultraTreeColumnSet6.Columns.Add(ultraTreeNodeColumn35);
            ultraTreeColumnSet6.Columns.Add(ultraTreeNodeColumn36);
            ultraTreeColumnSet6.Columns.Add(ultraTreeNodeColumn54);
            ultraTreeColumnSet6.Key = "STRING";
            ultraTreeNodeColumn19.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.ActivateOnly;
            ultraTreeNodeColumn19.Key = "Err";
            ultraTreeNodeColumn19.LayoutInfo.PreferredCellSize = new System.Drawing.Size(26, 24);
            ultraTreeNodeColumn20.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.ActivateOnly;
            ultraTreeNodeColumn20.Key = "Field";
            ultraTreeNodeColumn20.LayoutInfo.PreferredCellSize = new System.Drawing.Size(200, 24);
            ultraTreeNodeColumn21.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn21.Key = "Operator";
            ultraTreeNodeColumn21.LayoutInfo.PreferredCellSize = new System.Drawing.Size(100, 24);
            ultraTreeNodeColumn22.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn22.DataType = typeof(System.DateTime);
            ultraTreeNodeColumn22.Format = "dd/MM/yyyy hh:mm:ss";
            ultraTreeNodeColumn22.FormatProvider = new System.Globalization.CultureInfo("fr-FR");
            ultraTreeNodeColumn22.Key = "Value";
            ultraTreeNodeColumn22.LayoutInfo.PreferredCellSize = new System.Drawing.Size(150, 24);
            ultraTreeNodeColumn23.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn23.DataType = typeof(bool);
            ultraTreeNodeColumn23.Key = "Ask";
            ultraTreeNodeColumn23.LayoutInfo.PreferredCellSize = new System.Drawing.Size(40, 24);
            ultraTreeNodeColumn24.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full;
            ultraTreeNodeColumn24.Key = "Remove";
            ultraTreeNodeColumn24.LayoutInfo.PreferredCellSize = new System.Drawing.Size(75, 24);
            ultraTreeNodeColumn52.Key = "Temp";
            ultraTreeNodeColumn52.Visible = false;
            ultraTreeColumnSet4.Columns.Add(ultraTreeNodeColumn19);
            ultraTreeColumnSet4.Columns.Add(ultraTreeNodeColumn20);
            ultraTreeColumnSet4.Columns.Add(ultraTreeNodeColumn21);
            ultraTreeColumnSet4.Columns.Add(ultraTreeNodeColumn22);
            ultraTreeColumnSet4.Columns.Add(ultraTreeNodeColumn23);
            ultraTreeColumnSet4.Columns.Add(ultraTreeNodeColumn24);
            ultraTreeColumnSet4.Columns.Add(ultraTreeNodeColumn52);
            ultraTreeColumnSet4.Key = "DATETIME";

before assigning the columnset["STRING"] , node had "DATETIME" as columnset value
After assigning though its displaying columnset as ["STRING"], its datatype is still "DateTime"

Could you please help me out?

(One more very strange thing if i debug (f10) indeed the datatype will also get changed to String, but if i just execute  Datatype will set to "DATETIME" and Columnset "STRING")

  • 71886
    Offline posted

    Hello,

    I wanted to know if you were able to solve your issue based on these suggestions or you still need help? Please let me know.

  • 469350
    Offline posted

    Hi,

    I'm not sure I am following you.

    roopashree said:
    After assigning though its displaying columnset as ["STRING"], its datatype is still "DateTime"

    The DataType of what? Are you referring to a particular column in the ColumnSet?

    It sounds like maybe you are setting the ColumnSet and then immediately trying to access a Cell on the node and the cell hasn't updated, yet. If that's the case, it sounds like a bug. Are you able to reproduce this in a small sample project and post it here so we can check it out? 

    If putting a breakpoint in the code solves the issue, then it's probably just a matter of forcing the control to paint in order to update the cells. Try calling the Update method on the tree right before you try to access the cell and see if that helps.