Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
100 views
Hi all!
 
I want used checkbox in telerik:TreeListSelectColumn , I need to implement the recursive selection at this way:
1. Select all parents when the at least one child item was selected.
2. Select all childs when the parent was selected 
But when I'm runing my project, debuging function itemSelected (), error selectedItem.get_parentItem()  and display error : 
Object doesn't support property or method 'get_parentItem'

I'm add  Telerik.Web.UI 3.5 use for Dotnetnuke 4.5.9 .net Framework 2.0, unknow Can I use ?

Thank for help!

function itemSelected(sender, args) {
    var treelist = sender;
    var selectedItem = args.get_item();
    if(selectedItem.get_parentItem())
    treelist.selectItem(selectedItem.get_parentItem());
     //comment out the above line and uncomment the below one to get all child items selected functionality
    //selectChildren(selectedItem);
  
  
    function selectChildren(item) {
        treelist.selectItem(item);
        if (item.get_childItems().length > 0) {
              
            for (var i = 0; i < item.get_childItems().length; i++) {
                selectChildren(item.get_childItems()[i]);
            }
        }
    }
}
 
 
 
<telerik:RadTreeList runat="server" ID="RadTreeList1" DataKeyNames="Id" ParentDataKeyNames="CongViecChaId" OnItemCommand="RadTreeList1_ItemCommand"
       AllowMultiItemSelection="True" AllowPaging="false"  AllowSorting="true" Skin="Hay"
       AutoGenerateColumns="false" OnNeedDataSource ="RadTreeList1_NeedDataSource" OnItemCreated="RadTreeList1_ItemCreated" OnItemDataBound="RadTreeList1_ItemDataBound" >
            <Columns>
                <telerik:TreeListSelectColumn HeaderStyle-Width="40px" UniqueName="chkColum" >
                </telerik:TreeListSelectColumn>
                <telerik:TreeListBoundColumn DataField="Id" HeaderText="Id" UniqueName="Id" Visible="false">
                </telerik:TreeListBoundColumn>
<telerik:TreeListBoundColumn DataField="MaCongViec" HeaderText="Mã Công Việc" UniqueName="MaCongViec">
                </telerik:TreeListBoundColumn>
                <telerik:TreeListBoundColumn DataField="TenCongViec" HeaderText="Tên Công Việc" UniqueName="TenCongViec">
                </telerik:TreeListBoundColumn>
                <telerik:TreeListBoundColumn DataField="CongViecChaId" HeaderText="Công việc cha id" UniqueName="CongViecChaId" Visible="false">
                </telerik:TreeListBoundColumn>
               <telerik:TreeListBoundColumn DataField="MoTa" HeaderText="Mô tả" UniqueName="MoTa">
                </telerik:TreeListBoundColumn>
                <telerik:TreeListBoundColumn DataField="TinhTrang" HeaderText="Tình trạng" UniqueName="TinhTrang">
                </telerik:TreeListBoundColumn>
            </Columns
     <ClientSettings Selecting-AllowItemSelection="true">
        <ClientEvents OnItemSelected="itemSelected" />
    </ClientSettings>
  </telerik:RadTreeList>
Du
Top achievements
Rank 1
 asked on 14 Jun 2012
3 answers
265 views
Hi,
we are not able to expand all the child nodes when we click on separate asp button or link button.
we are using Visual Studio 2008.
we are using datasource to load the treeview. we will have three levels of child nodes and all these levels should expand when we click the Expand All Button/Link Button.
we have implemented the expandall functionality from javascript.after this event OnNodeExpand server side will be triggered so here we are binding all the child to parents and also we are setting the expanded property is set to TRUE to all the nodes.

so after this postback event the rad treeview gets refreshed and we are losing the expand all.

Telerik Web.Design and Telerik.Web.UI Version : 2009.2.701.20
ASP.NET:
 <asp:Button ID="btnExpand" runat="server" Text="Expand All" OnClick="btnExpand_Click" />

<telerik:RadTreeView ID="RadTreeView4" runat="server" OnNodeExpand="RadTreeView4_NodeExpand">
            </telerik:RadTreeView>
