Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
131 views

I'm having a problem with my rad docks.  All my docks are created in code behind.  I add the title and the commands in code behind as well.  Everything works fine to that point.  Now I am trying to add a control to the title bar.  When I add it the vertical position of the commands is pushed down causing them to be hidden from view.

I have tried to implement a custom titlebar template, but I have not found out how to control the placement of the commands.

Here is some code creating the rad dock.

 
//Create the Rad Dock and set properties   
RadDock rd = new RadDock ();  
rd.DockMode = DockMode.Docked;   
rd.UniqueName = Guid.NewGuid().ToString();  
rd.ID = string.Format("rd{0}",rd.UniqueName);   
rd.Width = Unit.Percentage(99);   
rd.Skin = "Custom";  
rd.EnableEmbeddedSkins = false ;  
rd.EnableRoundedCorners = true ;  
rd.Title = "Title";  
   
rd.Command += new   
DockCommandEventHandler(rd_Command);  
DockCommand cmd = new DockCommand();  
cmd.AutoPostBack = true;   
cmd.Name = hideCommand;  
cmd.Text = "Hide";   
rd.Commands.Add(cmd);  
rd.Commands.Add(new DockExpandCollapseCommand());  
 

 
Here is the code to add the Icon and title to the title bar.

 
Label lbl = new Label();  
lbl.ID = "lbl" + rd.ID;  
lbl.EnableViewState = true;  
lbl.Width = Unit.Pixel(250);  
lbl.Text = "My Desired Content";  
 
Image mg = new Image();  
mg.ImageUrl = "~/demo/oldData.jpg";  
mg.ID = "mg" + rd.ID;  
// This method here will add a tooltip to the image  
// so users can see old data on mouseover.  
CreatePastDataToolTip(rd,null, mg.ID);  
rd.ContentContainer.Controls.Add(lbl);  
rd.TitlebarTemplate = new TitleBarTemplate();  
rd.TitlebarContainer.Controls[0].FindControl(TitleBarContent).Controls.Add(mg); 


Here is my Custom TitleBar Template.  I've implemented a couple different ideas, this was my last idea, and it worked as far as lining up the Title and the Image in the title.  But, I still couldn't get the Commands to display within the titlebar.

  

 
   public class TitleBarTemplate : ITemplate  
   {  
      Label lblText = new Label();  
      Panel pContainer = new Panel();  
      Panel pControls = new Panel();  
 
      public void InstantiateIn(Control container)  
      {  
         Literal l;  
         lblText.ID = "TitleText";  
         lblText.Text = "Initial Text";  
         //pControls.CssClass = "rdTitleControls";  
         pControls.ID = "PanelForControls";  
         l = new Literal();  
         l.Text = "<table><tr><td>";  
         pContainer.Controls.Add(l);  
         pContainer.Controls.Add(lblText);  
 
         l = new Literal();  
         l.Text = "</td><td>";  
         pContainer.Controls.Add(l);  
         pContainer.Controls.Add(pControls);  
         l = new Literal();  
         l.Text = "</td></tr></table>";  
         pContainer.Controls.Add(l);  
 
         container.Controls.Add(pContainer);  
      }  
   } 

Any help would be greatly appreciated.



Adam
Adam Heeg
Top achievements
Rank 1
 answered on 23 Feb 2010
3 answers
167 views
I've searched and search and can't quite find an example like I'm looking for.  Here's my situation and I'll keep it as simple as possible:

I have a RadToolbar and a user control on a page.  The user control has a RadGrid in it.  When I click a button on the RadToolbar, I want to ajaxify the user control (no screen flash / reload).  The grid gets populated in the NeedDataSource() event by pulling it's data from a session variable that was populated in the button click event..  Really all I need to know is how to wire this up. If a simple example could be provided, that would be great.  Like I already said, I've searched the forums, online demos, & help file.

Thanks,
Rob
Iana Tsolova
Telerik team
 answered on 23 Feb 2010
4 answers
384 views
Hi,
I am using RadTree and i want a tree without root node. So How can i remove only root node from tree. Please help me.

