Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
824 views
Hello!
I have a RadGrid inside of RadWindow...
I need to select a Radgrid row in clientside...
How can I do that? 

I´m trying to get the radgrid like that: 
var masterTable = $find("<%=radgridID.ClientID%>").get_masterTableView();

but always getting null... 

Any help?


Bhavesh
Top achievements
Rank 2
 answered on 06 Nov 2012
1 answer
120 views
Hi,
Is there anyway to get the icons for the editor command buttons? Specifically, I am creating a custom version of the image manager and would like to use the icon that comes with the standard version but I can't find it in my files.
Thanks,
Matt


P.S. When I say that I am making a custom version, I just mean the button; I'm not customizing the image manager dialog.
Bozhidar
Telerik team
 answered on 06 Nov 2012
7 answers
363 views
Hi,

I am implementing RadTreeview Context menu. It working fine when user right click on it.. but I wanted to display the context menu when user leftclick on it..

Can you please provide some code related to displaying contextmenu when user leftclick on the RadTreeview..?
James
Top achievements
Rank 1
 answered on 06 Nov 2012
2 answers
775 views
Hi there, I have a radtreeview which has a context menu which works perfectly on right click. When a user right clicks on a node in the tree the context menu will appear with options such as "delete [course name]", "edit [course name]", and "add [course name]". Where [course name] is is where the name of the node they are clicking on will go which also works perfectly. My tree view is like this:

ALL COURSES [ROOT]
COURSE GROUP NAME
COURSE
COURSE

Each level on the tree has a slightly different context menu as some have more options than the others. So far I have managed to get a context menu to appear on left click, but all this does is make the biggest context menu appear no matter which node is clicked on and where the course name should be [course name] is displayed instead of the actual course name. But when I right click and then left click the context menu works fine but right click is needed before hand.

Here is part of my asp tree code:
<telerik:RadTreeView ID="UsersTreeView" runat="server" Height="100%" Width="400px"
                OnNodeEdit="UsersTreeView_NodeEdit" OnNodeExpand="UsersTreeView_NodeExpand"
                OnNodeCollapse="UsersTreeView_NodeCollapse" AllowNodeEditing="True" EnableDragAndDrop="True"
                OnContextMenuItemClick="TreeView_ContextMenuItemClick" OnClientContextMenuShowing="UsersTreeView_onClientContextMenuShowing"
                OnClientContextMenuItemClick="UsersTreeView_onClientContextMenuItemClicking"  OnClientNodeClicking="UsersTreeView_onNodeClicking" 
                MultipleSelect="True" OnNodeDrop="UsersTreeView_HandleDrop" >
                <ContextMenus>
                    <telerik:RadTreeViewContextMenu ID="UserGroupContextMenu" runat="server">

AND here is the JavaScript being used:
function UsersTreeView_onClientContextMenuShowing(sender, args) {
    sender.unselectAllNodes();
    var treeNode = args.get_node();
    treeNode.set_selected(true);
    //enable/disable menu items
    UsersTreeView_setMenuItemsState(args.get_menu().get_items(), treeNode);
}

function UsersTreeView_onClientContextMenuItemClicking(sender, args) {
    var menuItem = args.get_menuItem();
    var treeNode = args.get_node();
    menuItem.get_menu().hide();

    switch (menuItem.get_value()) {
        case "add":
        //case "addroot":
        case "edit":
        //case "user_viewcourses":
        case "user_assigncourses":
        case "group_assigncourses":
        case "group_assigncoursessub":
        //case "moveroot":
        case "delete":
            break;
    }
}

AND currently for left click I am using this:
    function UsersTreeView_onNodeClicking(sender, args) {
            var domEvent = args.get_domEvent();
            var menu = $find("<%= UserGroupContextMenu.ClientID %>");
            args.set_cancel(true);
            menu.show(domEvent);
        }

Now I do realize that with my left click code this is needed somewhere:
UsersTreeView_setMenuItemsState(args.get_menu().get_items(), treeNode);

Its used within the default right click code to decide the correct context menu needed but I've tried adding it to my left click code and just cant seem to get it working. I have searched like mad round the forums and Google but for my specific problem I have been unable to find an answer, for all I know it could be impossible to do? 

Thanks, James
James
Top achievements
Rank 1
 answered on 06 Nov 2012
5 answers
165 views
Hello,

I have a master page with an asp menu.  On a content page I have a RadListBox that is hiding part of the menu.  I've tried setting the position to relative and the z-index higher in a div surrounding the menu but nothing seems to make a difference.  This is in IE7.  Any suggestions?

