Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
145 views
I have a rad scheduler that shows appointments based on a client click of a rad tree. It works fine until you check the tree and then switch views. I then loose the shown appointment. To see what I mean you can go to here alpha.clickablecommunity.com/calendar.aspx. Expand live music then concerts and check test. If you look at the 30th it shows up. However, change your view either to that week or day and it shows up for a second and then disappears. Can anyone help me out with keeping this visible if it's already checked on the rad tree?

Here is the aspx for my page
<%@ Page Title="Event Calendar" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master"
    CodeBehind="Calendar.aspx.vb" Inherits="ClickableCommunity.Calendar" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
    //this array keeps all of the events
    //that are showing
    arrOfEvents = new Array();


        
    //this function is called when they click the link
    //and not when they click the checkbox
    //it determines whether or not they clicked a checked node
    //and also whether or not they clicked a parent or child node
    function OnClientNodeClicking(sender, eventArgs) {

        //this is the current checked state of the node
        var checked = eventArgs.get_node().get_checked();

        //this is the current node
        var node = eventArgs.get_node();

        //set the node to the state that it is not currently in
        //basically this will mirror the effect of checking the node
        node.set_checked(!checked);

        //since the node state has changed we have to
        //redefine checked
        checked = eventArgs.get_node().get_checked();

        //this is the child node
        var childNodes = eventArgs.get_node().get_nodes();

        //this is the node level
        var nodeLevel = node.get_level();

        //split the value
        var tempValue = node.get_value();
        
        //if they clicked the node
        if (checked) {

            //if they clicked a parent node
            if (nodeLevel == 0) {

                UpdateAllChildren(childNodes, checked);

            } //if tempValue

            //if this is a child node then we
            //add a marker
            else if (childNodes.get_count() == 0) {
                
                showEvent(tempValue);

            } //else if

            //they clicked a child node
            else {
                UpdateAllChildren(childNodes, checked);
                //addMarker(tempValue);
            } //else

        } //if checked

        //they didn't check the node
        else {
            //if they clicked a parent node
            if (nodeLevel == 0) {

                UpdateAllChildren(childNodes, checked);

            } //if tempValue
            //if this is a child node then we
            //add a marker
            else if (childNodes.get_count() == 0) {

                hideEvent(tempValue);

            } //else if

            //they clicked a child node
            else {
                UpdateAllChildren(childNodes, checked);
                //removeMarker(tempValue);
            } //else
        }//else
    } //OnclientnodeClicking

    function UpdateAllChildren(nodes, checked) {
        var i;
        for (i = 0; i < nodes.get_count(); i++) {
            if (checked) {
                nodes.getNode(i).check();
                showEvent(nodes.getNode(i).get_value());
            } //if
            else {
                nodes.getNode(i).set_checked(false);
                hideEvent(nodes.getNode(i).get_value());
            } //else

            //these next three lines of code are if you have
            //child nodes within child nodes
            //i.e. Parent -> child 1 -> child1
            //     Parent -> child 1 -> child2
            //     Parent -> child 2 -> child1
            //     Parent -> child 2 -> child2
            //if you do and you want them also checked then
            //uncomment these three lines
            if (nodes.getNode(i).get_nodes().get_count() > 0) {
                UpdateAllChildren(nodes.getNode(i).get_nodes(), checked);
            }//if

        } //for

    } //UpdateAllChildren

    //this function is called when they click the checkbox
    //and not when they click the link
    //it determines whether or not they checked a checked node
    //and also whether or not they checked a parent or child node
    function OnClientNodeChecked(sender, eventArgs) {

        //this is the current checked state of the node
        var checked = eventArgs.get_node().get_checked();

        //this is the current node
        var node = eventArgs.get_node();

        //this is the child node
        var childNodes = eventArgs.get_node().get_nodes();

        //this is the node level
        var nodeLevel = node.get_level();

        //split the value
        var tempValue = node.get_value();
        
        //if they unchecked a node
        if (checked) {
            checked = false;
            //if they unchecked a parent node
            if (nodeLevel == 0) {
                
                UpdateAllChildren(childNodes, checked);
                
            } //if tempValue

            //if this is a child node then we
            //add a marker
            else if (childNodes.get_count() == 0) {

                //alert("unchecked child checked " + checked);
                hideEvent(tempValue);

            } //else if

            //they clicked a child node
            else {
                //alert("unchecked parent checked " + checked);
                UpdateAllChildren(childNodes, checked);
                hideEvent(tempValue);
            } //else

        } //if checked

        //they didn't check the node
        else {
            checked = true;
            //if they clicked a parent node
            if (nodeLevel == 0) {

                //alert("checked parent checked " + checked);
                checked = true;
                UpdateAllChildren(childNodes, checked);

            } //if tempValue
            //if this is a child node then we
            //add a marker
            else if (childNodes.get_count() == 0) {

                //alert("checked child checked " + checked);
                showEvent(tempValue);

            } //else if

            //they clicked a child node
            else {
                //alert("checked parent checked " + checked);
                checked = true;
                UpdateAllChildren(childNodes, checked);
                showEvent(tempValue);
            } //else
        } //else
    } //OnClientNodeChecked

    arrOfEvents = new Array();
    
    function itemClicked(sender, eventArgs) {

        //the value from the click
        var passedVal = eventArgs.get_item().get_value();

        //if the passedVal is something
        //then we add the marker
        if (passedVal) {
            
            var count = 0;
            var inCalendar = false;
            while (inCalendar == false && count < arrOfEvents.length) {

                if (passedVal == arrOfEvents[count]) {

                    inCalendar = true;
                    break;

                } //if passedVal

                count++;

            } //while count <

            //if it was in the map
            if (inCalendar) {
                arrOfEvents.splice(count, 1);
                hideEvent(passedVal);
            } //if inCalendar
            else {
                arrOfEvents.push(passedVal);
                showEvent(passedVal);
            }//else
            
        }//if passedVal

    } //itemClicked

