I am using a hierarchical dataset as datasource for my wintree. Because it consists of multiple layers I need the column headers displayed. However I also want the checkbox infront of the rows. Is there a way I can display the checkbox in the grid viewstyle ?
No, you can't get a checkbox to appear "in front of the rows". You can, however, have a column whose DataType is bool (or CheckState), which will cause a CheckEditor to be used by that column.
Thank you for helping me, how would I add a checkbox column to the wintree ? I cannot seem to find a checkboxcolumn type for the treeview.
YES! The answer is just as simple as I suspected.
On your node do:
UltraTreeNode utn = new UltraTreeNode();utn.Override.CellClickAction = CellClickAction.EditCell;
It now toggles. :)
Just out of curiosity how would you go about doing that with the designer ?The column doesn't have the override property available as far as I can see when you edit the column (Designer mode)
lunaios said: Just out of curiosity how would you go about doing that with the designer ?The column doesn't have the override property available as far as I can see when you edit the column (Designer mode)
Ok I just played around with the designer and found a much easier way to do this, even in my situation. Right click on your ultratree and go to "Custom Property Page" and click on the UltraTree at the highest level. The UltraTree has an Override and within this is CellClickAction which can be set for the whole tree. It seems to work the same as setting it for the individual node as I showed above but I think this is cleaner.
I found that option as well, but i find it kind of sloppy if users can edit the entire grid. Thus I would like a way to set it to the column only.
You still can't edit the other columns if they are set to not allow edits. I can only edit the one column. Make sure your other columns have AllowCellEdit set to Disabled.
I think overall this whole approach is pretty unintuitive but it seems to work now.
I am still having problems with the default value. I cannot seem to set a default value for the checkbox column. I keep getting the standard blue box. And I hate to have to loop through it to set the value to false.
No.. The CellClickAction property for the tree set to edit in the designer allows my column to toggle. That is the only column that can be edited because the allowedit property for the other columns are set to not allow edits. Allowing edits seems to be seperate from the cellclickaction. I'm just relaying what the Infragistics support told me was the solution to the problem.
The other thing I was talking about has to do with handling the event firing when the user toggles one of these boxes. The only thing I have to program is how I handle the event, the rest is handled through the designer.
So basically you created the toggle effect by programming around it ? Surely there has to be a better way to accomplish it ?
Ok nevermind. Just need to check the e.CurrentValue property. Not sure why I can't find this info through the node but at least I have it.
Ok now when I catch the CellValueChanged event, the event is fired correctly but I can't figure out how to check the value of the check box. node.Cells[mykey].Value seems to be permanently stuck on false, even if I checked the box. I set the value somewhere to false manually, if I don't, then value is set to null. I've looked through the properties and see that there is a CheckEditor (EditorResolved) but there are a bunch of exceptions in there and I can't get its value out.
Any idea whats going on? I just need the value of my checkbox when the user clicks the box..