Thanks,
Casey

Simon
Top achievements
Rank 1
 answered on 06 Nov 2012
5 answers
140 views
I'm getting problems showing appointment with a recursive rule.

This is the code of the scheduler from the aspx:

<telerik:RadScheduler ID="scheduler" runat="server" SelectedView="MonthView" DataKeyField="ID" DataStartField="Start"
     DataEndField="End" DataSubjectField="Subject"  OverflowBehavior="Expand">
</telerik:RadScheduler>


And this is the code that I used to insert the appointment:

DateTime startAppointment = new DateTime(2012, 10, 22, 0, 0, 0);
DateTime endAppointment = new DateTime(2012, 10, 22, 10, 0, 0);
TimeSpan startRecurrence = new TimeSpan(00, 00, 00);
TimeSpan endRecurrence = new TimeSpan(10, 00, 00);
 
Telerik.Web.UI.Appointment appointment = new Telerik.Web.UI.Appointment("1", startAppointment, endAppointment, "demo");
 
RecurrenceRange range = new RecurrenceRange();
range.Start = startAppointment;
range.EventDuration = endRecurrence - startRecurrence;
range.MaxOccurrences = Int32.MaxValue;
 
RecurrenceDay dias = RecurrenceDay.EveryDay;
WeeklyRecurrenceRule rrule = new WeeklyRecurrenceRule(1, dias, range);
appointment.RecurrenceRule = rrule.ToString();
scheduler.InsertAppointment(appointment);

If I insert the appointment and I check it at runtime the value of "rrule.Occurrences.Count()" it returns 3000 but the scheduler only shows 21. What's the problem? Why the scheduler doesn't show all the occurrences?

Best Regards
Plamen
Telerik team
 answered on 06 Nov 2012
1 answer
161 views
I would like to find a user control that I am using in my RadGrid Edittemplate, but I cannot.

I am able to find it in the ItemDataBound event, but I cannot find it at ItemCommand where I need to access a control within it.

This is how I access the usercontrol in ItemDataBound event:

 

 

Protected Sub rg_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)

 

 

 

 If TypeOf (e.Item) Is GridEditFormItem And Not rg.MasterTableView.IsItemInserted Then

 

 

 

   Dim e_item As GridEditFormItem = CType(e.Item, GridEditFormItem)

 

 

 

   Dim uc As UserControl = CType(CType(e.Item, GridEditFormItem).FindControl("EditFormControl"), UserControl)

 

 

 

End If

 

 

 

End Sub

This works but does not in ItemCommand.

 

Andrey
Telerik team
 answered on 06 Nov 2012
1 answer
75 views
Hi,
I am trying to set the pagesize is code, the value I store in session for SEO paging but if I set the page size I can't navigate past page 1

Anyone have ideas on what I am doing wrong.   The Pager is inside a RadListView control

Pavlina
Telerik team
 answered on 06 Nov 2012
1 answer
440 views
Hi,

I've recently added functionality to one of my radgrids so that a Filter will be applied when the user presses Enter in the Filter text box. 
I have the CurrentFilterFunction set to "Contatins" on most columns and set the AutoPostbackOnFilter property to True.
I've also kept the Filter menu so that the user can choose another filter option.

One issue I've noticed is that if the user types in the the filter text box and then clicks on the menu to select another option, the default filter is immediately applied, which is a little annoying as then the grid has to apply the filter option chosen in the menu.

I've tried a few different ways to prevent this from happening without full success. One workaround was to set  the AutoPostbackOnFilter property to false and then set the FilterDelay to a high value. This works on all columns except datetime columns. 

