Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
140 views

Hi 

I have a grid with several GridDropDownColumn. 
I want to be able to show/hide of few of these GridDropDownColumn depending on what is selected in on of the other GridDropDownColumn.

How can I perform this? Is it possible client side.

I know how to find a Dropdowncontrol if I use GridTemplateColumn and disable the control but I would prefer the show/hide the entire column

 

Eyup
Telerik team
 answered on 04 Mar 2016
1 answer
114 views

I have a textbox and a listbox that displays customer information. On page load my listbox populates just fine from a webmethod and shows in a ClientItemTemplate. I want to be able to call this webmethod from code-behind and repopulate the listbox based on what text is typed in the textbox (onkeyup). The problem is I keep getting the error "JavaScript runtime error: Object doesn't support property or method 'get_parent'"

 

Here is the server-side code:

<WebMethod()> _
    Public Shared Function GetCustomers() As RadListBoxItemData()
        Dim data As DataTable = GetData("248")
 
        Dim result As New List(Of RadListBoxItemData)()
 
        For i As Integer = 0 To data.Rows.Count - 1
            Dim itemData As New RadListBoxItemData()
 
            Dim FullName As String = data.Rows(i)("FName").ToString() & " " & data.Rows(i)("LName").ToString()
            itemData.Text = data.Rows(i)("CPhone").ToString()
            itemData.Value = data.Rows(i)("CPhone").ToString()
            itemData.Attributes.Add("FullName", FullName)
            itemData.Attributes.Add("Phone", data.Rows(i)("CPhone").ToString().Insert(0, "(").Insert(4, ") ").Insert(9, "-"))
 
            '--Determine opt-in icon
            Select Case data.Rows(i)("OptIn").ToString()
                Case -1
                    itemData.Attributes.Add("OptIn", "<img alt='Opted-In' src='images_zw/OptIn_OptedIn.png' />")
                Case 0
                    itemData.Attributes.Add("OptIn", "<img alt='Blocked / Opted-Out' src='images_zw/OptIn_Blocked.png' />")
                Case 1
                    itemData.Attributes.Add("OptIn", "<img alt='Pending Opt-In' src='images_zw/OptIn_Pending.png' />")
                Case 2
                    itemData.Attributes.Add("OptIn", "")
            End Select
 
            result.Add(itemData)
        Next
 
        Return result.ToArray()
    End Function

 

Here is my client-side code:

<script type="text/javascript">
        function Generate()
        {
            var listbox = $find("<%= lstContacts.ClientID%>");
            var result = PageMethods.GetCustomers(function (response) {
                response.forEach(function (listitem) {
                    listbox.trackChanges();
                    listbox.get_items().add(listitem);
                    listbox.commitChanges();
                });
                //listbox.insertItems(response);
            });
        }
    </script>
 
    <div>
     
        <div><telerik:RadTextBox runat="server" id="txtSearch" AutoPostBack="False" onkeyup="Generate();" Text="248"></telerik:RadTextBox></div>
 
        <div>
            <telerik:RadListBox runat="server" ID="lstContacts" width="300" height="500" AutoPostBack="False">
                <ClientItemTemplate>
                    <div class="Search_Conversation_Container">
                        <div class="Search_OptIn">
                            #= Text #
                        </div>
                    </div>
                </ClientItemTemplate>
                <WebServiceSettings Path="testlist.aspx" Method="GetCustomers"></WebServiceSettings>
            </telerik:RadListBox>
 
        </div>
    </div>

Alex
Top achievements
Rank 1
 answered on 03 Mar 2016
1 answer
394 views
Hello,
in javascript you can create a function that controls the upload file if the name is the presence of special characters such as: + / \ @ # $% & etc ...
Hristo Valyavicharski
Telerik team
 answered on 03 Mar 2016
3 answers
236 views

Is it possible in RadTreeView that having a multiple parent and in that multiple parent have a child?

maybe can be described like this:

Node 1
-Member of Node 1 - 1
    Node 2
    - Member of Node 2 - 1
    - Member of Node 2 - 2
    - Member of Node 2 - 3
        Node 3
        - Member of Node 3 - 1

or if it is not possible to use RadTreeView, is there any control that can provide things like this?

 

Thank you in advance

Ivan Danchev
Telerik team
 answered on 03 Mar 2016
1 answer
960 views

I have two related RadComboBoxes as following:

<telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadDropDownParameterX">
                 <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="RadComboBoxCountries" LoadingPanelID="AjaxLoadingPanel1" />
                     <telerik:AjaxUpdatedControl ControlID="RadComboBoxSites" LoadingPanelID="AjaxLoadingPanel1" />
                     <telerik:AjaxUpdatedControl ControlID="RadComboBoxRts" LoadingPanelID="AjaxLoadingPanel1" />
                     <telerik:AjaxUpdatedControl ControlID="RadComboBoxMachines" LoadingPanelID="AjaxLoadingPanel1" />
                     <telerik:AjaxUpdatedControl ControlID="RadComboBoxProtocols" LoadingPanelID="AjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadComboBoxCountries">
                 <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="RadCodeBlock1" LoadingPanelID="AjaxLoadingPanel1" />
                     <telerik:AjaxUpdatedControl ControlID="RadCodeBlock2" LoadingPanelID="AjaxLoadingPanel1" />
                     <telerik:AjaxUpdatedControl ControlID="RadComboBoxSites" LoadingPanelID="AjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            ...
</telerik:RadAjaxManagerProxy>
...
<telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Skin="BlackMetroTouch">
</telerik:RadAjaxLoadingPanel>
...
<div class="right">
    <span>Select X-parameter</span>
    <telerik:RadDropDownList ID="RadDropDownParameterX" runat="server" 
        DropDownHeight="120px" Width="120px" Skin="BlackMetroTouch" DropDownWidth="120px"
            OnSelectedIndexChanged="RadDropDownParameterX_SelectedIndexChanged"
            AutoPostBack="true" >
            <Items>
                <telerik:DropDownListItem Text="Countries" Value="Countries" Selected="true" />
                <telerik:DropDownListItem Text="Sites" Value="Sites" />
                <telerik:DropDownListItem Text="Rts" Value="Rts" />
                <telerik:DropDownListItem Text="Machines" Value="Machines" />
                <telerik:DropDownListItem Text="Protocols" Value="Protocols" />
            </Items>
</telerik:RadDropDownList>
...    
<div class="combo countries">
    <telerik:RadComboBox ID="RadComboBoxCountries" runat="server"
        AutoPostBack="True"
        onselectedindexchanged="RadComboBoxCountries_SelectedIndexChanged"
        CheckBoxes="true" EnableCheckAllItemsCheckBox="true"
        Label="Country" Skin="BlackMetroTouch" >                           
    </telerik:RadComboBox>
    <div class="subv"><telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <%= SelectedCountriesText %></telerik:RadCodeBlock></div>
</div>
             
<div class="combo sites">
    <telerik:RadComboBox ID="RadComboBoxSites" runat="server"
        CheckBoxes="true"
        AutoPostBack="true"
        onselectedindexchanged="RadComboBoxSites_SelectedIndexChanged"
        EnableCheckAllItemsCheckBox="true"
        Label="Site" Skin="BlackMetroTouch">
    </telerik:RadComboBox>
    <div class="subv"><telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"> <%= SelectedSitesText %></telerik:RadCodeBlock></div>
</div

What i am trying to achieve is to have the second comboBox (RadComboBoxSites) populated upon selected Values of first comboBox.

Tried to achive that by deleting all items of RadComboBoxSites each time a SelectedIndexChanged event is occured on comboBox RadComboBoxCountries in the way depicted below:

Protected Sub RadComboBoxCountries_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
    If (RadDropDownParameterX.SelectedValue.Equals("Sites"))
        Dim collectionPopulatedSites = RadComboBoxSites.Items
        For each s In collectionPopulatedSites
            Dim RadComboBoxSite As RadComboBoxItem = RadComboBoxSites.Items.FindItemByValue(s.Value)
            If RadComboBoxSite IsNot Nothing Then
                RadComboBoxSite.Remove
            End If
        Next
             
        ' get new list of selected countries
        Dim collectionSelectedCountries = RadComboBoxCountries.CheckedItems
        For each c in collectionSelectedCountries
 
            Dim listaCountrySites As List(Of AffideaGeneralWeb.BLL.General.Sites)
            listaCountrySites = GetAllCountrySites(c.Value)
                 
            For each s in listaCountrySites
                     
                Dim RadComboBoxSite As RadComboBoxItem = RadComboBoxSites.Items.FindItemByValue(s.ID)
 
                If RadComboBoxSite Is Nothing Then
                    RadComboBoxSite = New RadComboBoxItem()
                    RadComboBoxSite.Text = s.Title
                    RadComboBoxSite.Value = s.ID
                    RadComboBoxSites.Items.Add(RadComboBoxSite)
                End If
                     
            Next
        Next
 
    End If
 