</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="headerContent" runat="server">
</asp:Content>
<asp:Content ID="vew" ContentPlaceHolderID="viewMenuContent" runat="server">
    <span style="font-size: 3px;"><br /></span>
    Veiw:&nbsp;&nbsp;&nbsp;
        <telerik:RadComboBox ID="viewDrop" runat="server" Skin="Web20" Width="100px" Font-Size="12px"
            MarkFirstMatch="True" EnableVirtualScrolling="True" AutoPostBack="true">
            <CollapseAnimation Duration="1000" Type="InOutBack"></CollapseAnimation>
            <Items>
                <telerik:RadComboBoxItem Value="calendar" Text="Calendar" Selected="true" />
                <telerik:RadComboBoxItem Value="map" Text="Map" />
            </Items>
        </telerik:RadComboBox>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="leftMenu" runat="server">
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"
        Width="220px" Height="100%">
        <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Web20"
        AllowCollapseAllItems="false" Width="220px" ExpandMode="FullExpandedItem" OnClientItemClicked="itemClicked" BorderStyle="None">
            <CollapseAnimation Type="None" Duration="100"></CollapseAnimation>
            <Items>
                <telerik:RadPanelItem runat="server" Text="Things To Do" Font-Bold="true" Font-Size="Medium"
                    Expanded="true">
                    <Items>
                        <telerik:RadPanelItem runat="server" BorderStyle="None">
                            <ItemTemplate>
                                <telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Web20" CssClass="leftPanelContent"
                                    CheckBoxes="true" OnClientNodeChecking="OnClientNodeChecked" OnClientNodeClicking="OnClientNodeClicking">
                                </telerik:RadTreeView>
                            </ItemTemplate>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Search" Font-Bold="true" Font-Size="Medium">
                <Items>
                    <telerik:RadPanelItem BorderStyle="None">
                        <ItemTemplate>
                            <center>
                                <table>
                                    <tr>
                                        <td class="searchTable">
                                            <telerik:RadTextBox ID="searchInputTextBox" runat="server" Skin="Web20"
                                                             EmptyMessage="Enter Keywords" CssClass="searchTextBox"
                                                             EmptyMessageStyle-CssClass="emptyTextboxText"/>
                                        </td>
                                        <td class="searchTable">
                                            <asp:Button runat="server" ID="searchButton" Text="Search" OnClick="searchButtonClick" />        
                                        </td>
                                    </tr>
                                </table>
                            </center>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
                <Items>
                    <telerik:RadPanelItem CssClass="searchResultsText">
                        <ItemTemplate>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" SkinID="Web20" Height="75px" Transparency="1">
    <img alt="Searching..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.LoadingProgressBar.gif") %>'
        style="border: 0px;" />
</telerik:RadAjaxLoadingPanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="mainContentPlaceHolder" runat="server">
    <div id="divCalendar">
        <telerik:RadScheduler ID="RadScheduler1" runat="server" Height="460" DataEndField="stoptime"
            DataKeyField="eventid" DataStartField="starttime" DataSubjectField="name" HoursPanelTimeFormat="htt"
            Skin="Web20" ValidationGroup="RadScheduler1" GroupingDirection="Vertical" CssClass="calendarView"
            SelectedView="MonthView" WeekView-DayStartTime="08:00:00" WeekView-DayEndTime="23:59:00"
            WeekView-WorkDayEndTime="23:59:00" WeekView-WorkDayStartTime="08:00:00" WorkDayEndTime="23:59:00"
            DayEndTime="23:59:00" DayView-DayEndTime="23:59:00" DayView-DayStartTime="08:00:00"
            DayView-WorkDayEndTime="23:59:00" DayView-WorkDayStartTime="08:00:00" AllowDelete="false"
            AllowEdit="false" AllowInsert="false" TimelineView-NumberOfSlots="7">
        </telerik:RadScheduler>
    </div>
    <asp:SqlDataSource ID="eventsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
        SelectCommand="returnAllEvents" SelectCommandType="StoredProcedure"></asp:SqlDataSource>

    <script type="text/javascript">


        function pageLoad() {
            
            $ = $telerik.$;

            scheduler = $find('<%=RadScheduler1.ClientID %>');
            var panelBar = $find('<%=RadPanelBar1.ClientID %>');
            var item = panelBar.findItemByText("Things To Do");
            var treeview = item.get_items().getItem(0).findControl("RadTreeView1");

            //hide all of the events initially
            $(document).ready(function() {
                $(".rsApt").parent().hide();
            });

        } //pageLoad

        //this function will set an appointment to visible
        //it takes in the id of the event to show and assumes
        //there is a global variable of scheduler that is the
        //rad scheduler
        function showEvent(appID) {
            
            var tempArr = appID.split(";,;");
            var type = tempArr[0];
            var tempAppt = scheduler.get_appointments().findByID(appID);
            
            if (type != "Category" && tempAppt != null){
                
                var appDivID = "#" + scheduler.get_appointments().findByID(appID).get_element().id;
                $(appDivID).parent().show();
            
            }//if type

        } //showEvent

        //this function will set an appointment to
        //hidden. it takes in the id of the event to show and assumes
        //there is a global variable of scheduler that is the
        //rad scheduler
        function hideEvent(appID) {
            var tempArr = appID.split(";,;");
            var type = tempArr[0];
            
            var tempAppt = scheduler.get_appointments().findByID(appID);
            if (type != "Category" && tempAppt != null) {
                
                var appDivID = "#" + scheduler.get_appointments().findByID(appID).get_element().id;
                $(appDivID).parent().hide();

            }//if type
        } //hideEvent

    </script>

</asp:Content>

