Welcome Guest Search | Active Topics | Sign In | Register

TreeView, edit node and raises server event Options
ITMA
Posted: Wednesday, September 14, 2011 8:14:54 AM
Rank: Advanced Member
Groups: Member

Joined: 6/23/2010
Posts: 48
Hi

Regarding ”TreeView” and ”Raises Server Event”.

My assumption or understanding is that:
To update something on the server I need ”Raises Server Event” = TRUE.

Case:
When I want to edit the text for a selected node, I must double click it to enter the edit mode.

Result:
Before I’m able to edit the text, the TreeView enters its original state, not edit mode because the TreeView raises this server event.

My issue is:
Please advice how to work around this, or is it a conceptual aspect that I’m not in line with?

Thanks!!



Best Regards,

ITMA


eo_support
Posted: Wednesday, September 14, 2011 12:33:57 PM
Rank: Administration
Groups: Administration

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

You understood is correctly. You cannot have the TreeView's RasisesServerEvent and node editing at the same time. The usual way to do this is to have somebody else to raises the server event. For example, you can have a "Save" button to save the changes for you. Or you can handle the TreeView's ClientSideOnNodeRename event (this event is called when the node leaves edit mode) and then use JavaScript to trigger post back (make sure you use setTimeout to delay the postback, this allows your handler to return before the post back occurs). Either way the idea is not letting the TreeView to do the post back for you.

Thanks!
ITMA
Posted: Thursday, September 15, 2011 6:33:48 AM
Rank: Advanced Member
Groups: Member

Joined: 6/23/2010
Posts: 48
Again, Hi

Thanks for your reply that was highly appreciated!


I followed your advice with a delay like below when calling with “ClientSideOnDragDrop”:
____________________________________________________________________________
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ContentMenu.aspx.vb" Inherits="Default_Controls_WebUsrCntrl_ContentMenu_ContentMenu" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link id="lnk" runat="server" rel="stylesheet" type="text/css"/>
</head>
<body>

<script type="text/javascript">

function NodeMove() {
window.setTimeout(btnTW1_Move, 1000);
}

function btnTW1_Move() {
__doPostBack('btnTW1_Move', ''); ;
}

</script>

<form id="form1" runat="server">
<asp:Button ID="btnTW1_Move" runat="server" Text="btnTW1_Move" />

[…]
____________________________________________________________________________

Within a “CallbackPanel” triggered by “btnTW1_Move” the datasource becames updated according to your example code. Just Great!!!

However, when dropping on a node it becomes a child of that node, of course.

That gives the need of something on client side that makes it possible to drop between the nodes, as it works by standard using the treview "RaisesServerEvent" set to true.

My need i something like a client side event as "ClientSideInBetweenDrop"

I'm on a path to a solution. Please advice how to proceed.

Again, Thanks!!


Best Regards,

ITMA

eo_support
Posted: Thursday, September 15, 2011 9:36:18 AM
Rank: Administration
Groups: Administration

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

The event is the same for both dropping as a child nodes and dropping in between two nodes. In order to use dropping in between two nodes, you must set AllowDragReordering to true.

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.