Thanks,
Sagar
Simon
Telerik team
 answered on 23 Feb 2010
4 answers
183 views
Hi,

I'm getting close - but I'm having an issue with the positioning being consistant. Also, I'd like to be able to click as well as hover - (since I'm using jquery.hoverIntent.js)

<telerik:RadPanelBar runat="server" ID="itemToolbar" Width="231px" Height="500px" ExpandMode="SingleExpandedItem"  AllowCollapseAllItems="true"
    <DataBindings> 
        <telerik:RadPanelItemBinding CssClass="anItem" Depth="1" /> 
    </DataBindings> 
</telerik:RadPanelBar> 
<telerik:RadContextMenu ID="itemMenu" runat="server" OnClientItemClicked="subItemClicked" /> 
 
$(document).ready(function() { 
    var isShown = false
    var hoverIntentConfig = { 
        sensitivity: 1,     
        interval: 200, // number = milliseconds for onMouseOver polling interval     
        over: function(e) { 
            var itemName = $(this).text(); 
            var panelBar = $find("<%= itemToolbar.ClientID %>"); 
            var theItem = panelBar.findItemByText(itemName); 
            if (theItem != null) { 
                showItemMenu(theItem.get_element(), itemName); 
            } 
        }, // function = onMouseOver callback (REQUIRED)     
        timeout: 500, // number = milliseconds delay before onMouseOut     
        out: function(e) { 
         
        } // function = onMouseOut callback (REQUIRED) 
    }; 
    // Setup the hoverIntent for every item in the panelBar 
    $('.anItem').hoverIntent(config); 
}); 
 