And here is the vb
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports Telerik.Web.UI
Partial Public Class Calendar
    Inherits System.Web.UI.Page
    Dim connection As String = ConfigurationManager.ConnectionStrings("connectionString").ConnectionString.ToString

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Dim tree As RadTreeView = DirectCast(RadPanelBar1.FindItemByText("Things To Do").Items(0).FindControl("RadTreeView1"), RadTreeView)
            tree.DataSource = CreateTable()
            tree.DataFieldID = "ID"
            tree.DataFieldParentID = "ParentID"
            tree.DataTextField = "Text"
            tree.DataValueField = "Value"
            tree.DataBind()

            ''popluate the events
            populateCalendar()

        End If

        

        'we have to set different heights if it's ie 7
        Dim bc As HttpBrowserCapabilities
        Dim s As String = ""
        bc = Request.Browser
        'get the browser version
        With bc
            s &= .Browser & .MajorVersion
        End With

        'if it's ie7
        If (s = "IE7") Then
            RadPanelBar1.Height = "488.5"
        Else
            RadPanelBar1.Height = "486"
        End If

    End Sub 'page load

    Protected Sub searchButtonClick(ByVal sender As Object, ByVal e As System.EventArgs)

        'set the output css class
        Dim output As String = ""

        'the panel bar instance
        Dim panelBar As New RadPanelItem
        panelBar = RadPanelBar1.FindItemByText("Search")

        'the textbox input
        Dim textbox As RadTextBox = DirectCast(RadPanelBar1.FindItemByText("Search").Items(0).FindControl("searchInputTextBox"), RadTextBox)

        'we need to remove any of the child items
        'so we go through all of the child items
        For Each childItem As RadPanelItem In RadPanelBar1.GetAllItems

            'if this has some sort of value
            'then we remove it because it was
            'a child that was added by the search
            'function

            If (childItem.Value <> "") Then

                childItem.Visible = False

            End If 'if childItem

        Next

        'my sql connection
        Dim myConn As New Data.SqlClient.SqlConnection(connection)

        'the name of the stored procedure
        Dim strSQL As String = "searchForEvents"

        Dim returnCommand As New Data.SqlClient.SqlCommand(strSQL, myConn)

        'add the parameters
        returnCommand.Parameters.AddWithValue("@searchString", "%" & textbox.Text.ToString & "%")

        'tell the system it is a stored procedure
        returnCommand.CommandType = CommandType.StoredProcedure

        Try
            myConn.Open()
            Dim dr As SqlDataReader = returnCommand.ExecuteReader()

            'if we have stuff to add
            If (dr.HasRows) Then

                While dr.Read()

                    Dim tempItem As New RadPanelItem()
                    tempItem.CssClass = "searchResultsText"
                    tempItem.Text = dr.Item(4)
                    tempItem.Value = dr.Item(0)
                    panelBar.Items.Add(tempItem)

                End While 'while dr.read()        

            Else
                Dim tempItem As New RadPanelItem()
                tempItem.CssClass = "searchResultsText"
                tempItem.Text = "Sorry you search did not return any <br>results." & _
                          " Please try again."
                tempItem.Value = "no results"
                panelBar.Items.Add(tempItem)

            End If


        Catch ex As Exception

            Dim tempItem As New RadPanelItem()
            tempItem.CssClass = "searchResultsText"
            tempItem.Text = "Oops, there was an error, please try <br>again."
            panelBar.Items.Add(tempItem)

        End Try

    End Sub 'searchButtonClick

    'this function adds all of the events to the calendar
    'and sets them to hidden
    Private Function populateCalendar()

        'the calendar object
        Dim calendar As RadScheduler = RadScheduler1

        'my sql connection
        Dim myConn As New Data.SqlClient.SqlConnection(connection)

        'the name of the stored procedure
        Dim strSQL = "returnAllEvents"

        myConn.Open()
        Dim insertCommand As New Data.SqlClient.SqlCommand(strSQL, myConn)
        Dim dr As SqlDataReader = insertCommand.ExecuteReader

        If (dr.HasRows) Then

            While dr.Read()

                'SELECT eventid, FK_CategoryID, latitude, longitude, events.name, description, businesses.name,
                '7starttime, stoptime, locations.street, locations.city, locations.state, locations.zip
                Dim tempEvent As New Appointment(dr(0), dr(7), dr(8), dr(4))

                'tempEvent.Visible = False
                calendar.InsertAppointment(tempEvent)

            End While 'while dr.read()

        End If 'if dr.hasrows

    End Function 'populateCalendar

    'this function creates a datatable for the rad
    'tree that is in the events panel
    Private Function CreateTable() As DataTable
        'set up my connection to the database
        Dim conn As New SqlConnection
        conn.ConnectionString = ConfigurationManager.ConnectionStrings("connectionString").ConnectionString
        Dim table As DataTable = New DataTable()
        table.Columns.Add("ID")
        table.Columns.Add("ParentID")
        table.Columns.Add("Text")
        table.Columns.Add("Value")

        'this is a counter for the id fields
        'of the data table
        Dim count As Integer = 1

        'this adds the parent categories to the
        'datatable
        Dim categoryQuery As New SqlCommand
        conn.Open()
        categoryQuery.Connection = conn
        categoryQuery.CommandText = "select CategoryId, Name, ParentId from categories where type='event' order by name"
        Dim cdr As SqlDataReader = categoryQuery.ExecuteReader()
        While cdr.Read()

            If (cdr.Item(0).ToString <> "") Then


                If (cdr.Item(2) = 0) Then

                    table.Rows.Add(New String() {cdr.Item(0).ToString(), Nothing, cdr.Item(1).ToString, _
                              ("Category;,;" & cdr.Item(0).ToString())})

                Else

                    table.Rows.Add(New String() {cdr.Item(0).ToString(), cdr.Item(2).ToString, cdr.Item(1).ToString, _
                              ("Category;,;" & cdr.Item(0).ToString())})

                End If

            End If

        End While 'while cdr.Read()
        conn.Close()

        'this adds the events with their parent category
        'id to the datatable
        Dim eventQuery As SqlCommand = New SqlCommand("returnAllEvents", conn)
        eventQuery.CommandType = CommandType.StoredProcedure

        conn.Open()
        eventQuery.Connection = conn
        eventQuery.CommandType = CommandType.StoredProcedure
        Dim edr As SqlDataReader = eventQuery.ExecuteReader()

        While edr.Read()

            If (edr.Item(0).ToString <> "") Then

                '0eventid, 1FK_CategoryID, 2latitude, 3longitude, 4events.name, 5description, 6businesses.name,
                '7starttime, 8stoptime, 9locations.street, 10locations.city, 11locations.state, 12locations.zip
                table.Rows.Add(New String() {"child" & edr.Item(0).ToString, edr.Item(1).ToString, edr.Item(4).ToString, _
                                            edr.Item(0)})

                'we have to increment count to keep an id for the data table
                count = count + 1

            End If

        End While 'while edr.Read()

        Return table

    End Function 'CreateGenreTable

    Private Sub viewDrop_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles viewDrop.SelectedIndexChanged
        If (viewDrop.Text = "Map") Then
            Response.Redirect("Default.aspx")
        End If
    End Sub
