Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
72 views
Hi support team,

Telerik TreeView is awesome, all my requirements are met. Great job!
But here I am stuck:

- I have a tree and the user can select multiple nodes.
- Initially, some nodes are expanded, so that all selected nodes are displayed. I do this with a datasource and with the OnNodeDataBound. 
- All nodes can be expanded with TreeNodeExpandMode.WebService

All works fine but when I collapse a initially loaded node, and then expand it again, the number of child nodes doubles, each child node is contained twice. When I do this again, it is still contained twice (not tree times).

How does the control do the "identity". Is is not the RadTreeNode.Value? 
One workaround is the set the ExpandMode of RadTreeNode to Server to all nodes that are initially expanded. But then the user can not collapse it (nothing happens when the user clicks -).  Best regards, a good customer 








Claude
Top achievements
Rank 1
 answered on 13 Oct 2014
1 answer
494 views
I have looked at the following forum post: http://www.telerik.com/forums/strange-behavior-when-using-args-set-cancel-true and although my code is similar still having odd behavior. 

When clicking on the radButton it will fire the validation but it takes clicking on the "OK" button twice before the validation summary disappears.

Suggestions?

<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
        function ShowConfirm(clickedButton, args) {
            var validated = Page_ClientValidate('Form');
            if (validated) {
                args.set_cancel(true);
                function callBackFunction(arg) {
                    if (arg == true) {
                        clickedButton.click();
                    }
                }
                //Open the window
                $find("<%=confirmWindow.ClientID %>").show();
                //Focus the Yes button
                $find("<%=btnYes.ClientID %>").focus();
                //Cancel the postback
                args.set_cancel(true);
            }
        }
 
        function YesOrNoClicked(sender, args) {
            var oWnd = $find("<%=confirmWindow.ClientID %>");
            oWnd.close();
            if (sender.get_text() == "Yes") {
                $find("<%=_btnFinish.ClientID %>").click();
            }
        }
    </script>
</telerik:RadCodeBlock>

    <asp:Panel runat="server" ID="ShowHistorical" Visible="false">
    <tr>
        <td style="text-align: center;" align="center">There is no <strong>Historical data for <asp:Label ID="_Step2CUName" runat="server"></asp:Label>.</strong>  Please select this credit unions Member Type before proceeding.<br />
            <br />
            <telerik:RadDropDownList ID="_ddMember" runat="server" AutoPostBack="true" DefaultMessage="Select Member Type"></telerik:RadDropDownList>  
            <asp:RequiredFieldValidator ID="_reqValMemberType" runat="server" ControlToValidate="_ddMember" Text="*" ForeColor="Red"
                ErrorMessage="You must select a Member Type before you can submit this Credit Union to be reinstated!<br />"
                ValidationGroup="Form" Display="Dynamic" EnableClientScript="true"></asp:RequiredFieldValidator>
        </td>
    </tr>
    </asp:Panel>
    <tr>
        <td align="center">
            <telerik:RadButton ID="_btnFinish" runat="server" Text="Finish" CommandName="Continue" ValidationGroup="Form"  Visible="false"
                OnClientClicking="ShowConfirm"></telerik:RadButton>
            <asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="Form" ShowMessageBox="true" ShowSummary="false"  DisplayMode="BulletList" />
        </td>
    </tr>
</table>

<telerik:RadWindowManager ID="windowManager1" runat="server">
</telerik:RadWindowManager>
<telerik:RadWindow ID="confirmWindow" runat="server" VisibleTitlebar="false" VisibleStatusbar="false"
    Modal="true" Behaviors="None" Height="200px" Width="350px">
    <ContentTemplate>
        <div style="margin-top: 30px; float: left;">
                <div style="width: 60px; padding-left: 15px; float: left;">
                    <img src="/images/ModalDialogAlert.gif" alt="Confirm Page" />
                </div>
                <div style="width: 230px; float: left;">
                    <asp:Label ID="lblConfirm" Font-Size="14px" Text=""
                        runat="server"></asp:Label>
                    <br />
                    <br />
                    <telerik:RadButton ID="btnYes" runat="server" Text="Yes" AutoPostBack="false" OnClientClicked="YesOrNoClicked">
                        <Icon PrimaryIconCssClass="rbOk"></Icon>
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnNo" runat="server" Text="No" AutoPostBack="false" OnClientClicked="YesOrNoClicked">
                        <Icon PrimaryIconCssClass="rbCancel"></Icon>
                    </telerik:RadButton>
                </div>
        </div>
    </ContentTemplate>