End Sub

However when i am trying to "RadComboBoxSite.Remove" i am getting an exception:

An exception of type 'System.InvalidOperationException' occurred in mscorlib.dll but was not handled in user code. Additional information: The collection has changed, the enumeration operation may not be performed

Is there any working example of related comboBoxes (handles in the server side)? 

How could i delete all items of second comboBox and re-build it, each time the user alters selection on the first comboBox?

Nencho
Telerik team
 answered on 03 Mar 2016
4 answers
74 views

Hi Ivan

With the latest release (and recent internal builds) I have noticed that the navigation font being displayed in chrome is quite different to that of IE.  Chrome seems to be a somewhat bold while IE is a fairly skinny one. Attached image showsIE rendering on left and Chrome on right.

Is Chrome rendering it with Roboto while IE isn't?  I've tried to use the css property browsers but they aren't telling me what the actual font being rendered is :(

Regards

Jon

Jon
Top achievements
Rank 1
 answered on 03 Mar 2016
2 answers
419 views

Hello!

I wasn't sure how to title my thread. I have a test case that I'm not sure how to handle appropriately.

I have the following control set up:

<telerik:RadAsyncUpload ID="uploadControl" runat="server"
    Skin="MetroTouch"
    UseApplicationPoolImpersonation="true"
    AutoAddFileInputs="true"
    InitialFileInputsCount="1"
    EnableInlineProgress="true"
    MultipleFileSelection="Automatic"
    MaxFileInputsCount="5" >

 

This control is in a RadWizard that saves each step incrementally (Next/Previous click, NavigationButton Click). The RadWizard's validation is triggered on the "Finish" button. I am using the MaxFileInputsCount property to determine how many files are required to pass validation - in the case above, the control needs 5 files to be uploaded to pass field validation on the "Finish" button click.

Here is the scenario that is causing me trouble: 

Let's say I launch the RadWizard, go to the step with my upload control and only upload 2 of the 5 required files. I click "Next" and the 2 files are uploaded and their paths saved to the database. When I click "Finish", I get an error saying I can't submit because I need to upload 3 more files. This all works fine.

Now, I exit and relaunch the RadWizard to complete my form, and I go to the upload control step. 

Currently, if I upload 2 out of 5 files, exit and go back in the application, I can upload another 5 files instead of just 3. How can I re-load the AsyncUpload control and add the 2 previously-uploaded files to the UploadedFileCollection() in order for the control to know that I need 3 more files before hiding the FileInput button and so that I can validate?

I hope that makes sense!

I tried setting the UploadedFiles() property of the AsyncUpload control as demonstrated below, but that property is read-only...  and there is no "Add" function for the UploadeFilesCollection(), so obviously that code gives me a bunch of errors.

Dim colFiles As Telerik.Web.UI.UploadedFileCollection()
For Each filename In arrUploadedFiles
    Dim objFile As Telerik.Web.UI.UploadedFile
    objFile.FileName = strUploadPath & filename.ToString
    colFiles.Add(objFile)
Next
uploadControl.UploadedFiles = colFiles

 

 

 

Ivan Danchev
Telerik team
 answered on 03 Mar 2016
1 answer
58 views

i want to display image on upload successfully. like given in attached file.

Don't want to display name. want to show image directly.

please help me. thanks in advance.

Peter Filipov
Telerik team
 answered on 03 Mar 2016
4 answers
88 views

In a form, I have both RadComboBox and RadDatePicker and I want to enable an asp button if any change is made to them. How I can make it possible.

I use below code for textboxes and it's working fine:

$(document).ready(function () {
 
    $("#BtnUpdate").attr('disabled', 'disabled');
 
    $("input.UpdateCSS").keyup(function () {
        $("#BtnUpdate").removeAttr('disabled');
    });
 
 
 
    $("input.UpdateCSS").change(function () {
        $("#BtnUpdate").removeAttr("disabled");
    });

Eyup
Telerik team
 answered on 03 Mar 2016
1 answer
66 views

Hi

Does ClientExportManager support rtl languages?

Thanks

Ivan Danchev
Telerik team
 answered on 03 Mar 2016
Narrow your results
Selected tags
Tags
+124 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?