<MasterTableView DataSourceID="ProjectsDS" ClientDataKeyNames="ID">
                <Columns>
                    <telerik:GridClientSelectColumn UniqueName="projectsSelect" Visible="false" />
                    <telerik:GridBoundColumn Visible="True" DataField="ID" UniqueName="ID" HeaderText="ID"
                        AutoPostBackOnFilter="False" CurrentFilterFunction="EqualTo" FilterDelay="60000" />
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name" AutoPostBackOnFilter="False"
                        CurrentFilterFunction="Contains"  FilterDelay="60000" />
                    <telerik:GridBoundColumn DataField="CampaignName" HeaderText="Campaign" UniqueName="CampaignName">
                        <FilterTemplate>
                            <telerik:RadComboBox ID="FilterCombo" runat="server" AutoPostBack="false" AppendDataBoundItems="true"
                                DataSourceID="CampaignDS" DataTextField="Name" DataValueField="ID" OnClientSelectedIndexChanged="SelectedIndexChanged"
                                SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CampaignID").CurrentFilterValue %>'>
                                <Items>
                                    <telerik:RadComboBoxItem Text="No filters." Value="" />
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                <script type="text/javascript">
                                    function SelectedIndexChanged(sender, args) {
 
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("CampaignID", args.get_item().get_value(), "EqualTo");
                                    }
                                    function clientItemClicking(sender, args) {
                                        if (args.get_item().get_value() === "NoFilter") {
                                            var target = args.get_targetElement();
                                            var filterBox = target.parentNode.getElementsByTagName("input")[0];
                                            filterBox.value = "";
                                        }
                                    }                                  
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CampaignID" HeaderText="CampaignID" UniqueName="CampaignID"
                        Display="false" />
                    <telerik:GridBoundColumn DataField="FrameworkName" HeaderText="Framework" UniqueName="FrameworkName"
                        AutoPostBackOnFilter="False" CurrentFilterFunction="Contains" FilterDelay="60000"/>
                    <telerik:GridBoundColumn DataField="ProjectBaseName" HeaderText="Template" UniqueName="ProjectBaseName"
                        AutoPostBackOnFilter="False" CurrentFilterFunction="Contains" FilterDelay="60000"/>
                    <telerik:GridBoundColumn DataField="StatusDisplayValue" HeaderText="Status" UniqueName="StatusDisplayValue"
                        AutoPostBackOnFilter="False" CurrentFilterFunction="Contains" FilterDelay="60000"/>
                    <telerik:GridDateTimeColumn DataField="StartDate" HeaderText="Start Date" UniqueName="StartDate"
                        DataFormatString="{0:d}" AutoPostBackOnFilter="True" CurrentFilterFunction="EqualTo" FilterDelay="60000">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridDateTimeColumn DataField="EndDate" HeaderText="End Date" UniqueName="EndDate"
                        DataFormatString="{0:d}" AutoPostBackOnFilter="True" CurrentFilterFunction="EqualTo">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="ExternalID" HeaderText="External ID" UniqueName="ExternalID"
                        AutoPostBackOnFilter="False" CurrentFilterFunction="Contains" FilterDelay="60000"/>
                    <telerik:GridTemplateColumn DataField="IsArchived" HeaderText="Archived" UniqueName="IsArchived"
                        Visible="false" GroupByExpression="IsArchived Group By IsArchived">
                        <HeaderTemplate>
                            <asp:CheckBox ID="chkArchivedSelectAll" OnCheckedChanged="chkArchivedSelectAll_CheckedChanged"
                                AutoPostBack="true" runat="server" TextAlign="Right" Text=" Archived" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="IsArchived" Checked='<%# Bind("IsArchived") %>' runat="server" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>

Is there a way to cancel the default Filter when the user clicks on the menu but also allow the user to press enter to apply the filter? I have noticed that on all of the demos of this functionality on this site, the Filter menu is removed from columns that have AutoPostBackOnFilter set to True. Is there an issue with using both together?

Thanks.
Marin
Telerik team
 answered on 06 Nov 2012
0 answers
109 views
Hi!
I couldn't find the solution on my problem here in the Forum so i created a new Thread, but if there already is a Thread about this topic then send me there. 

The Problem occurring when I am using a asp:Button under my ListBox. The button is not firing in the default browser in Android 4.1 but it is working with older Android and other Chrome in Android. 

Here is the aspx code. 
<div class="LeftWrapper" id="decorationZone">
     <telerik:RadListBox ID="List" runat="server" AppendDataBoundItems="True"
         CheckBoxes="true" Skin="MetroTouch" OnClientItemChecked="OnClientItemCheckedHandler"
         OnClientSelectedIndexChanged="OnClientSelectedIndexChanged">
         <ButtonSettings TransferButtons="All"></ButtonSettings>
     </telerik:RadListBox>
     <p style="z-index:40 !important;" >
         <asp:Button ID="AddButton" runat="server" Text="" OnClientClick="alert('working');addLoading('AddButton','LaggTillButton');"
             CssClass="LaggTillButton" />
     </p>
 </div>

Here is the css for the listbox
#List
{
    height: 400px;
    width: 200px;
    overflow: auto;
    border: solid 1px #8b9ba7 !important;
    margin-left: 10px;
    margin-bottom: 3px;
    display: block;
    float: right;
    display: inline;
    white-space: nowrap;
    position:static !important;
     
}

Thank you
Simon
Top achievements
Rank 1
 asked on 06 Nov 2012
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?