</telerik:RadWindow>







Danail Vasilev
Telerik team
 answered on 13 Oct 2014
2 answers
114 views
We have the Filemanager on a screen and depending on the role the user is they will not be able to delete files.  I remove Delete from the toolbar and I also removed from the ContextMenu, but for some reason if the user clicks on file and hits the delete key they can still delete the file.

I tried to add  
    if (e.Command == "DeleteFile")
            e.Cancel = false;

to the OnItemCommand.  When I hit the delete key it will run through this logic but it still deletes the file.

Vessy
Telerik team
 answered on 13 Oct 2014
7 answers
344 views
Hi expert,

I have this exception when excuting this code:

 

If AsyncUpload1.UploadedFiles.Count > 0 Then

AsyncUpload1.UploadedFiles(0).SaveAs(Server.MapPath(

 

"/documents") & fileName, True)

 

End If


then exception occurs:

Could not find file 'xxx\App_Data\RadUploadTemp\mq1ukeso.2dm'.

During debugging, I noticed that temp file 'mq1ukeso.2dm' is existed just before excuting 'SaveAs' method, and it disappear when excuting 'SaveAs...' method, is there any obvious mistake I made? many thanks for your help! 



my aspx page:

<telerik:RadAsyncUpload ID="AsyncUpload1" runat="server"
                                                                        OnClientFileUploaded="OnClientFileUploaded"
                                                                        MaxFileSize="2097152" MaxFileInputsCount="1"
                                                                        AutoAddFileInputs="false" />
Bálint
Top achievements
Rank 1
 answered on 13 Oct 2014
1 answer
130 views
Greetings, I have an .ASP form with a telerik dataGrid (Rgd1) with a nested RadGrid (Rgd2) in a RadMultiPage RadPageView... My second RadGrid (Rgd2) use EditFormType = Template in which I have a control to open a Modal Form to udate some information, I need to rebind the Second RadgGrid, and if posible update and keep the editForm Open... is thera a way to do this with?... may be AJAX Manager Request?
Eyup
Telerik team
 answered on 13 Oct 2014
1 answer
111 views
Need to change Fill Opacity in Areachart. Now it is 0.4 i need to change it as 0.8.  Though it is in SVG format i dont know how to change. Please guide me
Danail Vasilev
Telerik team
 answered on 13 Oct 2014
1 answer
767 views
Hi!

I want to create a qr-code:
    
string photo = @"PHOTO;PNG;ENCODING=BASE64:" + Convert.ToBase64String(File.ReadAllBytes(Server.MapPath(@"/Img/qr_test.png")));
string vCardText = "BEGIN:VCARD\r\nVERSION:2.1\r\nN:";
vCardText += "Name" + "\r\n";
vCardText += "TEL;WORK;VOICE:" + "+00-0000-00000" + "\r\n";
vCardText += "EMAIL;PREF;INTERNET:" + "peter.xxx@yyy.cc" + "\r\n";
vCardText += photo + "\r\n";
vCardText += "END:VCARD";
            
RadBarcode barcode = new RadBarcode();
barcode.Text = vCardText;
barcode.Type = BarcodeType.QRCode;
barcode.LineWidth = 1;

System.Drawing.Image image = barcode.GetImage();

I get following error:
Parametername: The Text cannot be encoded with the current Version, ErrorCorrectionLevel and Mode.

