Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
73 views
Hello,

could I use RadTimeView just as usual control, not connected to some e.g. RadTimePicker or something?
When I just put it on my page I see from HTML markup that the "wrapper" div has the "display:none" style, so it is not visible.
How could I make it visible on the server?

Thanks in advance,
Ilya.
Seekbirdy
Top achievements
Rank 1
 answered on 24 Aug 2012
2 answers
34 views
Hello,

I'm trying to get the selectedItem from the comboBox but since I load it up with info from a string on the server side it wont do anything.
The items are there however on both the server side and client side they seem empty.

Here's the asp control:
<telerik:RadComboBox
                 ID="RadComboBox1" runat="server"
                 Width="590px" Height="140px"
                 EmptyMessage="Type something here"
                 OnItemsRequested="RadCombobox2_ItemsRequested" EnableLoadOnDemand="true"
                 >
</telerik:RadComboBox>
And the .cs
protected void RadCombobox2_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        for(int i=0;i<mono.M_content.Count;i++)
        {
            if (mono.M_content[i].M_type == 0)
            {
                RadComboBox1.Items.Add(new RadComboBoxItem(mono.M_content[i].C_Description.ToString()));
            }
        }
    }
 
protected void Button1_Click(object sender, EventArgs e)
    {
        label12.Text = RadComboBox1.SelectedValue.ToString();
        //RadEditor1.Content = test;
    }

I load the ComboBox with info from a database and I have a button which is supposed to paste that info into the RadEditor but I won't do anything, I've tried all the event handlers from the ComboBox without success, I still get nothing, not even an error.

Any ideas on how I can fix this?

Thanks a lot for your help.

Greetings
Jonathan
Top achievements
Rank 1
 answered on 24 Aug 2012
2 answers
292 views
Hi
Im trying to use radWindow like iFrame, when the initial page is loaded (Login.aspx), show the "loading" image but, when the page use Post to other page (Index.aspx), the window dont show the loading image.

This is my code
    <telerik:RadWindow ID="wndw_ppal" runat="server" NavigateUrl="Login.aspx" CssClass="main-content"
         AutoSizeBehaviors="Width, Height, Default" KeepInScreenBounds="True"
        VisibleStatusbar="False" VisibleTitlebar="False"
        Behavior="Close" Behaviors="None"
        ShowContentDuringLoad="False" ShowOnTopWhenMaximized="False"
        VisibleOnPageLoad="True" Height="100%" Overlay="True" Width="100%"
            BorderWidth="0px" OnClientPageLoad="ResizeWindow">
Danilo
Top achievements
Rank 1
 answered on 24 Aug 2012
2 answers
332 views
I am having an issue hiding a label in a GridTemplateColumn.

Here is my grid:
<telerik:RadGrid ID="rgd_User_List" runat="server" AllowSorting="True"
    DataSourceID="sds_User_Lookup" GridLines="None" AllowPaging="True" PageSize="200">
    <ClientSettings
        AllowColumnsReorder="True" ReorderColumnsOnClient="True">
    </ClientSettings>
    <PagerStyle
        Mode="NextPrevAndNumeric" AlwaysVisible="true" HorizontalAlign="Center" Position="TopAndBottom">
    </PagerStyle>
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="IDStaff" DataSourceID="sds_User_Lookup">
        <CommandItemSettings ExportToPdfText="Export to Pdf"
            ShowAddNewRecordButton="False" ShowExportToCsvButton="True"
            ShowRefreshButton="False" />
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridTemplateColumn DefaultInsertValue="" HeaderText=" "
                UniqueName="TemplateColumn1">
                <itemtemplate>
                    <%# Container.ItemIndex+1 %>
                    </itemtemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name"
                SortExpression="LastName" UniqueName="LastName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name"
                SortExpression="FirstName" UniqueName="FirstName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="IDStaff" HeaderText="Staff ID"
                SortExpression="IDStaff" UniqueName="IDStaff">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="IDBitech" HeaderText="BiTech ID"
                SortExpression="IDBitech" UniqueName="IDBitech">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name"
                SortExpression="UserName" UniqueName="UserName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Password" HeaderText="Password"
                SortExpression="Password" UniqueName="Password">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="JobTitle" HeaderText="Job Title"
                SortExpression="JobTitle" UniqueName="JobTitle">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PhoneIP" HeaderText="IP Phone"
                SortExpression="PhoneIP" UniqueName="PhoneIP">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="Restraints" HeaderText="Restraints"
                SortExpression="Restraints" UniqueName="Restraints">
                <ItemTemplate>
                    <asp:Label ID="RestraintsLabel" runat="server" Text='<%# Eval("Restraints") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridHyperLinkColumn DataNavigateUrlFields="UserName"
                DataNavigateUrlFormatString="user_details.aspx?UserName={0}" Text="Details"
                UniqueName="UserName">
                <ItemStyle CssClass="radgrid" />
            </telerik:GridHyperLinkColumn>
            <telerik:GridHyperLinkColumn AllowFiltering="False"
                DataNavigateUrlFields="EmailAddress" DataNavigateUrlFormatString="mailto:{0}"
                HeaderText=" " ItemStyle-HorizontalAlign="Center" UniqueName="EmailAddress">
                <ItemStyle CssClass="radgrid" Width="50px" />
            </telerik:GridHyperLinkColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