C#:
protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    DataView dtParent = (DataView)SessionDataSource1.Select(DataSourceSelectArguments.Empty);
                    foreach (DataRowView drvParent in dtParent)
                    {
                        rootNode = new RadTreeNode(drvParent["AICategoryName"].ToString());
                        rootNode.Text = rootNode.Text;
                        rootNode.Expanded = true;
                        rootNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                        RadTreeView4.Nodes.Add(rootNode);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        protected void RadTreeView4_NodeExpand(object sender, RadTreeNodeEventArgs e)
        {
            ExpandNode(e.Node);
        }

        protected void ExpandNode(RadTreeNode e)
        {
            DataView dtChild = (DataView)SessionDataSource2.Select(DataSourceSelectArguments.Empty);
            foreach (DataRowView drvChild in dtChild)
            {
                rootNode = null;
                rootNode = new RadTreeNode(drvChild["AILevel1Name"].ToString());
                rootNode.Text = rootNode.Text;
                RadTreeView4.ExpandAllNodes();
                e.Nodes[0].Expanded = true;
                e.Nodes.Add(rootNode);
                
            }            
        }
Javascript:
function ExpandAll()
    {alert('call');
        var treeView = $find("<%= trTaxonomy.ClientID %>");
        var nodes = treeView.get_allNodes();
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].get_nodes() != null) {
                nodes[i].expand();
            }
        }
    }
Bozhidar
Telerik team
 answered on 14 Jun 2012
1 answer
115 views
I'm trying to use the PasswordStrengthSettings attributes of the RadTextBox for the first time, but Visual Studio keeps telling me they're not supported. Here's the code in question:

<telerik:RadTextBox runat="server" ID="txtNewPassword" TextMode="Password">
    <PasswordStrengthSettings showindicator="true" minimumnumericcharacters="1" minimumsymbolcharacters="0"
             textstrengthdescriptionstyles="RedText;RedText;GreenText;GreenText;BlueText;BlueText;" PreferredPasswordLength="8"/>
</telerik:RadTextBox>

And here's the assembly declaration at the top of the page (in case it's a versioning issue): 
<%@ Register Assembly="Telerik.Web.UI, Version=2009.3.1314.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

The solution fails to build as well. Any help is greatly appreciated. 
Shinu
Top achievements
Rank 2
 answered on 14 Jun 2012
0 answers
74 views
Scenario 1)Two reqired field validators are firing at tab event for the text boxes even after using tab index.But I need only the respective validator to be fired.
Scenario 2)I have to bring value from popup and place it in a label along with value of textbox & the values are been assigned but the label value gets disappeared on postback while custom validator is fired.

Need a solution on the above two issues.

Kindly help
Regards
Aabidha Banu.S
Aabidha
Top achievements
Rank 1
 asked on 14 Jun 2012
1 answer
79 views
How can I get the current DataKey property from a RadListViewEditableItem object?
Princy
Top achievements
Rank 2
 answered on 14 Jun 2012
1 answer
79 views
Here are some suggestions of options for timepicker;

Option to limit range of times offerred to user,  such as only offer times between 8:00 AM and 5:00 PM.
Option to include times on the :15, :30, and :45.

Thanks
Shinu
Top achievements
Rank 2
 answered on 14 Jun 2012
1 answer
368 views
Hi I'm working with a radgrid populated with a few gridboundcolumns and one gridtemplatecolum with a radtextbox.
I have a save button on the bottom of the page wich will update to database the items wich has changes on the template column.
My question is how can I get the value of the cells tha dot not correspond to the templatecolumn.

For the template column I do the next
 
var rdtxtCant = (RadTextBox)rgAct_Indicador.Items[i].Cells[0].FindControl("rdtxt");

And it's working fine, but I don't know how to manage this when it is a gridboundcolumn.
Can you help me please?
Shinu
Top achievements
Rank 2
 answered on 14 Jun 2012
4 answers
1.6K+ views
Hi all I am having my RadTabstrip  designed as follows