var oldItem = null
var isCalled = false
function showItemMenu(targetControl, itemName) { 
    var theMenu = $find("<%= itemMenu.ClientID %>"); 
    theMenu.removeTargetElement(targetControl); 
 
    isCalled = true
    $.ajax({ 
        type: 'POST'
        url: "SamplePage.aspx/GetItemList"
        data: "{'itemName':'" + itemName+ "'}"
        contentType: "application/json; charset=utf-8"
        dataType: "json"
        success: function(result) { 
            if (isCalled == true) { 
                var menu = $find("<%= itemMenu.ClientID %>"); 
                menu.trackChanges(); 
                 
                // Empty the context menu out 
                menu.get_items().clear(); 
                var resultItems = result.d.split(","); 
 
                for (var i = 0; i < resultItems.length; i += 1) { 
                    var subItem = new Telerik.Web.UI.RadMenuItem(); 
                    subItem .set_text(resultItems[i]); 
                    menu.get_items().add(subItem); 
                } 
                 
                menu.commitChanges(); 
 
                oldItem = targetControl; 
                menu.addTargetElement(targetControl); 
 
                var offset = $(targetControl).offset(); 
                menu.showAt(offset.left + 50, offset.top); 
                isCalled = false
           } 
       }, 
       error: function(result) { 
           if (isCalled == true) { 
               alert(result.status + " " + result.statusText); 
               isCalled = false
           } 
       } 
   }); 

Sometimes it'll work great, but then other times - the position of the menu is all off. I'm not sure why .. 

Anyone have any advice?
Thanks,
Kori
Kori
Top achievements
Rank 2
 answered on 23 Feb 2010
1 answer
400 views
I have a radupload control that I want to act as a simple file upload (much like the old asp file upload worked), so am using it like this:

<telerik:RadUpload ID="RadUploadEmployeePhoto" runat="server"   
         ControlObjectsVisibility="None" InitialFileInputsCount="1"   
         MaxFileInputsCount="1" /> 

I need to be able to iterate through the collection of selected files in my code behind (I'm using VB) and remove all selected files.

To give some background on why I need to do this, I am working on a corporate directory application.  When an Admin is editing an employee record, they are presented with 3 checkboxes (Add Photo / Delete Photo / Restore Backup).  I have my code set up to only allow one checkbox to be selected at a time (much like the functionality of a radio button) and the radupload is only visible when the "Add Photo" checkbox is selected (otherwise, I set visible=false).  Now, should the user select "Add Photo" and then select a photo to upload, and then change their mind and select "Restore Backup", the radupload control will not be visible, but will still have a selected value, and the upload will still be processed as normal, but will conflict with the "Restore Backup" option the user selected last.  To solve the issue, in my code behind, I need to be able to remove all selected files.

Thanks!
T. Tsonev
Telerik team
 answered on 23 Feb 2010
1 answer
79 views

Posted 0 minutes ago (permalink)

Hello telerik team,

I would appreciate so much if you can reply to me as early as possible.
I have added a "Title" custom text box to each instance of Radupload files using "onClientAdded" fucntion.

But, now i need to validate the additional text box added using java script, and
I have been trying so many ways in futile. Client side validation is mandatory

Please help me asap.

Thank you,
Bharathi
Genady Sergeev
Telerik team
 answered on 23 Feb 2010
4 answers
692 views

Hello,

I dont know whether this is the right place to put this query, but i have read somewhere that RadDateTimePicker is part of RadClender control....so putting it here....

I want to hide DatePopup button programmatically on client side.

is there any way to hide/unhide DatePopup button depend upon business logic ?


Also I tried to enable/disable RadDateTimePicker control , but giving "Object Required" issue in following scenario. I am using "2009.3.1103.35" version.

Scenario :-

1. RadDateTimePicker is disable using follwoing code    
    

 

                var objradDateValidity = $find("<%= radValidity.ClientID %>");

 

 

                objradDateValidity.set_enabled(false);

2. Then after some businees logic ,I make it enable as follows

               var objradDateValidity = $find("<%= radValidity.ClientID %>");

 

 

                objradDateValidity.set_enabled(true);

3. And Now if I change date value using Date popup button and again try to make it disable , it throws "Object Required" error.

4. If I dont change date value and try to make it disable, it does it without throwing any error.



any help will be highly appreciated.

Thanks,

Ajay Khedekar
Dimo
Telerik team
 answered on 23 Feb 2010
1 answer
61 views
Hello,

Even if I enable "Print background colors and images" property under ie8, the background color of appointments doesn't appear on the print page.
I use this simple css for RadScheduler :

.RadScheduler .rsAptContent, 
.RadScheduler .rsAptMid .rsAptIn, 
.RadScheduler .rsAptMid, 
.RadScheduler .rsAptOut 
    background:red !important

With firefox3.5.7, opera10.10 and ie7, the background color is visible.

Could you tell me what is missing ?
Kamen Bundev
Telerik team
 answered on 23 Feb 2010
6 answers
171 views
I'm running into an issue related to resizing dynamically created docks. I'm adding docks in a similar way to the My Portal example provided here http://www.telerik.com/DEMOS/ASPNET/Prometheus/Dock/Examples/MyPortal/DefaultCS.aspx. However I haven't been able to make my docks resizable. I tried adding  "dock.Resizable = true;" to both the CreateRadDock() and CreateRadDockFromState() functions but that didn't work. I know with normal docks you have to set the behavior but I haven't been able to figure out how to do it dynamically. Any help would be appreciated. Thanks.

Kyle
Pero
Telerik team
 answered on 23 Feb 2010
1 answer
120 views
Hi;
I'm trying the trial version of rad web controls in .net2005 framework 2.0. In a page i had a RadPanelBar with 5 RadPanelItem in a RadAjaxPanel.
I had added asp:ScriptManager, telerik:RadAjaxManager with the settings that you have give in the samples. Write the server side code as given in the samples too and it works. When a radpanelitem expanded i'm loading a standard user control (with standard rad or asp items) in it.
I want to has a RadTabStrip in this user control. I had found a sample in your samples that how to load on demand with RadMultiPage in a tabstrip.
I all copied the necessary code from the sample to my usercontrol. when i build it gave the error about adding more than 1 RadScriptManager. And deleted the one in the user control cause i thought it can use the one in the page.
When i build there is no error now. But I can't see the tabstrip in the RadPanelItem.
Where should i check about this problem?
Alperozgur
Top achievements
Rank 1
 answered on 23 Feb 2010
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?