Here is my code:

Protected Sub rgd_User_List_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles rgd_User_List.ItemDataBound
 
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim value As String = item("Restraints").Text
        If value = "1" Then
            Dim Restraints As Label = DirectCast(item("RestraintsLabel").Controls(0), Label)
            Restraints.Visible = False
        End If
    End If
 
End Sub


Any help appreciated.
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Aug 2012
0 answers
70 views
Hi,

i'm having an error in Telerik.Web.UI.Webressource line 1763 saying :
SCRIPT5007: Unable to get value of the property 'length': object is null or undefined
Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3afr-FR%3a553a4a13-b3a5-4e6b-a152-b131051f1788%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3afr-FR%3ac8b048d6-c2e5-465c-b4e7-22b9c95f45c5%3a16e4e7cd%3af7645509%3a22a6274a%3aed16cbdc%3a24ee1bba%3a1e771326%3aa7e79140%3a874f8ea2%3a19620875%3af46195d3%3a490a9d4e%3abd8f85e4, line 1763 character 1
it is actually in the Telerik.Web.UI.Ajax.Ajax.js because I see /* START Telerik.Web.UI.Ajax.Ajax.js */ before the code that raise the exeption.

It seams to only appear in IE after a couple refresh of the page. The strange thing is that I don't use  RadAdjaxManager or any Ajax controls in that page and the code seems to try finding update panel in my page.

thanks


UPDATE : forget it. I had a RadAjaxManager on a page without RadAjaxLoadingPanel and that is what was seems to cause the error
Tommy
Top achievements
Rank 1
 asked on 24 Aug 2012
3 answers
81 views
I am trying to update My City combobox when someone selects a state.  Will someone please look at my code and tell me why both my city and state comboboxes are blank?

I was following this tutorial:  http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultvb.aspx

Thanks!

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports Telerik.Web.UI
Partial Class _default
    Inherits System.Web.UI.Page
 
    Private Const MessageTemplate As String = "You chose to explore the city of {1} in {0}"
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
 
        If Not Page.IsPostBack Then
            ' Fill the continents combo.
            LoadStates()
        ElseIf Not Page.IsCallback Then
            ' On regular postbacks restore the items of the related ComboBoxes.
            ' Their selected items will be automatically restored from their ClientState.
            LoadStates()
            LoadCities(cbxStates.SelectedValue)
        End If
 
    End Sub
 
    Protected Sub LoadStates()
 
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("DBConnectionString").ConnectionString)
 
        Dim adapter As New SqlDataAdapter("SELECT * FROM States ORDER By StateName", connection)
        Dim dt As New DataTable()
        adapter.Fill(dt)
 
        cbxStates.DataTextField = "StateName"
        cbxStates.DataValueField = "StateID"
        cbxStates.DataSource = dt
        cbxStates.DataBind()
        ' Insert the first item.
        cbxStates.Items.Insert(0, New RadComboBoxItem("- Select a State -"))
 
    End Sub
 
    Protected Sub LoadCities(ByVal StateID As String)
 
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("DBConnectionString").ConnectionString)
 
        ' Select a country based on the continentID.
        Dim adapter As New SqlDataAdapter("SELECT * FROM Cities WHERE StateID=@StateID ORDER By Name", connection)
        adapter.SelectCommand.Parameters.AddWithValue("@StateID", StateID)
 
        Dim dt As New DataTable()
        adapter.Fill(dt)
 
        cbxCities.DataTextField = "CityName"
        cbxCities.DataValueField = "CityID"
        cbxCities.DataSource = dt
        cbxCities.DataBind()
 
    End Sub
 
    Protected Sub cbxStates_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles cbxStates.ItemsRequested
        LoadStates()
    End Sub
 
    Protected Sub cbxCities_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles cbxCities.ItemsRequested
        ' e.Text is the first parameter of the requestItems method
        ' invoked in LoadCountries method
        LoadCities(e.Text)
    End Sub
 
    Protected Sub Button1_Click(sender As Object, e As EventArgs)
        Literal1.Text = String.Empty
 
        If RadComboBox1.SelectedIndex > 0 Then
            Literal1.Text = String.Format(MessageTemplate, cbxStates.Text, cbxCities.Text)
        End If
    End Sub
 