<telerik:RadTabStrip ID="rdtabEmployee" runat="server" MultiPageID="rdmpPersonal"
            UnSelectChildren="True" Skin="Vista" EnableEmbeddedSkins="False" ClickSelectedTab="True"
            AutoPostBack="True" SelectedIndex="0" OnTabClick="tabClick">
            <Tabs>
                <telerik:RadTab runat="server" Text="Personal">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Contact">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Salary">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Bank">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Taxes">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Residence">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Work">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="rdmpPersonal" runat="server">
            <telerik:RadPageView ID="rdpgPersonal" runat="server">
                <label>
                    Demo Personal
                </label>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rdpgContact" runat="server">
                <label>
                    Demo Contact
                </label>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rdpgResident" runat="server">
                <label>
                    Resident Demo
                </label>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rdpgWork" runat="server">
                <label>
                    Work Demo
                </label>
            </telerik:RadPageView>
        </telerik:RadMultiPage>

You can find under Taxes tab I am having sub Tabs. How can I handle Click event for that .

I write my code as follows

protected void tabClick(object sender, RadTabStripEventArgs e)
    {
        AddPageView(e.Tab.Text);
        e.Tab.PageView.Selected = true;
    }
    private void AddPageView(string pageViewID)
    {
        RadPageView pageView = new RadPageView();
        pageView.ID = pageViewID;
        rdmpPersonal.PageViews.Add(pageView);
    }

But this didn't work child Tabs can some one help me

I am also getting the following error if i click the same Tab for multiple times

Multiple controls with the same ID 'Personal' were found. FindControl requires that controls have unique IDs.

Princy
Top achievements
Rank 2
 answered on 14 Jun 2012
0 answers
353 views
hi all,
 
I m using filtering radgrid.

I'm using 2008 version of telerik DLL which does not support "Filter Template". I want to develop a screen which is something like the one attached.

As you can see the attachment i want a button in place of filter text boxes and this is for two columns alone(Column Nominate and Column Approve). To achieve that i wrote a class which is below.

public class GenerateButton : GridCheckBoxColumn
    {
 
        //RadGrid will call this method when it initializes the controls inside the filtering item cells
        protected override void SetupFilterControls(TableCell cell)
        {
 
            base.SetupFilterControls(cell);
            cell.Controls.RemoveAt(0);
            Button b = new Button();
            b.ID = ("SelectDeselect"+ this.UniqueName);
            b.BackColor = System.Drawing.Color.White;
            b.Text = "Select/Deselect All";
            string s = b.ID;
                 
            //b.OnClientClick = "clickbutton('"+s+"')";
            if (s.Equals("SelectDeselectColumnNominate"))
            {
                b.OnClientClick = "ColumnNominateClickButton()";
            }
            else if(s.Equals("SelectDeselectColumnApprove"))
            {
                b.OnClientClick = "ColumnApproveClickButton()";
            }
            cell.Controls.AddAt(0, b);
            cell.Controls.RemoveAt(1);
 
        }
 
 
    }


For those two columns i used the below logic which is written in the PageLoad.
if (dataColumn.ColumnName == "ColumnNominate")
     {
            GenerateButton columnNominate = new GenerateButton();
             RadGrid1.MasterTableView.Columns.Add(columnNominate);
             columnNominate.DataField = dataColumn.ColumnName;
             columnNominate.SortAscImageUrl = @"Arrow Down.jpg";
             columnNominate.SortDescImageUrl = @"Arrow Up.jpg";
             columnNominate.HeaderText = dataColumn.ColumnName;
      }
       else if (dataColumn.ColumnName == "ColumnApprove")
        {
         GenerateButton columnApprove = new GenerateButton();
          this.RadGrid1.MasterTableView.Columns.Add(columnApprove);
           columnApprove.DataField = dataColumn.ColumnName;
           columnApprove.SortAscImageUrl = @"Arrow Down.jpg";
           columnApprove.SortDescImageUrl = @"Arrow Up.jpg";
           columnApprove.HeaderText = dataColumn.ColumnName;
         }