End Class

Thanks,
Web Services
Top achievements
Rank 2
 answered on 08 Dec 2009
3 answers
109 views
I have a problem with a RadUpload while using it in a RadGrid. In Firefox this RadUpload is presented just fine, when i try to use it in Internet Explorer, the RadUpload  is messed up. THis means that it don't adjust the skin to the control and also shows the "browse" option on weird places when i hover the control. I attached 2 printscreens to this message to show the problem.

Beneath i have the code.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucKlantDocumenten.ascx.cs" 
    Inherits="VEGAS.Klanten.ucKlantDocumenten" %> 
<telerik:RadGrid ID="RGKlantDocumenten" runat="server" GridLines="None" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="True" OnPreRender="RGKlantDocumenten_PreRender" 
    OnNeedDataSource="RGKlantDocumenten_NeedDataSource" OnItemCommand="RGKlantDocumenten_ItemCommand" 
    Skin="Telerik" OnDetailTableDataBind="RGKlantDocumenten_DetailTableDataBind" AllowMultiRowSelection="False"
    <PagerStyle Mode="NumericPages"></PagerStyle> 
    <MasterTableView Width="100%" DataKeyNames="intKlantDocumentID" EditMode="PopUp"
        <DetailTables> 
            <telerik:GridTableView DataKeyNames="intDocumentID" Width="100%" SkinID="2" Name="FysiekDocument" 
                runat="server" HierarchyLoadMode="Client" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Upload document" 
                CommandItemSettings-RefreshText="Vernieuw" EditMode="Popup"
                <Columns> 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1"
                        <HeaderStyle Width="20px" /> 
                        <ItemStyle CssClass="MyImageButton" /> 
                    </telerik:GridEditCommandColumn> 
                    <telerik:GridBoundColumn DataField="intDocumentID" UniqueName="intDocumentID" Visible="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="strDocumentNaam" UniqueName="strDocumentNaam" 
                        HeaderText="Documentnaam" Visible="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="strFileName" UniqueName="strFileName" HeaderText="Document" 
                        Visible="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="strDocumentextensie" HeaderText="Documentextensie" 
                        SortExpression="strDocumentextensie" UniqueName="strDocumentextensie"
                    </telerik:GridBoundColumn> 
                    <telerik:GridDateTimeColumn DataField="dtmUpload" HeaderText="Upload datum" UniqueName="dtmUpload" 
                        DataFormatString="{0:dd/MM/yyyy}"
                    </telerik:GridDateTimeColumn> 
                    <telerik:GridBoundColumn DataField="intKlantDocumentID" UniqueName="intKlantDocumentID" 
                        Visible="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridTemplateColumn> 
                        <ItemTemplate> 
                            <asp:LinkButton ID="btnTTT333TTT" runat="server" Text='<%# Eval("strFileName") %>' 
                                CommandName="Download" /> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridButtonColumn ConfirmText="Wilt u dit klantdocument verwijderen?" ButtonType="ImageButton" 
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1"
                        <HeaderStyle Width="20px" /> 
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                    </telerik:GridButtonColumn> 
                </Columns> 
                <EditFormSettings UserControlName="ucKlantDocumentDetails.ascx" EditFormType="WebUserControl"
                    <EditColumn UniqueName="EditCommandColumn1"
                    </EditColumn> 
                    <PopUpSettings ScrollBars="Auto" Height="300px" Width="550px"></PopUpSettings> 
                </EditFormSettings> 
            </telerik:GridTableView> 
        </DetailTables> 
        <Columns> 
            <telerik:GridBoundColumn DataField="intKlantDocumentID" UniqueName="intKlantDocumentID" 
                Visible="true"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="strTypeStap" UniqueName="strTypeStap" Visible="true"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="intBeheerDocumentID" UniqueName="intBeheerDocumentID" 
                Visible="true" HeaderText="Document ID"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="strDocumentNaam" UniqueName="strDocumentNaam" 
                HeaderText="Documentnaam" Visible="true"
            </telerik:GridBoundColumn> 
            <telerik:GridDateTimeColumn DataField="dtmVerloopdatum" HeaderText="Verloop datum" 
                UniqueName="dtmVerloopdatum" DataFormatString="{0:dd/MM/yyyy}"
            </telerik:GridDateTimeColumn> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 

