Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Infragistic web tree does not cancel SelectionChanged event on client
posted

Hi,

I have a WebData Tree panel and details panel on the page. On SelectionChange event post back is happening and details of the node get populated from the server, but if node details are changed and another node is selected, I want to cancel SelectionChanged event. Drag/Drop is enabled, so when I cancel event during SelectionChanging, SelectionChanged is still called and new tree node stays selected and tree behaves as if it in the middle of drag/drop. So cancel does not wwork properly. Is it possible to cancel On SelectionChange event?

 

 

 

 

 

 

 

 

 

 

 

 

 

<ig:WebDataTree runat="server" ID="hierarchyTree" Style="float: left" Width="100%" Height="100%" EnableSingleBranchExpand="true"

 

 

Visible="true" SelectionType="Single" EnableConnectorLines="false" OnNodeBound="hierarchyTree_NodeBound" OnNodeClick

="hierarchyTree_OnNodeSelectionChanged"

 

 

OnNodeDropped="hierarchyTree_OnNodeDropped" StyleSetName="Claymation" OnNodePopulate="hierarchyTree_NodePopulate">

 

 

<DragDropSettings AllowDrop="true" DragDropMode="Move" EnableDragDrop="True" EnableDropInsertion="true" EnableExpandOnDrop

="true"/>

 

 

<AutoPostBackFlags NodeClick="On" NodeDropped="On" NodeExpanded="Off"

/>

 

 

<ClientEvents

 

 

NodeDropped="hierarchyTree_Drop"

 

 

SelectionChanged="hierarchyTree_AfterNodeSelectionChange"

 

 

SelectionChanging="hierarchyTree_BeforeNodeSelectionChange"

 

 

/>

 

 

</ig:WebDataTree

>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

function hierarchyTree_BeforeNodeSelectionChange(tree, oDataTransfer, e)

{

 

 

...

 

 

ret = ConfirmChanges(

false);

 

 

if (ret)

{

oDataTransfer.set_cancel(

true);

//or

 

 

tree._events.SelectionChanged.set_cancel(true);

//or

 

tree.CancelPostBack = true;

//or

oDataTransfer.cancel = true;

return false;

 

 

 

 

 

 

 

}

 

 

Thanks,