Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
249 views
We are trying to figure out how to properly extend a dynamically created radDock to basically include a footer. Currently we have tried creating a new class file and inheriting fromTelerik.Web.UI.RadDock. We are able to add an icon for the usercontrol and it works, a bit kludgy but w/e. How would we start to go about this? This is the code we are using currently to extend RadDock.
[assembly: TagPrefix("NCS_Black.CustomControls.NCSBlackRadDock""c1")]  
namespace NCS_Black.CustomControls.NCSBlackRadDock  
{  
    [ToolboxData("<{0}:NCSBlackRadDock ID='NCSBlackRadDock1' runat=\"server\"> </{0}:NCSBlackRadDock>")]  
    public class NCSBlackRadDock: Telerik.Web.UI.RadDock  
    {  
        protected override void OnLoad(EventArgs e)  
        {  
 
        }  
 
        protected override void OnInit(EventArgs e)  
        {  
            base.OnInit(e);  
 
            // INCLUDE A WIDGET SPECIFIC ICON (IF AVAILABLE)  
            Image icon = new Image();  
            icon.ImageUrl = "~/Prototype/Modules/HttpWebRequest/Images/Config.png";  
            icon.CssClass = "imgFloatLT Middle";  
            this.TitlebarContainer.Controls.Add(icon);  
 
 
            // INCLUDE WIDGET SETTINGS CONTROL IN TITLEBAR (IF AVAILABLE)  
            DockCommand _Edit = new DockCommand();  
            _settings.Name = "Widget_Settings";  
            _settings.Text = "Edit";  
            this.Commands.Add(_settings);  
 
 
            // INCLUDE REFRESH TIMESTAMP  
            Panel _timePanel = new Panel();  
            _timePanel.CssClass = "WidgetTimestamp";  
 
            Label _timeStamp = new Label();  
            _timeStamp.Text = DateTime.Now.ToShortTimeString();  
            _timePanel.Controls.Add(_timeStamp);  
            this.ContentContainer.Controls.Add(_timePanel);  
        }  
    }  
Gido Geek
Top achievements
Rank 2
 answered on 21 Dec 2009
1 answer
171 views
Dear Telerik folks,
I'm implementing vertical tabs that are scrollable when they go off the page. Works great! One feature I'd like to add is the ability to scroll up and down with the mouse wheel. This would seem to be a pretty common behavior but these tabs don't do it.

I'm leaning towards adding a mousewheel event to the div that contains the tabstrip and firing the radtabstrip.radtab.Scrollintoview() based on the first and last tabs. This isn't a very smooth behavior but its all I see as possible with the latest build.
Any ideas?
Thanks.
T. Tsonev
Telerik team
 answered on 21 Dec 2009
2 answers
252 views
I am trying to configure a pair of listboxes to allow transfer. The user interface side works, but no changes are written to the database. Here's the scenario;

Three tables, Communications, Contacts, and CommunicationContacts. Each communication has zero or more contacts associated with it, defined as rows in the CommunicationContacts table. The CommunicationContacts table has three fields; primary key, CommunicationID and ContactID, with appropriate relational integrity. What I want to do is show two listboxes; one containing the names of the people who are selected (from the Contacts table, via a lookup), and a list of names of people who aren't selected. I have the logic of the queries, but what i want is when I add a name from the UNSELECTED to the SELECTED list, I want a row to be added to the CommunicationContacts table. Likewise when I remove a name from teh selected list, I want that row to be removed from the CommunicationContacts table.

I have the page set up and working using object data sources, with update and delete actions defined, the transfers are appearing properly, but no db changes are recorded.

Can anyone provide me with an example of a working page where two related listboxes are used and the changes are saved?

Thanks in advance.
Genady Sergeev
Telerik team
 answered on 21 Dec 2009
4 answers
312 views
Is there a way to get the old value out of the ListBox on SelectedIndexChanging event?  I'm converting a ComboBox over to a ListBox and I was previously doing something very similar to this: http://www.telerik.com/help/aspnet-ajax/combo_clientsideonclientselectedindexchanging.html.  But now my sender.get_selectedItem() returns null.  On inspection, sender._selectedValue seems to hold the previous selected value.  I can easily keep track of my previously selected item on my own, but if there's a cleaner way to do it (like before), I'm all ears.

Thanks,
Jared
Genady Sergeev
Telerik team
 answered on 21 Dec 2009
1 answer
72 views
I'm having an issue where my RadMenu is behind my Silverlight object.  I cannot seem to find the Windowless mode property that seems to make the issue not happen -- here is my code:

<body> 
    <form id="form1" runat="server" style="height:100%">  
    <div id="silverlightControlHost">  
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">  
          <param name="source" value="ClientBin/BioDMap.xap"/>  
          <param name="onError" value="onSilverlightError" /> 
          <param name="background" value="white" /> 
          <param name="minRuntimeVersion" value="3.0.40624.0" /> 
          <param name="autoUpgrade" value="true" /> 
          <href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">  
              <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>  
          </a> 
        </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>  
    </form> 
</body> 

Any idea?  I've got this code running inside of a frame but all other controls are fine except for this Silverlight object.

Thanks in advance,
T. Tsonev
Telerik team
 answered on 21 Dec 2009
10 answers
162 views
Hi

I want to have the full 24 hours available to scroll in, but on opening the control I'd like to only show a particular time span, say 0700 to 1700, which covers the normal part of the day.

Looking at the available settings I'd have thought that DayView-DayStartTime / DayView-DayEndTime  would do it, but it doesn't, more to the point if you search the help for this there isn't any.

How can I do this.

Andy
Peter
Telerik team
 answered on 21 Dec 2009
2 answers
379 views
Hi,

I need to refresh a RadTreeView inside of a user control from client side. Is there any way to rebind the treeview in javascript?

Thanks,
Frank
Frank Fu
Top achievements
Rank 1
 answered on 21 Dec 2009
1 answer
84 views
Hi Telerik,
i saw your example of using a user control in RadGrid to mmake a custom edit mode and I have some wuestions about it:
1. in the user control, i want to have access in the code behind to the recieved data item. how can i do that?
2. The reason i ask it is because i didn't manage to perform more complicated data binding in the user control. I wanted to bind a dropdown list to one of the dataItem fields. this is the full dataItem that is returened by the datasource in the main grid:
 public DataView Fill() 
        { 
            //DataView dv = new DataView(); 
 
            //dv.Table.DataSet.Tables.Add("tbl999"); 
            DataTable dt = new DataTable("tbl999"); 
             
            dt.Columns.Add(new DataColumn("Title")); 
            dt.Columns.Add(new DataColumn("isCombo")); 
            dt.Columns.Add(new DataColumn("options")); 
 
 
             
            for (int i = 0; i < 10; i++) 
            { 
                DataTable dtInner = new DataTable("dtInner "+i); 
 
                dtInner.Columns.Add(new DataColumn("optionValue")); 
                dtInner.Columns.Add(new DataColumn("optionTitle")); 
                for(int j=0;j<i;j++){ 
                    dtInner.Rows.Add(j,"option " + j); 
                } 
                DataView dvInner = dtInner.DefaultView; 
                dt.Rows.Add("Question number " + i, Convert.ToBoolean(i % 2), dvInner); 
            } 
            DataView dv = dt.DefaultView; 
            return dv; 
        } 
and in my user control, i tried to Bind / Eval it in the ASCX side:
  <td style="width: 50%"
                            <asp:Label ID="lblOptionTitle" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Title") %>'></asp:Label> 
                        </td> 
             <asp:DropDownList runat="server" DataSource='<%# DataBinder.Eval(Container, "DataItem.options") %>' OnDataBinding="dropdownlist2_DataBound" 
                                ID="dropdownlist2" AppendDataBoundItems="true" DataTextField="optionTitle" DataValueField="optionValue" DataMember="options"
                            </asp:DropDownList>           <td style="width: 50%"
 </td> 

but the second Eval doesn't work.

3. To make things more neat, is it possible to user DetailsView in the edited user control and use it's events? Can you please demonstrate how to bind it to the returned data item? do you have a better recommendation for this use?

Thanks,
Hadar
Pavlina
Telerik team
 answered on 21 Dec 2009
3 answers
211 views
Hello,

I have a RadGrid with a UserControl for the Edit command.  That UC contains both a RadToolbar and a RadEditor.  I want to verify client-side that the Editor contains some text when the user clicks a toolbar button.  I've subscribed to the OnClientButtonClicking event for the toolbar.  However, when the UC opens, I get a JavaScript error that 'OnClientButtonClicking' is undefined.

Here is the declaration for the OnClientButtonClicking handler:

<script type="text/javascript">  
function OnClientButtonClicking(sender, args)  
{  
    if (args.get_item().get_value() == "save") {  
        var editor = $find("<%=reComments.ClientID%>");  
        if (editor.get_text() == "") {  
            window.alert("You must enter Comments in order to have your request reviewed!");  
            args.set_cancel(true);  
        }  
    }  
}  
</script> 

And here are the declarations for the RadEditor and RadToolbar:

<telerik:radeditor  
    Skin="WebBlue" 
    EditModes="Design" 
    Width="80%" 
    Height="250px" 
    StripFormattingOnPaste="All" 
    ID="reComments" 
    runat="server" 
    toolsfile="~/ToolsFile.xml" 
    StripFormattingOptions="All">  
    <CssFiles><telerik:EditorCssFile Value="~/css/EditorContentArea.css" /></CssFiles>  
    <Content> 
    </Content> 
</telerik:radeditor> 
 
<telerik:radtoolbar OnClientButtonClicking="OnClientButtonClicking" Skin="Vista" Font-Names="Verdana" AutoPostBack="true" runat="server" id="Radtoolbar2">  
    <items> 
        <telerik:RadToolBarButton CommandArgument="save" CommandName="save" Enabled="false" ForeColor="White" Text="Submit Request" ImageUrl="../../images/save.gif" runat="server" ToolTip="Click here to submit your request to your supervisor." /> 
        <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton> 
        <telerik:RadToolBarButton CommandArgument="cancel" ForeColor="White" Text="Cancel & Return to Competency List" ImageUrl="../../images/back.gif" runat="server" ToolTip="Click here to cancel any changes made and return to the list of competencies." CommandName="Cancel" /> 
    </items> 
</telerik:radtoolbar> 

Again, the UC is opened for the Edit command of a RadGrid.

Thanks in advance for your help!

Jeff
Veselin Vasilev
Telerik team
 answered on 21 Dec 2009
1 answer
244 views
I'm having a hell of a time with this... thought it should be fairly straight foward, but I'm at a loss. Are there any good examples floating around out there that I can reference, a preliminary search of the forums, and a good look at the help files have yeilded very little in the way of an answer.

What I would like to acheive is a method for iterating through all the cells in my grid (which uses item templates) and determining when certain cells need adjusted text displayed. This includes replacement of string.Empty as well as shortening long strings and adding "..." to keep the grid formatted nicely. However I would rather not have to use findControl(), I would like to access each control via it's index within the itemtemplate. Is this at all possible?
Dimo
Telerik team
 answered on 21 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?