Larevenge
Top achievements
Rank 1
 answered on 08 Dec 2009
2 answers
112 views
I have searched the demo's, FAQ's, and this forum for answers.  How do I get the Value Data Tables to format into Currency?
David
Top achievements
Rank 1
 answered on 08 Dec 2009
7 answers
205 views
Hello,

I created a customer control. Based on RadCombobox.

For this control I have to used your workaround http://www.telerik.com/help/aspnet-ajax/back-button-combo-selected-value.html

I add a HiddenControl to my customer class.

Additional I added a js script with GetScriptDescriptors and GetScriptReferences
to implement the js workaround logic.

But it doesn't work.

I add the js on this way:

protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors()   
 {  
   var desc = base.GetScriptDescriptors().Single() as ScriptControlDescriptor;   
   desc.Type = "MyCombobox";   
   desc.AddProperty("HiddenFieldId", this.hiddenValueField.ClientID);  
  //Note: If I use here AddElementProperty the property in js will be null  
   yield return desc;   
 }  
 
protected override IEnumerable<ScriptReference> GetScriptReferences()   
{  
   return base.GetScriptReferences().Concat(this.GetMyScriptReferences());   
}  
 
MyCombobox.js  
...   
   
OnLoad:   
function() {   
 this.add_selectedIndexChanged(this._selectItemHandler);   
 var savedValue = $get(this._hiddenFieldId).value;   
 if (savedValue != "" && this.findItemByValue(savedValue)) {   
 this.findItemByValue(savedValue).select();   
}  
 
},  
...  
 

 

 


In OnLoad this._hiddenFieldId has the correct id, but $get or $find returns NULL.

What is wrong? Have I implement the methods GetScriptDescriptors() and GetScriptReferences() on the right way?

Thanks for support

lemon

 

Simon
Telerik team
 answered on 08 Dec 2009
1 answer
134 views
I am having a few issues and am trying to figure out how to overcome them.  My first issue is a drop down in my edit form.  I am setting the selected value equal to the value from my data source.  However on insert their is not value so I do I handle the null situation?

Second In my entity data source control I have 2 other enitites I am including, once again though on insert, I receive errors when databinding my controls in the edit form template to any of the included entities.  Again I am unsure how to get past this.  I imagine the fix for my first problem will solve this one.