Item data bound logic is below where in i'm setting the properties of checkboxes.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                CheckBox chkbxNominate = (CheckBox)item["ColumnNominate"].Controls[0];
                chkbxNominate.ID = "ChkNominate";
                 
                chkbxNominate.Visible = true;
                chkbxNominate.Enabled = true;
              
 
                CheckBox chkbxApprove = (CheckBox)item["ColumnApprove"].Controls[0];
                chkbxApprove.ID = "ChkApprove";
                chkbxApprove.Visible = true;
                chkbxApprove.Enabled = true;
                
 
            }
          
        }

Now things are getting complicated for me.

The following tasks needs to be done
1. Persist the checkbox's checked status while i filter.
2. On clicking the SelectAll/DeselectAll button i need to select all checkboxes and deselect all checkboxes. I wrote this in javascript and is working fine
3. I need to identify the checked checkboxes in the (.cs) file so that i could pass in this value to the DB. Now where to write this logic? If i try to find the checkboxes in the "ColumnNominate" or "ColumnApprove" then the system is throwing an error saying "No controls are bound to that particular cell". Kind suggestion please on how to proceed further?

Also can you please suggest me some other better way to create two checkbox columns programatically?
Gowtham
Top achievements
Rank 1
 asked on 14 Jun 2012
0 answers
83 views
I have a master page that has the script manager on it.
I have a content page that has the follow RadajaxManager and Panels

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
</telerik:RadAjaxManager>
 
<!-- Loading Panel -->
<telerik:RadAjaxLoadingPanel ID="DefaultAjaxLoadingPanel" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="0"
    Skin="" Transparency="30" BackColor="#CCCCCC">
    <div id="MyLoadingPanel">
        <span class="WbHeader">Configuring Document...</span><br />
        <asp:Image ID="LoadingImage" runat="server" ImageUrl="~/images/ajax-loader.gif"></asp:Image>
    </div>
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" MinDisplayTime="0"
    Skin="" Transparency="30" BackColor="#CCCCCC">
    <div id="Div1">
        <span class="WbHeader">Restructuring Document...</span><br />
        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/ajax-loader.gif"></asp:Image>
    </div>
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel3" runat="server" MinDisplayTime="0"
    Skin="" Transparency="10" BackColor="#CCCCCC" ZIndex="2000">
    <div id="Div3" style="margin: 50px 10px 10px 10px; text-align: left">
        <span class="WbHeader">The document outline view is disabled while you are editing this
            particular content block. When you have finished and saved your work, this view
            will refresh to reflect your changes.</span>
    </div>
</telerik:RadAjaxLoadingPanel>

The RadAjaxManager is called from javascript that is initiated by a RadTree OnClientNodeClicking

<div id="MainDiv" style="height:100%;width:100%;overflow:auto;">
        <telerik:RadSplitter ID="rsMain" runat="server" VisibleDuringInit="True" Height="100%" Width="100%" AccessKey="o" style="overflow: auto;">
         
            <telerik:RadPane ID="pOutline" runat="server" Width="26%" CssClass="VisibleScrollbar">
 
            <telerik:RadTreeView ID="OutlineTree" runat="server" AccessKey="w" CausesValidation="False"
                EnableDragAndDrop="True" EnableDragAndDropBetweenNodes="True" WebServiceSettings-Path="/wbTree.asmx"
                WebServiceSettings-Method="LoadNodes"
                onclientcontextmenushowing="ClientContextMenuShowing"
                OnClientNodePopulating="ClientNodePopulating"
                OnClientNodeDropping="ClientNodeDropping"
                OnClientNodePopulated="ClientNodePopulated" Height="99%"
                OnClientNodeClicking="ClientNodeClicking"
                EnableViewState="False"
                CollapseAnimation-Type="None"
                ExpandAnimation-Type="None">
                <WebServiceSettings Method="LoadNodes" Path="/wbTree.asmx"></WebServiceSettings>
                <ContextMenus>
                    <telerik:RadTreeViewContextMenu ID="ElementMenu" runat="server" EnableAutoScroll="True">
                    </telerik:RadTreeViewContextMenu>
                </ContextMenus>
                <ExpandAnimation Type="None" />
            </telerik:RadTreeView>
         
            </telerik:RadPane>
 
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" />
     
            <telerik:RadPane ID="pContent" runat="server" Width="74%">
                <telerik:RadAjaxPanel id="plEdit" runat="server" EnableAJAX="True" Width="99%"
                    LoadingPanelID="DefaultAjaxLoadingPanel"  ClientEvents-OnResponseEnd="plEditResponseEnd"
                    Height="99%">
                     
                    <asp:HiddenField ID="SelectedIID" Value="0" runat="server" />
                     
                    <telerik:RadSpell ID="RadSpell1" runat="server" IsClientID="True" ButtonType="None" EnableViewState="False"  />                          
                     
                    <asp:Button ID="NextButton" runat="server" Visible="false" Text="Next" CausesValidation="false" EnableViewState="false"/>
 
                </telerik:RadAjaxPanel
            </telerik:RadPane>
 
        </telerik:RadSplitter>
    </div>

