If
Me
.RBDestination.SelectedValue = 0
Then
'simple
Me
.TrMultiple.Visible =
False
ElseIf
Me
.RBDestination.SelectedValue = 1
Then
'multiple
Me
.TrMultiple.Visible =
True
End
If
If
Not
IsPostBack =
True
Then
RBDestination.SelectedValue = 0
RBDestination_SelectedIndexChanged(
Me
, EventArgs.Empty)
End
If
<
asp:RadioButtonList
ID
=
"RBDestination"
runat
=
"server"
BorderColor
=
"Black"
BorderWidth
=
"1"
AutoPostBack
=
"true"
>
<
asp:ListItem
Value
=
"0"
>Destination simple</
asp:ListItem
>
<
asp:ListItem
Value
=
"1"
>Destination multiple</
asp:ListItem
>
</
asp:RadioButtonList
>
<
tr
id
=
"TrMultiple"
runat
=
"server"
>
<
td
></
td
>
<
td
>
<
telerik:RadGrid
ID
=
"RadGrid2"
Skin
=
"Vista"
runat
=
"server"
ShowFooter
=
"true"
CommandItemStyle-HorizontalAlign
=
"Center"
Width
=
"200px"
>
<
MasterTableView
ShowFooter
=
"true"
CommandItemDisplay
=
"bottom"
EditMode
=
"InPlace"
>
<
CommandItemTemplate
>
<
asp:LinkButton
ID
=
"LinkButton1"
CommandName
=
"CalculDistance"
Runat
=
"server"
CssClass
=
"TexteBlanc16"
>Calculer</
asp:LinkButton
>
</
CommandItemTemplate
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"CodePostal"
HeaderText
=
"Destinations"
>
<
ItemTemplate
>
<
asp:DropDownList
ID
=
"LstCodePostal"
runat
=
"server"
></
asp:DropDownList
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="2147483644" /> </webServices> </scripting> </system.web.extensions>but with no luck.
protected void rtvMain_NodeExpand(object sender, RadTreeNodeEventArgs e)
{
// Logic/Breakpoint here
}
function ExpandSelectedNode() {
var tree = $find("<%= rtvMain.ClientID %>");
if (tree.get_selectedNode() != null) {
var selectedNode = tree.get_selectedNode();
selectedNode.expand();
}
}
After the ajax/partial postback I call the javascript function by registering a startup script. I use ScriptManager.RegisterStartupScript and call my javascript function "ExpandSelectedNode()"
In the treeview I see the default loading animation appear on the selected node, which would indicated it is performing an asynchronous operation. The problem is that the server side handler "rtvMain_NodeExpand()" never gets called.
However, when I click the [+] next to the treeview item the postback is fired and it calls "rtvMain_NodeExpand()" as it should. This tells me that my treeview and its nodes are configured properly. So I have to assume there is a bug in the RadTreeNode.expand() client side method that is preventing it from firing the server side callback.