Set BO position to "Nothing" to clear data binded controls


Author
Message
Leonard P.
Leonard P.
StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)
Group: Awaiting Activation
Posts: 65, Visits: 306
Hello,

I have a TreeView on the form with categories as the most top nodes with children subnode. Each child node has a BO PK stored in the Tag property. When user clicks on a child node, I am changing the position of BO by calling .NavigateToPrimaryKey(pkId), and all data-binded controls get refreshed.

Everything works great, but when the user clicks the top node (main Category), I want to clear all data-binded controls to indicate that no object is selected. How can I do that?

I would think that something like: bo.Navigate(BusinessNavigationDirection.Absolute, 0);
 or bo.Navigate(BusinessNavigationDirection.Absolute, -1) would work, but it has no effect on BO position.

Thank you


Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Leonard P. (08/19/2008)
Hello,

I have a TreeView on the form with categories as the most top nodes with children subnode. Each child node has a BO PK stored in the Tag property. When user clicks on a child node, I am changing the position of BO by calling .NavigateToPrimaryKey(pkId), and all data-binded controls get refreshed.

Everything works great, but when the user clicks the top node (main Category), I want to clear all data-binded controls to indicate that no object is selected. How can I do that?

I would think that something like: bo.Navigate(BusinessNavigationDirection.Absolute, 0);
 or bo.Navigate(BusinessNavigationDirection.Absolute, -1) would work, but it has no effect on BO position.

Thank you

Hi Leonard,

I am not sure how you can do it the way you want it, but if you use an SP PanelManager, you can have 2 panels, one for the Top nodes with any message that will indicate the user that it iis on a Top node and one for children with all field details, then in your TreeView you control which panel to display based on the user selecting a Top or Child node.

Edhy Rijo

Leonard P.
Leonard P.
StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)StrataFrame Novice (79 reputation)
Group: Awaiting Activation
Posts: 65, Visits: 306
Thanks Edhy!

That's a good idea.

Also What I tried, and so far it looks pretty good, is to select the first BO in that category when user clicks on the parent category node. Of course what users might think of this "feature" is another story Smile

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (652 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
Edhy's solution is the cleanest, and is generally what we do. There isn't really a way to set a business object to a "nothing" state. Due to the way the currentrowindex works, it turn things a bit wonky if you couldn't rely on that to point to actual data within the BO Smile.



Take a look at the business object mapper's functionality. When you click on a parent node, it shows you a message with some action items. When you click on a child node, it shows you any built fields. This is what Edhy was talking about with the panel manager approach, and is the kind of thing we do in the same situation.
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