Please help! Thank you!
Konstantin Dikov
Telerik team
 answered on 13 Oct 2014
1 answer
163 views
hi Team,
 I am working on Rad Grid Batch Editing.I am facing a problem whenever i do postback ,grid not binding data on postback .I am creating GridTemplateColumn dynamically. I am also binding data on page load event.Whenever i do postback ,grid only binds data of GridNumericColumn but not of GridTemplateColumn.Reason is GridTemplateColumn.ItemTemplate property not firing InstantiateIn(Container container) function of Template class.I am making postback by RadioButton click.Please reply on shekhar.chauhan@innotiontech.com if possible.Please help me.

Thanks in advance,
Eyup
Telerik team
 answered on 13 Oct 2014
1 answer
218 views
I am trying to get a horizontal list of RadButtons.  So far, the best way I've been able to accomplish this is by using a RadMenu, and adding an ItemTemplate containing a RadButton.
However, this causes the menu's ItemClick to not fire.

Is there a way to use the itemtemplate to force the menu options to look like radbuttons, and still have the ItemClick event fire?  Or is there a better way to get a horizontal list of buttons?  (I had just a bunch of buttons, but I want to share the click event and just look for the clicked one, rather than having separate button click events).

Thanks for any help!
 Here's my markup:
<telerik:RadMenu ID="radMenuRegions" runat="server" Width="100%" BackColor="White"  Skin="" OnItemClick="radMenuRegions_ItemClick"  >
                <ItemTemplate>
                    <telerik:RadButton ID="radBtn" runat="server" Text='<%# DataBinder.Eval(Container, "Text")%>' Skin="WebBlue" Width="100px" Font-Names="Arial" Font-Size="14pt" Height="65px" style="margin:20px;" OnClick="radBtn_Click"></telerik:RadButton>
                    <telerik:RadToolTip ID="toolTip" runat="server" TargetControlID="radBtn" Title='<%# DataBinder.Eval(Container, "Text")%>' Skin="WebBlue" Text='<%# DataBinder.Eval(Container, "Value")%>'></telerik:RadToolTip>
                </ItemTemplate>
                <Items>
                    <telerik:RadMenuItem Text="East" Value="1"  />
                    <telerik:RadMenuItem Text="Main/FHC" Value="2" />
                    <telerik:RadMenuItem Text="Medina" Value="3" />
                    <telerik:RadMenuItem Text="West" Value="4" />
                    <telerik:RadMenuItem Text="Wooster" Value="5" />
                </Items>
            </telerik:RadMenu>
Dimitar Terziev
Telerik team
 answered on 13 Oct 2014
2 answers
217 views
Hi,

It does not recognize the get_value method in my custom button object.

.aspx calling the user control
...
<
telerik:RadTextBox ID="textBoxSearchItemCode" ClientInstanceName="textBoxSearchItemCode" runat="server" Width="90px" CssClass="inline">
</telerik:RadTextBox>
<telerik:RadTextBox ID="textBoxSearchItemName" ClientInstanceName="textBoxSearchItemName" runat="server" Width="190px" CssClass="inline">
</telerik:RadTextBox>
<cc1:JPopup ID="popupItem" runat="server" PopupType="Item" CodeControl="textBoxSearchItemCode" NameControl="textBoxSearchItemName
"
OKScript="Search();"/>
...

user control JPopup.cs
namespace My.Web.JControl.JPopup
{
    [DefaultProperty("Text")]
    [DefaultEvent("OK")]
    [ToolboxData("<{0}:Popup runat=server></{0}:Popup>")]
    public class JPopup : WebControl, IPostBackEventHandler
    {
 
        public JPopup()
            : base()
        {
            UseOKServerEvent = false;
            OKScript = "";
            CodeControl = "";
            NameControl = "";
            PopupControl = "";
            PopupType = ePopupType.None;
            Hidden = false;
        }
 
        #region Properties
 
