Welcome Guest Search | Active Topics | Sign In | Register

TreeView ItemClick does not fire with populateondemand Options
Serge
Posted: Monday, December 8, 2008 5:36:06 AM
Rank: Newbie
Groups: Member

Joined: 12/8/2008
Posts: 6
Hi Guys,
I'm trying to handle ItemClick event for items populated on demand. For some reason event firesfor top level items only and after postback the tree collapses.
Please see my code bolow. Am I missing something? I've tried to populate nodes via databinding as well and still no luck.

protected void Page_Load(object sender, EventArgs e)
{
treeRegions.Nodes.AddRange(GetNodes(null));
}

protected void treeRegions_ItemPopulate(object sender, EO.Web.NavigationItemEventArgs e)
{
EO.Web.TreeNode parentNode = (EO.Web.TreeNode)e.NavigationItem;
parentNode.SubGroup.Nodes.AddRange(
GetNodes(
Convert.ToInt32(parentNode.Value)
));
}

private NavigationItem[] GetNodes(int? nodeValue)
{
Region[] regions = RegionsBll.GetChildren(nodeValue);
return Array.ConvertAll<Region, NavigationItem>(regions, ToNavigationItem);
}

private NavigationItem ToNavigationItem(Region region)
{
// TreeNode is NavigationItem
EO.Web.TreeNode item = new EO.Web.TreeNode();
item.Value = region.RegionId.ToString();
item.Text = region.Name;
item.PopulateOnDemand = true;
item.RaisesServerEvent = NullableBool.True;
return item;
}

protected void treeRegions_ItemClick(object sender, NavigationItemEventArgs e)
{
txtSelectedRegionName.Text = e.NavigationItem.Value;
}
Dll version: 6.0.51.2

Thank you,
Serge
eo_support
Posted: Monday, December 8, 2008 6:15:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Hi,

We have replied you via private message. You can click "Inbox" on the top of the forum to view the message.

Thanks!
Serge
Posted: Monday, December 8, 2008 10:01:54 PM
Rank: Newbie
Groups: Member

Joined: 12/8/2008
Posts: 6
eo_support wrote:
Hi,

We have replied you via private message. You can click "Inbox" on the top of the forum to view the message.

Thanks!


For some reason it workes inside DetailsView > InsertItemTemplate, but it doesn't inside GridView > EditItemTemplate. Inside detailsView it keeps on appending copies. Turning off treeview's viewstate seems to solve both of these issues. Another issue just came up. With any child node selected, click on any other child node will reset the tree (ItemPopulate will not fire)

Thanks!
eo_support
Posted: Tuesday, December 9, 2008 5:06:09 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Hi,

Can you create a test page/project for us to demonstrate both problems?

Thanks!
Serge
Posted: Tuesday, December 9, 2008 5:48:04 AM
Rank: Newbie
Groups: Member

Joined: 12/8/2008
Posts: 6
I can send you pages I am creating. Where do you want me to send them to? Basically this is what I am doing now:
TreeView is inside web UserControl
UserConrol is inside DetailsView > InsertItemTemplate and
UserControl is inside GridView > UpdateItemTemplate
Code behind for user control hasn't changed (see my first post)
Page itself only binds gridView
That's all
Thanks
Serge
Amiran
Posted: Thursday, January 29, 2009 9:44:08 AM
Rank: Member
Groups: Member

Joined: 11/21/2008
Posts: 15
Serge wrote:
Hi Guys,
I'm trying to handle ItemClick event for items populated on demand. For some reason event firesfor top level items only and after postback the tree collapses.
Please see my code bolow.


I have the same problem.
eo_support
Posted: Thursday, January 29, 2009 9:49:32 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Amiran wrote:
I have the same problem.


Please check the latest build first. I believe this has been fixed since 2008.0.55.

Thanks
Amiran
Posted: Friday, January 30, 2009 8:30:48 AM
Rank: Member
Groups: Member

Joined: 11/21/2008
Posts: 15
eo_support wrote:
Amiran wrote:
I have the same problem.


Please check the latest build first. I believe this has been fixed since 2008.0.55.

Thanks


Hi,

I tried to install last build (2008.0.62), but I still have this problem.

eo_support
Posted: Friday, January 30, 2009 8:58:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,089
Hi,

Both us and other user have verified that the problem has been fixed. If you continue to have problem, please create a test product that reproduces the problem and send it to us. We will PM as to where to send. Please include detailed step by step instruction to reproduce the problem and make sure the test project can run independently.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.