Finally I am unsure how to link the buttons in my edit form template to the proper events in the entity data source control for crud operations.  Thanks!
<asp:ScriptManager ID="ScriptManager1" runat="server">  
            </asp:ScriptManager> 
            <br /> 
            <asp:EntityDataSource ID="VendorRemittanceDataSource" runat="server" ConnectionString="name=RITSNetEntities" 
                DefaultContainerName="RITSNetEntities" EnableInsert="True" EnableUpdate="True" 
                EntitySetName="VendorRemittance" AutoGenerateWhereClause="True" Where="" EntityTypeFilter="VendorRemittance" 
                Include="Remittance, Vendors" EnableDelete="True">  
                <WhereParameters> 
                    <asp:QueryStringParameter DbType="Int32" Name="Vendors.CompanyEntityId" QueryStringField="1" /> 
                </WhereParameters> 
            </asp:EntityDataSource> 
            <asp:ObjectDataSource ID="CurrencyDataSource" runat="server"   
                SelectMethod="RetrieveLookupsByLookupTypeId"   
                TypeName="Graebel.RITS.Components.BusinessManagers.LookupManager">  
                <SelectParameters> 
                    <asp:Parameter DefaultValue="106" Name="lookupTypeId" Type="Int32" /> 
                </SelectParameters> 
            </asp:ObjectDataSource> 
            <telerik:RadGrid ID="RemittanceGrid" runat="server" AllowAutomaticInserts="True" 
                AllowAutomaticUpdates="True" AllowSorting="True" AutoGenerateColumns="False" 
                GridLines="None" Skin="Telerik" ShowStatusBar="True" DataSourceID="VendorRemittanceDataSource" 
                OnItemCommand="RemittanceGrid_ItemCommand" AutoGenerateEditColumn="True">  
                <PagerStyle Mode="NumericPages" AlwaysVisible="True" /> 
                <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="VendorRemittanceId" 
                    DataSourceID="VendorRemittanceDataSource">  
                    <Columns> 
                        <telerik:GridBoundColumn UniqueName="RemittanceId" Visible="False" DataField="Remittance.RemittanceId">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Bank Name" UniqueName="BankName" DataField="Remittance.BankName">  
                            <HeaderStyle HorizontalAlign="Center" /> 
                            <ItemStyle HorizontalAlign="Center" /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Account #" UniqueName="Account" DataField="Remittance.AccountNumber">  
                            <HeaderStyle HorizontalAlign="Center" /> 
                            <ItemStyle HorizontalAlign="Center" /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Currency" UniqueName="Currency" DataField="Lookups.Text.Description">  
                            <HeaderStyle HorizontalAlign="Center" /> 
                            <ItemStyle HorizontalAlign="Center" /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Sequence" UniqueName="Sequence" DataField="SequenceNum">  
                            <HeaderStyle HorizontalAlign="Center" /> 
                            <ItemStyle HorizontalAlign="Center" /> 
                        </telerik:GridBoundColumn> 
                    </Columns> 
                    <EditFormSettings EditFormType="Template">  
                        <FormTemplate> 
                            <table style="width: 100%;">  
                                <tr> 
                                    <td> 
                                        Currency:  
                                    </td> 
                                    <td> 
                                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="CurrencyDataSource"   
                                        DataTextField="Description" DataValueField="LookupId" SelectedValue='<%# Bind("Lookups.LookupId") %> '>  
                                        <asp:ListItem Text="Select" Value=null></asp:ListItem> 
                                        </asp:DropDownList> 
                                    </td> 
                                    <td> 
                                        Non-Currency Specific Vendor:  
                                    </td> 
                                    <td> 
                                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsGlobalCurrency") %> ' /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        Bank Sequence:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind( "SequenceNum") %> '></asp:TextBox> 
                                    </td> 
                                    <td> 
                                        Account #:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind( "Remittance.AccountNumber") %> '></asp:TextBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        Payable Name:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind( "Remittance.PayableName") %> '></asp:TextBox> 
                                    </td> 
                                    <td> 
                                        ABA Transit Route #:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind( "Remittance.ABATransitRoutingNumber") %> '></asp:TextBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        Swift Code:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind( "Remittance.SWIFTCode") %> '></asp:TextBox> 
                                    </td> 
                                    <td> 
                                        ISO Package Received:  
                                    </td> 
                                    <td> 
                                        <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind( "Remittance.HasISOPackage") %> ' /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        Bank Name:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind( "Remittance.BankName") %> '></asp:TextBox> 
                                    </td> 
                                    <td> 
                                        Bank Address:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind( "Remittance.Addresses.Address1") %> '></asp:TextBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind( "Remittance.Addresses.Address2") %> '></asp:TextBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        City:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind( "Remittance.Addresses.City") %> '></asp:TextBox> 
                                    </td> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                    <td> 
                                        <uc1:StateCountryFields ID="m_stateCountryFields" runat="server" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        Zip:  
                                    </td> 
                                    <td> 
                                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind( "Remittance.Addresses.Zip") %> '></asp:TextBox> 
                                    </td> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td align="right" colspan="2">  
                                        <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>  
                                        </asp:Button> 
                                    </td> 
                                    <td> 
                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" 
                                            CommandName="Cancel"></asp:Button> 
                                    </td> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                    <td> 
                                        &nbsp;  
                                    </td> 
                                </tr> 
                            </table> 
                        </FormTemplate> 
                    </EditFormSettings> 
                </MasterTableView> 
            </telerik:RadGrid> 