        /// <summary>
        /// Use OKEvent
        /// </summary>
        [Bindable(true),
        Category("Event")]
        public bool UseOKServerEvent
        {
            get
            {
                return (bool)ViewState["PopupUseOKServerEvent"];
            }
            set
            {
                ViewState["PopupUseOKServerEvent"] = value;
            }
        }
 
        /// <summary>
        /// OKEvent Handler for Javascript
        /// </summary>
        [Bindable(true)]
        [Category("Event")]
        [Editor(typeof(OKEventEditor), typeof(UITypeEditor))]
        public string OKScript
        {
            get
            {
                return (string)ViewState["PopupOKScript"];
            }
            set
            {
                ViewState["PopupOKScript"] = value;
            }
        }
 
        #endregion
 
        #region Binding Property
 
        // column to editbox mapping
        [Bindable(true),
        DefaultValue(""),
        Category("Binding")]
        public string CodeControl
        {
            get
            {
                return (string)ViewState["PopupCodeControl"];
            }
            set
            {
                ViewState["PopupCodeControl"] = value;
            }
        }
 
        [Bindable(true),
        DefaultValue(""),
        Category("Binding")]
        public string NameControl
        {
            get
            {
                return (string)ViewState["PopupNameControl"];
            }
            set
            {
                ViewState["PopupNameControl"] = value;
            }
        }
 
        // column to editbox mapping
        [Bindable(true),
        DefaultValue(""),
        Category("Binding")]
        public string PopupControl
        {
            get
            {
                return (string)ViewState["PopupPopupControl"];
            }
            set
            {
                ViewState["PopupPopupControl"] = value;
            }
        }
 
        [Bindable(true),
        DefaultValue(""),
        Category("Binding")]
        public string Parameter
        {
            get
            {
                return (string)ViewState["PopupParameter"];
            }
            set
            {
                ViewState["PopupParameter"] = value;
            }
        }
 
        #endregion
 
        #region PopupType Property
 
        [Bindable(true)]
        [Category("PopupType")]
        [DefaultValue(ePopupType.None)]
        public ePopupType PopupType
        {
            get
            {
                return (ePopupType)ViewState["PopupType"];
            }
            set
            {
                ViewState["PopupType"] = value;
            }
        }
 
        [Bindable(true)]
        [Category("PopupType")]
        [DefaultValue(false)]
        public bool Hidden
        {
            get
            {
                return (bool)ViewState["PopupHidden"];
            }
            set
            {
                ViewState["PopupHidden"] = value;
            }
        }
 
        public enum ePopupType { None, User, Customer, PoCustomer, Item, MoldItem, PowerChart };
         
        #endregion
 
 
        #region Render
 
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        ///
        protected override void RenderContents(HtmlTextWriter output)
        {
            StringBuilder sbRender = new StringBuilder();
            // Design Mode
            if (this.DesignMode)
            {
                sbRender.Append("<div style=\"VERTICAL-ALIGN: bottom; DISPLAY:inline;POSITION:relative; \" onMouseOver = \"this.style.cursor = 'hand'\">");
                sbRender.Append("<img id = \"" + ID + "\" name = \"" + ID + "\"");
                sbRender.Append(string.Format(" src=\"/{0}/Images/Main/popup.gif\"/>", ConfigurationManager.AppSettings["WebSiteName"]));
 
                sbRender.Append("</div>");
                output.Write(sbRender);
                return;
            }
 
            sbRender.Append("<script type='text/javascript'>");
            sbRender.Append(string.Format(@"
function Popup_{0}()
{{
    var popSearchCode = $find('<%= {1}.ClientID %>').get_value(); <<---- here!!!!
    var popSearchName = $find('<%= {2}.ClientID %>').get_value();", ID, CodeControl, NameControl));
.......

error :
SCRIPT5007: Unable to get value of the property 'get_value()': object is null or undefined.

How Can I use RadTextBox get_value method?

Thank you.
Yoongu
Top achievements
Rank 1
 answered on 13 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?