View previous topic :: View next topic |
Author |
Message |
GreyCloud
Joined: 13 Nov 2008 Posts: 19
|
Posted: Mon Feb 08, 2010 5:14 pm Post subject: Add Column with Caption |
|
|
I have spotted the following doesn't seem to work - the new column has the correct name but it does not have the caption (its empty)? is this property over written on adding the column?
Code: |
Column column = new Column {
Name = "NewColumn" + (this.VarTree.Columns.Count + 1),
Caption = "New Column" + (this.VarTree.Columns.Count + 1),
Sortable = false
};
this.VarTree.Columns.Add(new Column());
|
|
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Feb 08, 2010 9:39 pm Post subject: |
|
|
It took me a little while to see the obvious problem in your code. When you add the column to the tree.Columns collection you are actually creating a new column (instead of passing the column you created previously). The new column doesn't have a caption. _________________ Infralution Support |
|
Back to top |
|
|
GreyCloud
Joined: 13 Nov 2008 Posts: 19
|
Posted: Wed Feb 10, 2010 11:05 am Post subject: |
|
|
Meh good catch!
I dont know how i didnt spot that |
|
Back to top |
|
|
|