Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
66 views
Dear Sir,

I want to open appointment context menu using left click.
For Example :- When i click on appointment then open context menu using left click.

U gave time slot context menu solution.
but i want Appointment Context Menu using left menu.

Following Code Works For Time Slot Context Menu But Not For Appointment Context Menu.

function OnClientTimeSlotClick(sender, args) {
            sender._showTimeSlotContextMenu(args.get_domEvent(), args.get_targetSlot());
        }

So please Help Me.


Thanks
Chandan Kumar
Chandan Kumar
Top achievements
Rank 1
 answered on 15 Nov 2010
3 answers
158 views
Hello Sir,

Can i open Appointment Context menu using Mouse Left Click.
Means When i click on left mouse button on any appointment then open my Context menu and work all menu.

Please Help Me.

Thanks
Chandan Kumnar
Shinu
Top achievements
Rank 2
 answered on 15 Nov 2010
5 answers
217 views
Hey, 

I'm trying to figure out how to make ajaxManager.ajaxRequestWIthTarget function with a RadMenu.

The issue is that there's a timed javascript function that needs to call an AJAX request with a specific item in the RadMenu. 

The below...
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
ajaxManager.ajaxRequestWithTarget('<%= ReportPageMenu.FindItemByValue("MyItemValue").UniqueID %>', '');
doesn't accomplish the desired behaviour, the handler behind the ReportPageMenu is never hit in the code.

<telerik:RadMenu runat="server" ID="ReportPageMenu" OnItemClick="ReportMenuHandler"/>


What's the correct/best way to achieve a postback caused by ajaxRequestWithTarget that forces the code in the onItemClick for the RadMenu to fire off with the correct sender/args? 

Thanks

Iana Tsolova
Telerik team
 answered on 15 Nov 2010
7 answers
470 views
I guess these aren't really problems per se, but I'd find it odd if I were the only one that wanted to see these fixes implemented, so I have decided to create a thread with a fix in the hopes that someone will clean it up and make it a permanent solution, and that I can help others with a similar problem implement the missing functionality.

So starting with shift click...

<body onkeydown="setShift(event)" onkeyup="setShift(event)">
  <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
            <script type="text/javascript">   
               //I normally put this code right in the form (first item)
               var shiftKey=false;
               var treeView;
 
                function pageLoad()
                {
                    treeView = $find ("<%= treeYourTree.ClientID %>");
                }
 
               //capture the shift key for copying
               function setShift(e)
               {
                    if (window.event)
                    {
                        shiftKey = window.event.shiftKey;
                    }
                    else
                    {
                        if (e.shiftKey)
                        {
                            shiftKey=true;
                        }
                        else
                        {
                            shiftKey=false;
                        }
                    }
               }
 
               function onNodeClicked(sender, eventArgs)
               {             
                    if (shiftKey)
                    {
                        treeView.trackChanges();
                        //We should have selected nodes if we are shift clicking
                        if (treeView.get_selectedNodes!=null)
                        {
                            //Capture the first selected node and the current selected node
                            var firstSelected = treeView.get_selectedNodes()[0];
                            var currentSelected = eventArgs.get_node();
                            //Unselect all the nodes and initialize the continue / iteration boolean
                            treeView.unselectAllNodes;
                            var cont=false;
                             
                            //Iterate through the parent's children (iterate through the same level as selected)
                            for (var i=0; i< firstSelected.get_parent().get_nodes().get_count(); i++)
                            {
                                currItNode = firstSelected.get_parent().get_nodes().getNode(i);
                                cont = (cont)? !(currItNode == firstSelected || currItNode == currentSelected)
                                               :(currItNode == firstSelected || currItNode == currentSelected);
                                 
                               if (cont && firstSelected.get_parent().get_nodes().getNode(i))
                                        firstSelected.get_parent().get_nodes().getNode(i).select();
                            }
                             
                        }
                        treeView.commitChanges();
                    }
               }
     </script>
  </telerik:RadCodeBlock>
 