End Class

<%@ Page Title="" Language="VB" MasterPageFile="~/sitemasterpage.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="_default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="main-content-container">
        <div id="home-container">
            <div id="home-search-text">
                <h2>Join for free and start searching...</h2>
                <p>Once you sign up, you're free to search our members and start finding your perfect match.</p>
                <div id="home-search-content">
                    <table cellpadding="2" class="home-search-table">
                        <tr>
                            <td>
                                I'm a
                            </td>
                            <td>
                                <telerik:RadComboBox ID="RadComboBox1" Runat="server" >
                                    <Items>
                                        <telerik:RadComboBoxItem runat="server" Selected="True" Text="Man" Value="Man" />
                                        <telerik:RadComboBoxItem runat="server" Text="Woman" Value="Woman" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td>Looking for a</td>
                            <td>
                                <telerik:RadComboBox ID="RadComboBox2" Runat="server" >
                                    <Items>
                                        <telerik:RadComboBoxItem runat="server" Text="Man" Value="Man" />
                                        <telerik:RadComboBoxItem runat="server" Selected="True" Text="Woman" Value="Woman" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td>Select your State</td>
                            <td>
                                <telerik:RadComboBox ID="cbxStates"
                                                     runat="server"
                                                     CssClass="ComboBox_Continents"
                                                     OnClientSelectedIndexChanging="LoadStates"
                                                     OnItemsRequested="cbxStates_ItemsRequested" />
                            </td>
                        </tr>
                        <tr>
                            <td>Select your City</td>
                            <td>
                                <telerik:RadComboBox ID="cbxCities"
                                                     runat="server"
                                                     CssClass="ComboBox_Continents"
                                                     OnClientSelectedIndexChanging="LoadCities"
                                                     OnItemsRequested="cbxCities_ItemsRequested" />
                            </td>
                        </tr>
                        <tr>
                            <td> </td>
                            <td>
                                <asp:Button ID="Button1" runat="server" Text="Explore"
                                            OnClick="Button1_Click" />
                                <asp:Literal runat="server" ID="Literal1"></asp:Literal>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        //global variables for the countries and cities comboboxes
        var StatesCombo;
        var citiesCombo;
 
        function pageLoad() {
            // initialize the global variables
            // in this event all client objects
            // are already created and initialized
            statesCombo = $find("<%= cbxStates.ClientID%>");
            citiesCombo = $find("<%= cbxCities.ClientID%>");
        }
 
        function LoadStates(sender, eventArgs) {
            var item = eventArgs.get_item();
            statesCombo.set_text("Loading...");
            citiesCombo.clearSelection();
 
            // if a continent is selected
            if (item.get_index() > 0) {
                // this will fire the ItemsRequested event of the
                // countries combobox passing the continentID as a parameter
                statesCombo.requestItems(item.get_value(), false);
            }
            else {
                // the -Select a continent- item was chosen
                statesCombo.set_text(" ");
                statesCombo.clearItems();
 
                citiesCombo.set_text(" ");
                citiesCombo.clearItems();
            }
        }
 
        function LoadCities(sender, eventArgs) {
            var item = eventArgs.get_item();
 
            citiesCombo.set_text("Loading...");
            // this will fire the ItemsRequested event of the
            // cities combobox passing the countryID as a parameter
            citiesCombo.requestItems(item.get_value(), false);
        }
 
        function ItemsLoaded(sender, eventArgs) {
            if (sender.get_items().get_count() > 0) {
                // pre-select the first item
                sender.set_text(sender.get_items().getItem(0).get_text());
                sender.get_items().getItem(0).highlight();
            }
 
            sender.showDropDown();
        }
    </script>
