View previous topic :: View next topic |
Author |
Message |
elephant Guest
|
Posted: Thu Dec 08, 2005 5:26 pm Post subject: Programatic binding of columns |
|
|
I am new to vb.net and struggling with a task. I am desparate for help with databinding for a treeview with details, I am struggling to work out how to do this.
Because of the way the data is set up I have to programatically create the treeview but I can't work out how to bind the columns holding the details.
I have used the Programmatic Binding Sample as the basis for the treeview part and added icons to flag certain conditions.
I know what I would like to display and I have added the columns in the Treeview list at design time. However I cannot work out how to bind the details exposed by my code to the columns.
I do not understand the options for binding at design time and am not sure if this might be the easy way to do this if I knew how.
please can someone help. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Dec 09, 2005 11:09 am Post subject: |
|
|
Thanks for the extra information you emailed regarding this. All you need to do is to add some extra code to the _virtualTree_GetCellData event handler method to return the data to display in the other columns eg
Code: |
If e.Column Is Me.colMain Then
e.CellData.Value = Project.Name
else if e.Column is Me.colVariant Then
e.CellData.Value = Project.strvariant
else if e.Column is Me.colTitle Then
e.CellData.Value = Project.issue
' etc...
End If
|
Actually from the code you sent it looks like it would be fairly easy to use standard ObjectBinding instead of doing this programmatically. The main advantage of this is that it relieves you of the tedium of writing code like the above. You could maybe consider this at a later stage when you have more time. _________________ Infralution Support |
|
Back to top |
|
|
Elephant Guest
|
Posted: Fri Dec 09, 2005 12:38 pm Post subject: Programatically adding Columns |
|
|
Thank you I can't believe it was so simple .
I will look into the object binding when I get a chance as I think it will be simpler but this gets me going.
Thank you for an excellent tool . |
|
Back to top |
|
|
|