<-- tree goes somewhere in here with OnClientNodeClicked="onNodeClicked" -->
</body>
Pay special attention to body onkey events in my provided code.  This has been tested in IE and FireFox.

Known limitations:
  1.  When shift selecting from a child through another parent, it gets weird.  As it stands now, this allows shift selecting under the parent of the beginning of the first shift click ONLY, and I don't have the need or the time to get into fixing that, although I suspect it's an easy fix.  It does, however, allow for shift clicking up and down the current node.
  2.  You can shift click, then ctrl-click other items, but if you do a subsequent shift click, it gets weird again.  Once again, I don't have the need to fix this at the moment.

My subsequent post will cover copying and pasting an entire tree node.  It should be noted that this script and the following script can be used in conjunction (I am actually using both on the same page).
Naisha
Top achievements
Rank 1
 answered on 15 Nov 2010
1 answer
174 views
Hi:
I have a RadGrid that worked fine until 2010.2.929 version. But when upgrade to 2010.3.1109 version is show the following error:

Sys.WebForms.PageRequestManagerServerErrorException: No default member found for type 'DynamicClass1'

When re-built the RadGrid, I found the problem when add a GridCalculatedColumn,  I removing the CalculatedColumn from RadGrid and this working fine. RadGrid is into a WebUser Control (ascx) and this is loaded from RadTabStrip

Thanks for your help.
  
Alejandro Genovesi
Top achievements
Rank 2
 answered on 15 Nov 2010
1 answer
185 views
Hi, I am using load on demand because my database is slow and i don't want to preload all my combo boxes when the page first initializes.

The load on demand for the radcombobox almost works except:
1) I can't turn off text typing
2) The loaded options don't cache. Each time I refresh the radcombobox, the loaded combobox items are gone and when i focus on the combobox the 'loading...' happens again.

So basically I just want a regular combobox with some items that only load on the first use of the combobox and then are cached for the lifetime of the page. Is it possible?

Here is a code snippet:

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Button1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
  
<telerik:RadComboBox ID="RadComboBox1" Runat="server" 
    ChangeTextOnKeyBoardNavigation="False" EmptyMessage="Select A Company..." 
    EnableItemCaching="True" EnableLoadOnDemand="True" EnableTextSelection="False" 
    onitemsrequested="RadComboBox1_ItemsRequested" >
</telerik:RadComboBox>
Princy
Top achievements
Rank 2
 answered on 15 Nov 2010
0 answers
162 views
my RadScheduler code is below. when i am click for create appointment then i want to fill dropdown list from server side(database)
and my dropdown list is in ."InlineInsertTemplate". i can not get onclick event of InlineInsertTemplate.

<telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Office2007" EnableEmbeddedSkins="True"
        ShowFooter="true" DayStartTime="08:00:00" DayEndTime="16:59:00" TimeZoneOffset="00:00:00"
        OverflowBehavior="Scroll" SelectedView="MonthView" Height="550px" DataSourceID="SchdulerDataSource"
        OnAppointmentInsert="RadScheduler1_AppointmentInsert" TimelineView-UserSelectable="false"
        FirstDayOfWeek="Monday" LastDayOfWeek="Saturday" CustomAttributeNames="Description,Date,AppointmentId"
        DataStartField="Start" DataSubjectField="Subject" DataKeyField="AppointmentId"
        DataEndField="End" Width="100%" AllowDelete="true" RowHeight="50px" DisplayDeleteConfirmation="true"
        StartEditingInAdvancedForm="False" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
        OnAppointmentCommand="RadScheduler1_AppointmentCommand" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
        OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" MinutesPerRow="15"
        MonthView-VisibleAppointmentsPerDay="4" DayView-DayEndTime="16:59:00" OnAppointmentClick="RadScheduler1_OnAppointmentClick">
       <InlineInsertTemplate>
            <div>
                <table width="100%" cellpadding="3" align="center">
                    <tr>
                        <td align="left" valign="middle" width="30%">
                            <asp:Label ID="Label3" runat="server" Text="Title"></asp:Label>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" Display="Dynamic"
                                ControlToValidate="txtTitle">*</asp:RequiredFieldValidator>
                        </td>
                        <td align="left" valign="middle" width="70%">
                            <asp:TextBox ID="txtTitle" Text='<%# Bind("Subject") %>' runat="server" CssClass="txtfield"
                                Width="166px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                            <asp:Label ID="Label1" runat="server" Text="Description"></asp:Label>
                        </td>
                        <td align="left" valign="middle">
                            <asp:TextBox ID="txtDescription" Text='<%# Bind("Description") %>' runat="server"
                                Width="166px" TextMode="MultiLine" BorderStyle="Solid" BorderWidth="1px" BorderColor="#666666"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                            <asp:Label ID="Label5" runat="server" Text="Coder"></asp:Label>
                        </td>
                        <td align="left" valign="middle">
                            <asp:DropDownList id="drpcoder" runat="server" DataSourceID="DSGetCoder" DataTextField="UserNameNew" DataValueField="UserID">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    
                    
                    <tr>
                     
                        <td align="left" valign="middle">
                            <asp:Label ID="Label2" runat="server" Text="From"></asp:Label>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" Display="Dynamic"
                                ControlToValidate="picFrom">*</asp:RequiredFieldValidator>
                        </td>
                        <td align="left" valign="middle">
                             <telerik:RadDateTimePicker SelectedTime="08:00" SelectedDate='<%# Bind("Start")%>'  ID="picFrom" runat="server"
                                Width="170px" Calendar-AutoPostBack="false"  >
                                <ClientEvents OnDateSelected="DateSelected" OnPopupOpening="PopupOpening" />
                           </telerik:RadDateTimePicker>
                                
                
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                            <asp:Label ID="Label4" runat="server" Text="To"></asp:Label>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" Display="Dynamic"
                                ControlToValidate="picTo">*</asp:RequiredFieldValidator>
                        </td>
                        <td align="left" valign="middle">
                            <telerik:RadDateTimePicker SelectedDate='<%# Bind("Start")%>' SelectedTime="08:00"  ID="picTo" runat="server"
                                Width="170px" Calendar-AutoPostBack="false" >
                                <ClientEvents OnDateSelected="DateSelected2" OnPopupOpening="PopupOpening2" />
                               <%--<TimeView CellSpacing="-1" runat="server" StartTime="07:00" EndTime="23:00" Interval="0:15:0" Columns="6" OnClientTimeSelected="ClientTimeSelected"></TimeView>--%>
                            </telerik:RadDateTimePicker>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle" colspan="2" height="20">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                        </td>
                        <td align="left" valign="middle">
                            <asp:LinkButton runat="server" ID="InsertLinkButton" CommandName="Insert" Text="Insert"></asp:LinkButton>
                            &nbsp;
                            <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" CausesValidation="false"
                                Text="Cancel"></asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </div>
        </InlineInsertTemplate>
           <InlineEditTemplate>
            <div>
                <table width="100%" cellpadding="3" align="center">
                    <tr>
                        <td align="left" valign="middle" width="30%">
                            <asp:Label ID="Label3" runat="server" Text="Title"></asp:Label>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" Display="Dynamic"
                                ControlToValidate="txtTitle">*</asp:RequiredFieldValidator>
                        </td>
                        <td align="left" valign="middle" width="70%">
                            <asp:TextBox ID="txtTitle" Text='<%# Bind("Subject") %>' CssClass="txtfield" runat="server"
                                Width="166px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                            <asp:Label ID="Label1" runat="server" Text="Description"></asp:Label>
                        </td>
                        <td align="left" valign="middle">
                            <asp:TextBox ID="txtDescription" Text='<%# Bind("Description") %>' runat="server"
                                Width="166px" BorderStyle="Solid" BorderWidth="1px" BorderColor="#666666" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                     <tr>
                        <td align="left" valign="middle">
                            <asp:Label ID="Label5" runat="server" Text="Coder"></asp:Label>
                        </td>
                        <td align="left" valign="middle">
                            <asp:DropDownList id="drpcoder" runat="server"></asp:DropDownList>
                            
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                            <asp:Label ID="Label2" runat="server" Text="From"></asp:Label>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" Display="Dynamic"
                                ControlToValidate="picFrom">*</asp:RequiredFieldValidator>
                        </td>
                        <td align="left" valign="middle">
                            <telerik:RadDateTimePicker ID="picFrom" DbSelectedDate='<%# Bind("Start") %>' runat="server"
                                Width="170px">
                            </telerik:RadDateTimePicker>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                            <asp:Label ID="Label4" runat="server" Text="To"></asp:Label>
                            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator4" Display="Dynamic"
                                ControlToValidate="picTo">*</asp:RequiredFieldValidator>
                        </td>
                        <td align="left" valign="middle">
                            <telerik:RadDateTimePicker ID="picTo" DbSelectedDate='<%# Bind("End") %>' runat="server"
                                Width="170px" Calendar-AutoPostBack="false">
                            </telerik:RadDateTimePicker>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle" colspan="2" height="20">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle">
                        </td>
                        <td align="left" valign="middle">
                            <asp:LinkButton runat="server" ID="InsertLinkButton" CommandName="Update" Text="Update"></asp:LinkButton>
                            &nbsp;
                            <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" CausesValidation="false"
                                Text="Cancel"></asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </div>
        </InlineEditTemplate>
        <AppointmentTemplate>
            <div class="rsAptSubject">
                <strong>
                    <%# Eval("Subject")%></strong>
            </div>
        </AppointmentTemplate>
        <TimelineView UserSelectable="false" />
    </telerik:RadScheduler>