Adam Hager
Top achievements
Rank 1
 answered on 08 Dec 2009
1 answer
124 views
Hi - I had a problem making the RadAjaxLoadingPanel appear whenever I did a postback. I finally found the solutin and thought I'd share it here.

What I experienced was that everytime I did a postback, the control over whom the loading panel was to appear would be hidden, and the reappear when the operation was completed.

I had this in my aspx page:
  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
  </telerik:RadAjaxLoadingPanel>

When I changed it to:
  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
  </telerik:RadAjaxLoadingPanel>

everything now worked as expected.  :-)

Regards
Thomas
Pavlina
Telerik team
 answered on 08 Dec 2009
3 answers
80 views
IE8, return generates 2 lines.  This wasn't a problem with 2009.3.1102.35.     I needed the newer version of the DLL to fix the problem with the Combobox issue.

What version of DLL is this running?
http://demos.telerik.com/aspnet-ajax/editor/examples/editorastextbox/defaultcs.aspx

Shift-Enter generates 1 line.   If I use the margin:0px below, on the screen it's fine, but it still retained <p> in the code, which in my HTML email it displays with additional lines.   NewLineBr=true/false doesn't make a difference.
Removing OnClientLoadRadEditor() doesn't make a difference.

P  
{  
    margin:0px;  
}  

                <telerik:RadEditor ID="txtNewComment" OnClientLoad="OnClientLoadRadEditor" runat="server" AutoResizeHeight="True" Skin="Office2007" 
                      BorderStyle="None" BorderWidth="0px" ToolsWidth="345px" ToolbarMode="ShowOnFocus" 
                        EditModes="Design" ToolsFile="BasicTools.xml" Width="720px" Height="50px" > 
                    <Content> 
                    </Content> 
                </telerik:RadEditor> 
             function OnClientLoadRadEditor(editor, args)   
                {   
                    var style = editor.get_contentArea().style;   
                    style.fontFamily= 'Arial';   
                    style.fontSize= 12 + 'px';   
                  
                    var tool = editor.getToolByName("FontName");   
                  
                    if (tool)   
                    {   
                            tool.set_value("Arial");  
                    }  
                      
                    var tool2 = editor.getToolByName("RealFontSize");   
                  
                    if (tool2)   
                    {   
                            tool2.set_value("10px"); 
                    } 
                    editor.removeShortCut("InsertTab"); 
                }     

Rumen
Telerik team
 answered on 08 Dec 2009
1 answer
79 views
I'm new with RadScheduler. Can anyone tell me how to do nested quarter views? I need to first group by year, and then by quarter. Thank you in advance for your help!
Peter
Telerik team
 answered on 08 Dec 2009
3 answers
71 views
Hi

I have 2 radmenus on a page and I use the ajaxmanagere to ajaxify the click events as per normal

the mark up looks something like this , obviously with the specific panels to open referenced inside the <UpdatedControls> tag

<%--menu 1 --%> 
                 
<telerik:AjaxSetting AjaxControlID="i0"
<telerik:AjaxSetting AjaxControlID="i1"
<telerik:AjaxSetting AjaxControlID="i2"
 
<%--menu 2--%> 
    
<telerik:AjaxSetting AjaxControlID="i0"
<telerik:AjaxSetting AjaxControlID="i1"
<telerik:AjaxSetting AjaxControlID="i2"
<telerik:AjaxSetting AjaxControlID="i3"
<telerik:AjaxSetting AjaxControlID="i4"
 

The loading panel does not seem to want to fire for Menu 2 and I have lost some functionality in Menu 1 too, Is this because the AjaxControlID's have the same name ? and if so how do I distinguish between them

Yana
Telerik team
 answered on 08 Dec 2009
1 answer
132 views
Can anyone tell me how to do nested resources in RadScheduler? I need to first group the resoource by building name, and then by meeting room. Thank you in advance!
Peter
Telerik team
 answered on 08 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?