//Called when you are attempting to click a node on the tree.
function ClientNodeClicking(sender, args) {
    var Node = args.get_node();
    var attrs = Node.get_attributes();
    var ClickStatus = attrs.getAttribute("ClickStatus");
    var IID = attrs.getAttribute("IID");
 
    if (ClickStatus != null) {
        if (ClickStatus == "None") {
            args.set_cancel(true);
            return;
        }
    }
 
    if (IID == null || IID == "") {
        args.set_cancel(true);
        return;
    }
 
    Page_ValidationActive = false;
 
    var _ajax = $find("<%=RadAjaxManager1.ClientID %>");
     
    if (_ajax != null) {
        var CmdStr = "IID=" + IID;
        _ajax.ajaxRequestWithTarget("<%= plEdit.ClientID %>", CmdStr);
    }
 
}

The ClientIDs and CmdStr are properly assigned (attached ClickedValues).

I also have a server side method that overrides the RaisePostbackEvent which I would expect to get called but does not.

Protected Overrides Sub RaisePostBackEvent(ByVal source As IPostBackEventHandler, ByVal eventArgument As String)
       MyBase.RaisePostBackEvent(source, eventArgument)
 
       If TypeOf source Is RadAjaxPanel Then
 
           ''No, there is no tree!
           If MyTree Is Nothing Then
               Exit Sub
           End If
 
           If eventArgument.Contains("IID=") Or eventArgument.Contains("Refresh") Then
               ''Slight Hack for multi-page wizard controls
               Session("_CurrentWizardPage") = 0
               If _NodeTransformed = True Then
                   RadAjaxManager1.ResponseScripts.Add(String.Format("ServerSideRefreshNode('{0}');", SelectedIID.Value))
               End If
           End If
 
           If eventArgument.Contains("IID=") Then
               Dim _NodeStr As String = eventArgument.Substring(eventArgument.LastIndexOf("=") + 1)
               If SelectedIID.Value <> _NodeStr Then
                   _NodeStr = _NodeStr
                   SelectedIID.Value = _NodeStr
                   BuildControls(_NodeStr, True)
               End If
           End If
 
           If eventArgument.Contains("Refresh") Then
               BuildControls(SelectedIID.Value, True)
           End If
 
           If eventArgument.Contains("SaveFile") Then
               ''Do nothing technically. We've already done the binding to the XML document in the postback at this point.
           End If
 
           If eventArgument.Contains("SaveWithValidation") Then
               RadAjaxManager1.ResponseScripts.Add("ValidateXmlCallback();")
           End If
 
           If eventArgument.Contains("ValidationOnly") Then
               RadAjaxManager1.ResponseScripts.Add("ValidateXmlCallback('report');")
           End If
 
           _NodeTransformed = False
       End If
 
   End Sub

This is a web application (Not Web site).  I have an application level function for logging errors and nothing is being caught, No javascript error is being received nor is any IIS error being logged in the event viewer.  It appear that processing is simply stopping.

Any suggestions as to why this would not be working would be appreciated.
Phillip
Top achievements
Rank 1
 asked on 14 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?