Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views
Hi,

I want to create a new item in grid context menu and want to get selected item url same as OnClientItemSelected event.

Could you please help me ?
Fiko
Telerik team
 answered on 01 Jun 2010
2 answers
159 views
Hi there,

I have parent grid and a detailstable.  The parent has inline edit.  When I click on row 1, it goes into edit mode correctly.  Now I click to expand row 5.  Row 5 expands correctly but row 1 is still in edit mode.  Clicking inside the expanded grid causes a "can't load viewstate."  This happens to insert as well.

Using RadGrid1.MasterTableView.ClearEditItems() has no effect nor does item.edit=false

When I expand any row, I would like edit/insert on the parent grid to close.

Thanks for any assistance.
Khanh
Khanh
Top achievements
Rank 1
 answered on 01 Jun 2010
1 answer
108 views
So, I have replaced the RichHtmlField with RadHtmlField in my pages. I want the RadHtmlField to be as similar to my old field as possible, i.e. follow the same styles etc. My first problem is that I get the wrong style when editing. However, after saving the content and looking at it out of editing view, it looks ok. I found information (http://blogs.salmanghani.info/?tag=telerik-radeditor) that I needed to include the property CssFiles in ConfigFile.xml and point to my custom css. This has no effect whatsoever, what to do?

Also, in my old RichHtmlField I have a number of predefined styles the user can choose from. I guess this corresponds to the Apply Css Class dropdown? I followed the instructions on this link (http://www.telerik.com/help/aspnet-ajax/defining-custom-css-styles.html), but again, nothing happens. All I ever see in the dropdown is "Clear Class".

Thanks in advance,
Helena
Stanimir
Telerik team
 answered on 01 Jun 2010
2 answers
116 views

Hello,

I have the following FilterTemplate in my grid:

<FilterTemplate> 
    From  
    <telerik:RadMaskedTextBox ID="txtWorkMonthFrom" runat="server" Mask="##/####" Skin="WebBlue" Width="80px" CssClass="CenterText" ClientEvents-OnValueChanged="WorkMonthFromSelected" /> 
    to  
    <telerik:RadMaskedTextBox ID="txtWorkMonthTo" runat="server" Mask="##/####" Skin="WebBlue" Width="80px" CssClass="CenterText" ClientEvents-OnValueChanged="WorkMonthToSelected" /> 
    <telerik:RadScriptBlock ID="rsbWorkMonth" runat="server">  
        <script type="text/javascript">  
            function WorkMonthFromSelected(sender, args) {  
                var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");  
                var ToDate = $find('<%# TryCast(Container, GridItem).FindControl("txtWorkMonthTo").ClientID %>');  
 
                var fromDate = FormatWorkMonth(sender);  
                var toDate = FormatWorkMonth(ToDate);  
 
                if (toDate.indexOf("_") >= 0) {  
                    if (fromDate.indexOf("_") >= 0) {  
                        tableView.filter.clear;  
                    }  
                    else {  
                        tableView.filter("WorkMonth", fromDate, "GreaterThanOrEqualTo");  
                    }  
                }  
                else {  
                    if (fromDate.indexOf("_") >= 0) {  
                        tableView.filter("WorkMonth", toDate, "LessThanOrEqualTo");  
                    }  
                    else {  
                        tableView.filter("WorkMonth", fromDate + " " + toDate, "Between");  
                    }   
                }  
            }  
            function WorkMonthToSelected(sender, args) {  
                var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");  
                var FromDate = $find('<%# TryCast(Container, GridItem).FindControl("txtWorkMonthFrom").ClientID %>');  
 
                var fromDate = FormatWorkMonth(FromDate);  
                var toDate = FormatWorkMonth(sender);  
 
                if (toDate.indexOf("_") >= 0) {  
                    if (fromDate.indexOf("_") >= 0) {  
                        tableView.filter.clear;  
                    }  
                    else {  
                        tableView.filter("WorkMonth", fromDate, "GreaterThanOrEqualTo");  
                    }  
                }  
                else {  
                    if (fromDate.indexOf("_") >= 0) {  
                        tableView.filter("WorkMonth", toDate, "LessThanOrEqualTo");  
                    }  
                    else {  
                        tableView.filter("WorkMonth", fromDate + " " + toDate, "Between");  
                    }  
                }  
            }  
            function FormatWorkMonth(picker) {  
                var date = picker._projectedValue;    
                return date;  
            }  
                                                                                                      
        </script> 
    </telerik:RadScriptBlock> 
</FilterTemplate> 

I modeled this off of the example at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx.

The difference is that I want to use the radMaskedTextBox for my date fields instead of the radDatePicker control.

When I enter a date into the "From" or "To" date, the grid filters properly.  The problem is that once the grid refreshes, the dates disappears.  So, I can never actually filter with From and To dates at the same time, because as soon as I enter a From date, the grid filters on the From date and then the date disappears.  If I subsequently put a date into the To field, the grid will filter from a null date to the To date (because the From date is no longer there).  Once the grid filters properly using my To date, then it disappears as well.

How can I get my dates to remain in the masked text boxes?

Thanks.

Steve



Iana Tsolova
Telerik team
 answered on 01 Jun 2010
7 answers
170 views
The SelectedImageUrl property does nothing until AFTER the mouse has hovered over the image.

My scenario uses the RadMenu as the primary navigation for my site. I want the selected page to be obvious to the users so I've implemented images to represent the normal versus hovered/selected states. Simple. Everything works fine except for that when one of the menu items is selected, it displays normal image until the mouse hovers over the menu item which then causes the menu to display the selected image.

I created the following simplified example (no CSS, no code) to illustrate.

Super simple example:
<telerik:RadMenu ID="RadMenu1" Runat="server" Skin="" EnableSelection="true" > 
    <Items> 
        <telerik:RadMenuItem runat="server"   
            NavigateUrl="~/Test.aspx"   
            ImageUrl="~/images/NotSelected.png"   
            HoveredImageUrl="~/images/Selected.png"   
            SelectedImageUrl="~/images/Selected.png"   
            Selected="true" 
        /> 
   </Items> 
</telerik:RadMenu> 
 

BTW, the EnableSelection property has no affect on this example and I've specified Selected='true' just so the problem can be seen immediately.

I haven't come up with a workaround for this one, please advise. Thanks!
T. Tsonev
Telerik team
 answered on 01 Jun 2010
1 answer
144 views
Hi ,
Below is the sample code  , when i click on RadSplitBar , the left Pane is collasped but the RadWindow in right pane  remains at same size . I tried using RestrictionZoneID by giving right panes ID and tried using a div control , unable to fix or dock to the right pane size , Kindly help me out in fixing .
Is it possible to give dynamically ?.

Kindly help me out in fixing this issues please

Thanks
Vinodh 

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title></title> 
       <style type="text/css"> 
        .rtsImg 
        { 
            margin: 2px 4px 0 0 !important; 
        } 
        .restrictionZone 
        { 
            width: 100%; 
            height:100%; 
        } 
        .taskbar 
        { 
            display: block; 
            float: left; 
        } 
        div.RadTabStrip .rtsLevel { 
            width: auto; 
        } 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> 
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
        <AjaxSettings> 
             
        </AjaxSettings> 
         
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"  
        Skin="Default"> 
    </telerik:RadAjaxLoadingPanel> 
    <table width="100%"  style="height: 100%"> 
        <tr> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
        </tr> 
        <tr> 
            <td colspan="5"  style="height: 100%"> 
                <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width ="100%" Orientation="Vertical"> 
                    <telerik:RadPane ID="radRightPane" runat="server" Width="22%" Height="100%"> 
                        <telerik:RadPanelBar ID="RadPanelBar1" runat="server" BorderStyle="None"  
                            ExpandMode="FullExpandedItem" Height="100%"  
                            OnClientItemClicking="openNewWindow"><Items><telerik:RadPanelItem  
                                Expanded="True" Text="Mail"><Items><telerik:RadPanelItem  
                                    ImageUrl="Img/mailPersonalFolders.gif" Text="Personal Folders"  
                                    Value="http://www.google.com" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailDeletedItems.gif" Text="Deleted Items"  
                                    Value="http://www.google.com" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailInbox.gif" Text="Inbox" Value="http://www.google.com" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailFolder.gif" Text="My Mail" Value="http://www.google.com" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailSent.gif" Text="Sent Items" Value="http://www.google.com" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailOutbox.gif" Text="Outbox" Value="http://www.google.com" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailSearch.gif" Text="Search Folders"  
                                    Value="http://www.google.com" /> 
                            </Items> 
                            </telerik:RadPanelItem><telerik:RadPanelItem Text="Calendar"><Items><telerik:RadPanelItem><ItemTemplate><telerik:RadCalendar  
                                    ID="Calendar1" runat="server" Style="margin: 6px auto 0" /> 
                                </ItemTemplate> 
                                </telerik:RadPanelItem> 
                            </Items> 
                            </telerik:RadPanelItem><telerik:RadPanelItem Text="Contacts"><Items><telerik:RadPanelItem  
                                    ImageUrl="Img/contactsItems.gif" Text="My Contacts" /><telerik:RadPanelItem  
                                    ImageUrl="Img/contactsItems.gif" Text="Address Cards" /><telerik:RadPanelItem  
                                    ImageUrl="Img/contactsItems.gif" Text="Phone List" /><telerik:RadPanelItem  
                                    ImageUrl="Img/contactsItems.gif" Text="Shared Contacts" /> 
                            </Items> 
                            </telerik:RadPanelItem><telerik:RadPanelItem Text="Tasks"><Items><telerik:RadPanelItem  
                                    ImageUrl="Img/tasksItems.gif" Text="My Tasks" /><telerik:RadPanelItem  
                                    ImageUrl="Img/tasksItems.gif" Text="Shared Tasks" /><telerik:RadPanelItem  
                                    ImageUrl="Img/tasksItems.gif" Text="Active Tasks" /><telerik:RadPanelItem  
                                    ImageUrl="Img/tasksItems.gif" Text="Completed Tasks" /> 
                            </Items> 
                            </telerik:RadPanelItem><telerik:RadPanelItem Text="Notes"><Items><telerik:RadPanelItem  
                                    ImageUrl="Img/notesItems.gif" Text="My Notes" /><telerik:RadPanelItem  
                                    ImageUrl="Img/notesItems.gif" Text="Notes List" /><telerik:RadPanelItem  
                                    ImageUrl="Img/notesItems.gif" Text="Shared Notes" /><telerik:RadPanelItem  
                                    ImageUrl="Img/notesItems.gif" Text="Archive" /> 
                            </Items> 
                            </telerik:RadPanelItem><telerik:RadPanelItem Text="Folders List"><Items><telerik:RadPanelItem  
                                    ImageUrl="Img/mailOutbox.gif" Text="My Client.Net" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailOutbox.gif" Text="My Profile" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailOutbox.gif" Text="My Support Tickets" /><telerik:RadPanelItem  
                                    ImageUrl="Img/mailOutbox.gif" Text="My Licenses" /> 
                            </Items> 
                            </telerik:RadPanelItem> 
                        </Items> 
                        </telerik:RadPanelBar> 
                    </telerik:RadPane> 
                    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" > 
                    </telerik:RadSplitBar> 
                    <telerik:RadPane ID="radLeftPane" runat="server" Width="78%"> 
                        <telerik:RadTabStrip ID="RadTabStrip1" runat="server"  
                            OnClientTabSelected="OnClientTabSelected" Orientation="HorizontalBottom"  
                            ScrollButtonsPosition="Middle" ScrollChildren="True" SelectedIndex="0"  
                            Skin="Web20" Width="100%"><tabs><telerik:RadTab Selected="True"  
                            Style="display: none;" /></tabs></telerik:RadTabStrip> 
                        <telerik:RadWindowManager ID="RadWindowManager" runat="server"  
                            Behaviors="Close,Maximize,Minimize,Move,Reload,Resize"  
                            KeepInScreenBounds="True" OnClientActivate="OnClientActivate"  
                            OnClientClose="OnClientClose" OnClientCommand="OnClientCommand"  
                            RestrictionZoneID="radLeftPane" ShowOnTopWhenMaximized="true" Skin="Web20"> 
                        </telerik:RadWindowManager> 
                        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
 
                            <script type="text/javascript"> 
 
                    // <![CDATA[
                    var manager = null;
                    var tabStrip = null;
                    function pageLoad() {
                        //get a reference to the needed controls -
                        manager = $find("<%=RadWindowManager.ClientID %>");
                        manager = radopen("http://www.google.com", null);                       
                        tabStrip = $find("<%=RadTabStrip1.ClientID %>");
                    }
                    //opening the window
                    function openNewWindow(sender, args) {
                        var item = args.get_item();
                        var itemUrl = item.get_value();
                        var itemText = item.get_text();
                        if (itemUrl) {
                            var windowURL = itemUrl;
                            var oWnd = radopen(itemUrl, null);
                            oWnd.set_title(itemText);
                            oWnd.center();
                            tabStrip.trackChanges();
                            //create a new tab
                            var tab = new Telerik.Web.UI.RadTab();
                            //set the text of the tab
                            tab.set_text(itemText);
                            oWnd.correspondingTab = tab;
                            //add the tab to the tabstrip
                            tabStrip.get_tabs().add(tab);
                            tabStrip.repaint();
                            tab.correspondingWnd = oWnd;
                            tab.set_imageUrl(item.get_imageUrl());
                            tabStrip.commitChanges();
                            //Select this tab
                            tab.select();
                        }
                    }
                    function OnClientCommand(sender, args) {
                        //because we don't want to show the minimized RadWindow, we hide it after minimizing
                        //and raise the _Maximized flag (used in OnClientTabSelected)
                        if (args.get_commandName() == "Minimize") {
                            if (sender.isMaximized()) {
                                sender._Maximized = true;
                            }
                            sender.hide();
                            //raise the _toMinimize flag (used in OnClientActivate)
                            sender._toMinimize = true;
                            var tab = sender.correspondingTab;
                            if (tab) {
                                tab.set_selected(false);
                            }
                        }
                    }
                    function OnClientTabSelected(sender, args) {
                        //get a reference to the corresponding window
                        var win = args.get_tab().correspondingWnd;
                        if (!win) return;
                        if (!win.isVisible()) {
                            win.show();
                            win.restore();
                            //if the window was maximized before client minimizes it, we need to restore
                            //its maximized state
                            if (win._Maximized) {
                                win.maximize();
                                win._Maximized = null;
                            }
                        }
                        //ensure that the currently active RadWindow will have the highest z-Index.
                        var popupElem = win.get_popupElement();
                        var oldZindex = parseInt(popupElem.style.zIndex);
                        var styleZIndex = win.get_stylezindex();
                        var newZIndex = (styleZIndex) ? styleZIndex : Telerik.Web.UI.RadWindowUtils.get_newZindex(oldZindex);
                        popupElem.style.zIndex = "" + newZIndex;
                        win.setActive(true);
                    }
                    function OnClientActivate(sender, args) {
                        var tab = sender.correspondingTab;
                        if (tab && !sender._toMinimize) {
                            tab.set_selected(true);
                        }
                        sender._toMinimize = false;
                    }
                    function OnClientClose(oWnd) {
                        //remove the corresponding tab from the tabstrip
                        var tab = oWnd.correspondingTab;
                        if (tab) {
                            tabStrip.trackChanges();
                            tabStrip.get_tabs().remove(tab);
                            tabStrip.commitChanges();
                        }
                    }
                    // ]]> 
 
                            </script> 
 
                        </telerik:RadCodeBlock> 
                    </telerik:RadPane> 
                </telerik:RadSplitter> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
            <td> 
                &nbsp;</td> 
        </tr> 
    </table> 
    </form> 
</body> 
</html> 
Dobromir
Telerik team
 answered on 01 Jun 2010
1 answer
80 views


using the RadAsyncUpload control there seems to be no option for just queueing up the file and uploading it when a button is pressed.
I would like this functionality. I can't use RadUpload because the control is inside of an iframe.
Genady Sergeev
Telerik team
 answered on 01 Jun 2010
1 answer
97 views
Hi,
I am trying to Build a custom SEO Friendly Pager. The pagger should look like the attached image.I can't figure out how to make the "First, previous, Next, Last" links SEO friendly. Can you please point me to an example?

Thanks

Qusai
Veli
Telerik team
 answered on 01 Jun 2010
2 answers
252 views
Thanks for the great help from the Telerik team.

I have successfully opened multiple radwindows.  In home page, it contains the radwindowmanager with the

RestrictionZoneID ="R",

 

 

I open a radwindow "G" under the radwindowmanager in the home page. then I clicked the button inside radwindow "G" to open multiple radwindows "W" in designed positions respectively.

everything looks good except for one issue, when I use the method to get the moveto positions, I have to minus the restriction. for example: 

 

 

position = positionInfo( listPosition.left + col * width + width,listPosition.top + row * height - restriction);
// calcuate the moveto position,

which could cause  probelms
1. if I minus the restriction, the radwinow"W" will be opened at the right position. but when the radwindow "G" is close to the top, I minus the restriction, the position.top <0 and thus radwindow "W" will be positioned in wrong position
2.if I do not minus the restriction
.the radwindows"w" will be opened at a lower position with the difference of restriction. when the radwindow"G" is close to bottom, the position.top is beyond the bottom line and thus radwindow "W" will be positioned in wrong position.

How to avoid the restriction side effect?

Thanks a lot   

 

 

 

 

 

 

  

Fiko
Telerik team
 answered on 01 Jun 2010
3 answers
109 views
Hi,

I have a grid that displays a list of all the nominations.  One of the columns displays the status of the nomination.  If this nomination has a status of approved, then it must ONLY display the text Approved.  If the status is Pending, then this colum must display an Edit button to be able to modify this record.  The edit button must only be displayed when the status is pending.  If the status is approved then the edit button must not be displayed.

Is there a sample like this some where?

Thanks
Brendan
Princy
Top achievements
Rank 2
 answered on 01 Jun 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?