Shoqeen
Top achievements
Rank 1
 asked on 15 Nov 2010
6 answers
614 views
I have a radtreeview as a template item of a radcombobox.  I populate the treeview, select the proper treenode and set the text of the combobox in codebehind on the page load.  However, I can't seem to scroll either the combobox or the treeview to display the selected node. 

I have tried executing a javascript on page load using the selectednode.scrollintoview() method, but that doesn't help

For example, ff you look at your Travelissimo demo (http://demos.telerik.com/ASPNET/Prometheus/TreeView/Examples/Functionality/TreeViewComboBox/DefaultCS.aspx) , select Santiago from the dropdown and then click submit.  After the postback,  use the dropdown again.  You'll see that Santiago is selected, but you have to scroll to see it.    You'll notice that the scroll position is maintained if there is no postback.  My goal is to have Spain visible when the user clicks the dropdown following a postback.

Any suggestions ?

Nikolay Tsenkov
Telerik team
 answered on 15 Nov 2010
1 answer
148 views

Hi,

I have one telerik rad grid.Using a method i am filling the grid.I have enabled paging property.I have used itemtemplate-->ImageButton for delete and edit options.I have set page size as 10.Page load time it is working properly and populating the grid.After inserting 11 th row the pagination starts and it will show in next page with one record.But when i am deleting the 11th row the grid become blank.I have used dataset to bind the records. radgrid.DataBind(); dsDataset.Dispose();. But its item.count is 0. What is the reason?

Here is my code:---

SqlHelper objSQL = new SqlHelper();
                DataSet dsPackage = new DataSet();
                dsPackage = objSQL.ExecuteDataset("AL_PackageType_List_Retrieve",
                                                 objUtl.NumericEntry(Session["LocationId"].ToString()));
                gvPackage.DataSource = dsPackage.Tables[0];

//Here i can see the number of rows.Total 10
                gvPackage.Rebind();
                //dsPackage.Dispose();
                if (gvPackage.Items.Count <= 0)
                {
                    lblMessage.Text = "No Package Details Found...";
                    gvPackage.Visible = false;
                }
                else
                {
                    gvPackage.Visible = true;
                }

Thank you

Shinu
Top achievements
Rank 2
 answered on 15 Nov 2010
1 answer
66 views
Shinu
Top achievements
Rank 2
 answered on 15 Nov 2010
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?