hi telerik team
how i can bind telerik tree whit WebServiceSettings and passed other parameter that
for example
| <telerik:RadTreeView |
| ID="RadTreeView1" runat="server" |
| Width="100%" SkinID="TreeTelerik" |
| LoadingStatusPosition="AfterNodeText" |
| > |
| <ExpandAnimation Type="InQuad" /> |
| <CollapseAnimation Type="InOutBack" /> |
| <WebServiceSettings Path="TreeContent.asmx" Method="GetTreeViewContent" /> |
| <Nodes> |
| <telerik:RadTreeNode Text="root node" Value="0" ExpandMode="WebService" |
| Selected="True" /> |
| </Nodes> |
| </telerik:RadTreeView> |
| using System; | |
| using System.Web; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Collections.Specialized; | |
| using System.Configuration; | |
| using System.Data; | |
| using System.Data.SqlClient; | |
| using System.Threading; | |
| using System.Web.Script.Services; | |
| using System.Web.Services; | |
| using System.Web.Services.Protocols; | |
| using Telerik.Web.UI; | |
| [ScriptService] | |
| public class TreeContent : WebService | |
| { | |
| [WebMethod] | |
| public RadTreeNodeData[] GetTreeViewContent(RadTreeNodeData node, object context) | |
| { | |
| IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context; | |
| DataTable productCategories = GetNodeContent(node.Value); | |
| List<RadTreeNodeData> result = new List<RadTreeNodeData>(); | |
| foreach (DataRow row in productCategories.Rows) | |
| { | |
| RadTreeNodeData itemData = new RadTreeNodeData(); | |
| itemData.Text = row["strMenuName"].ToString(); | |
| itemData.Value = row["MenuId"].ToString(); | |
| if (Convert.ToInt32(row["ChildrenCount"]) > 0) | |
| { | |
| itemData.ExpandMode = TreeNodeExpandMode.WebService; | |
| } | |
| result.Add(itemData); | |
| } | |
| return result.ToArray(); | |
| } | |
| private DataTable GetNodeContent(object categoryId) | |
| { | |
| SqlConnection connection = new SqlConnection( | |
| ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); | |
| SqlCommand selectCommand = | |
| new SqlCommand(@" | |
| SELECT | |
| pc1.MenuId, | |
| pc1.strMenuName, | |
| ISNULL(pc2.ChildrenCount, 0) as ChildrenCount | |
| FROM Menu as pc1 | |
| LEFT JOIN | |
| ( | |
| SELECT intmenuParentId, COUNT(*) AS ChildrenCount | |
| FROM Menu | |
| Group By (intmenuParentId) | |
| ) as pc2 | |
| ON | |
| pc1.MenuId = pc2.intmenuParentId | |
| WHERE pc1.intmenuParentId =@intmenuParentId and pc1.admin=@admin and pc1.content=@content | |
| " | |
| , | |
| connection); | |
| /*@" | |
| SELECT | |
| pc1.CategoryID, | |
| pc1.Title, | |
| ISNULL(pc2.ChildrenCount, 0) as ChildrenCount | |
| FROM ProductCategories as pc1 | |
| LEFT JOIN | |
| ( | |
| SELECT ParentId, COUNT(*) AS ChildrenCount | |
| FROM ProductCategories | |
| Group By (ParentId) | |
| ) as pc2 | |
| ON | |
| pc1.CategoryId = pc2.ParentId | |
| WHERE pc1.parentId = @parentId | |
| "*/ | |
| selectCommand.Parameters.AddWithValue("intmenuParentId", categoryId); | |
| /********************************how i can pass parameter *********************************/ | |
| selectCommand.Parameters.AddWithValue("admin", stradmin); | |
| selectCommand.Parameters.AddWithValue("content", strcontent); | |
| /*****************************************************************/ | |
| SqlDataAdapter adapter = new SqlDataAdapter(selectCommand); ; | |
| DataTable productCategories = new DataTable(); | |
| adapter.Fill(productCategories); | |
| return productCategories; | |
| } | |
| } |

<
rad:radgrid id="dgReport" runat="server" skin="Office2007" AutoGenerateColumns="False" GridLines="None"
AllowPaging="True" AllowSorting="True" Width="100%" Height="400px" PageSize="14">
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView Width="100%">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<ItemStyle Wrap="False" />
<AlternatingItemStyle Wrap="False" />
<Columns>
<rad:GridBoundColumn HeaderText="MT" DataField="MT" UniqueName="MT"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="Job ID" DataField="Job #" UniqueName="Job ID"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="Organization" DataField="Organization" UniqueName="Organization"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="Work Type" DataField="Work Type" UniqueName="Work Type"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="Dictator" DataField="Dictator" UniqueName="Dictator" ></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="QA Category" DataField="QA Status" UniqueName="QA Status"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="QA Proofer" DataField="QA Proofer" UniqueName="QA Proofer"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="QA Start" DataField="QAStart" UniqueName="QAStart"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="QA End" DataField="QAEnd" UniqueName="QAEnd"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="QA Minutes" DataField="QATotalMinutes" UniqueName="QATotalMinutes"></rad:GridBoundColumn>
<rad:GridBoundColumn HeaderText="MT Comments" DataField="MT Comments" UniqueName="Validation Comments">
<ItemStyle Width="400px" />
</rad:GridBoundColumn>
</Columns>
</MasterTableView>