</asp:Content>
Nencho
Telerik team
 answered on 24 Aug 2012
3 answers
108 views
hello!

There is a way to control z-index of dialog opened by send mail button?
My menu it's displayed over this dialog.
Any idea?

Marin Bratanov
Telerik team
 answered on 24 Aug 2012
7 answers
162 views
Hi all,
I have a rad list view and a rad filter ... i need to reduce the menu option containing rad filter . so i have use the below java script and code.
Script
<script type="text/javascript">
          function FilterCreated(sender, eventArgs) {
              var filterMenu = sender.get_contextMenu();
              filterMenu.add_showing(FilterMenuShowing);
          }
          function FilterMenuShowing(sender, eventArgs) {
              var filter = $find("<%= RadFilter2.ClientID %>");
              var currentExpandedItem = sender.get_attributes()._data.ItemHierarchyIndex;
              sender.findItemByValue("Between").set_visible(false);
              sender.findItemByValue("DoesNotContain").set_visible(false);
              sender.findItemByValue("EndsWith").set_visible(false);
              sender.findItemByValue("GreaterThan").set_visible(false);
              sender.findItemByValue("GreaterThanOrEqualTo").set_visible(false);
              sender.findItemByValue("IsEmpty").set_visible(false);
              sender.findItemByValue("IsNull").set_visible(false);
              sender.findItemByValue("LessThan").set_visible(false);
              sender.findItemByValue("LessThanOrEqualTo").set_visible(false);
              sender.findItemByValue("NotBetween").set_visible(false);
              sender.findItemByValue("NotEqualTo").set_visible(false);
              sender.findItemByValue("NotIsEmpty").set_visible(false);
              sender.findItemByValue("NotIsNull").set_visible(false);
              sender.findItemByValue("And").set_visible(false);
              sender.findItemByValue("NotAnd").set_visible(false);
              sender.findItemByValue("NotOr").set_visible(false);
              sender.findItemByValue("Or").set_visible(false);
              }
          }
      </script>

Aspx
<telerik:RadFilter runat="server" ID="RadFilter2" FilterContainerID="RadListView1"
   ClientSettings-ClientEvents-OnFilterCreated="FilterCreated"
      ExpressionPreviewPosition="Bottom">
   <FieldEditors>
      <telerik:RadFilterTextFieldEditor FieldName="ItemName" DisplayName="ItemName" DataType="System.String" />
              <telerik:RadFilterTextFieldEditor FieldName="ItemCode" DisplayName="ItemCode" DataType="System.String" />
  </FieldEditors>
 </telerik:RadFilter>

Rad Ajax Update:
<telerik:AjaxSetting AjaxControlID="RadFilter2">
  <UpdatedControls>
     <telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
      <telerik:AjaxUpdatedControl ControlID="RadFilter2" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
 </telerik:AjaxSetting>


Code
Protected Sub RadFilter2_AppyExpressions(ByVal sender As Object, ByVal e As RadFilterApplyExpressionsEventArgs)
       Dim provider As New RadFilterListViewQueryProvider(New List(Of RadFilterGroupOperation)())
       provider.ProcessGroup(e.ExpressionRoot)
       RadListView1.FilterExpressions.Add(provider.ListViewExpressions(0))
       RadListView1.Rebind()
   End Sub

 when i try to select the menu of the filter control that time am getting the error like "Microsoft JScript runtime error: Unable to get value of the property 'set_visible': object is null or undefined"

Please fix my issue... 

Regards,

Prassin

Pavlina
Telerik team
 answered on 24 Aug 2012
1 answer
76 views
Hi Friends,

My requirement is this:

Existing Functionality:
 After SpellCheck RadEditor is not editable.

New Requirements:
 After SpellCheck RadEditorshould be editable.

Please help on this. Its urgent.


Marin Bratanov
Telerik team
 answered on 24 Aug 2012
13 answers
413 views

How do you create cascading Dropdown for Resource Type. We have two resources added to appoint. Class and teacher. We want during time of creation of appointment. When user selects class. The teacher drop down should filter the data and show only teacher for that class. We are using Linqdatasource

question 1: For teacher Linqsource how can we pass parameter as class dropdown control value.
question 2: How can we define on selected index change event for dropdown class.
question 3: How can you make teacher dropdown invisible as default. and make it visible on selected index change event of Class dropdown.

 

 

Peter
Telerik team
 answered on 24 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?