Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
189 views
Hello,

I have a RadComboBox with a single RadTreeView as the template item. I essentially want to allow the user to pick an option from the Tree in the drop down, trigger a postback on the tree nodeclick to save and act on the selection, then set the text of the combo box to the item that was selected in the Tree. The only way I've been able to achieve this thus far is by setting the AllowCustomText attribute to "true" on the RadCombo box. If I don't set this to true, the RadCombo box does not display the value that I have set from the selected tree node during the postback. When I set AllowCustomText to "true" however, this allows the user to type text into the RadComboBox field, which is not acceptable. I need to restrict the value of the RadComboBox to the items displayed in the contained tree. Preferably, the user cannot type into the RadComboBox at all. Clicking on this field should just open the drop down so the user can select an item from the tree. 

Markup:
<telerik:RadComboBox ID="RadComboObjectPicker" runat="server" Skin="Office2010Blue" Width="150px" Height="300px" AccessibilityMode="True" EnableTextSelection="False" AllowCustomText="true" DropDownWidth="250px">
<Items>
<telerik:RadComboBoxItem runat="server" TabIndex="1" />
</Items>       
<ItemTemplate>
<telerik:RadTreeView ID="RadTreeObjectPicker" runat="server" Skin="Office2010Blue" OnNodeClick="RadTreeObjectPicker_NodeClick" TabIndex="1" >
</telerik:RadTreeView>
</ItemTemplate>
</telerik:RadComboBox>
 
C# Code Behind:
protected void RadTreeObjectPicker_NodeClick(object sender, RadTreeNodeEventArgs e)
{
     
    //if (!String.IsNullOrEmpty(e.Node.Value))
    //{
    //    TakeSomeAction(e.Node.Value);
    //}
 
    RadComboObjectPicker.Text = e.Node.Text;
}

I'm open to any suggestions to achieve this behavior. Thanks! 


Vijay
Top achievements
Rank 1
 answered on 01 May 2012
2 answers
117 views
I have placed my radGrid inside a Radcombobox but I try to open a radcombobox by calling OnClientDropDownOpening="OnClientDropDownOpening" using ajax request it gets closed automatically.

 function OnClientDropDownOpening(sender, args) {
            var comboText = sender.get_text();
            if (comboText.length > 2) {
                 $find("<%= rapJob.ClientID %>").ajaxRequest("LoadFilteredData," + comboText);
            }
            else {
                args.set_cancel(true);
            }
        }

 Protected Sub rapJob_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)


        Dim rgJob As RadGrid = TryCast(rcbJob.Items(0).FindControl("rgJob"), RadGrid)
        If e.Argument.IndexOf("LoadFilteredData") <> -1 Then
            rgJob.Rebind()
        End If


    End Sub


    Protected Sub rgJob_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)


        Dim rgJob As Telerik.Web.UI.RadGrid = source


        Dim IJobs = (From Jobs In dbContext.FF_Jobs Where Jobs.IsCreated = True And Jobs.IsCancelled = False And Jobs.IsTemplate = False
                    Select Jobs).ToList


        rgJob.DataSource = IJobs


    End Sub

<telerik:RadAjaxPanel ID="rapJob" RequestQueueSize="5" runat="server" Width="100%"
               OnAjaxRequest="rapJob_AjaxRequest" EnableOutsideScripts="True" HorizontalAlign="NotSet"
               ScrollBars="None" LoadingPanelID="alpJob">
               <telerik:RadComboBox ID="rcbJob" EmptyMessage="- please select job -" runat="server"
                   OnClientDropDownOpening="OnClientDropDownOpening" MarkFirstMatch="True" Width="300px"
                   Skin="Vista" AutoPostBack="True" AutoCompleteSeparator="true" Filter="Contains"
                   AllowCustomText="true">
                   <ItemTemplate>
                       <div>
                           <telerik:RadGrid ID="rgJob" runat="server" Width="95%" Skin="Vista" AutoGenerateColumns="False"
                               AllowSorting="True" AllowMultiRowSelection="False" OnNeedDataSource="rgJob_NeedDataSource"
                               AllowPaging="True" GridLines="Both" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                               <PagerStyle Mode="NumericPages"></PagerStyle>
                               <MasterTableView Width="100%" DataKeyNames="ID,JobName" Name="rgJob" CommandItemDisplay="None" NoMasterRecordsText=""   >
                                   <Columns>
                                       <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton"
                                           DataField="ID" UniqueName="ID" ReadOnly="true">
                                       </telerik:GridBoundColumn>
                                       <telerik:GridBoundColumn SortExpression="JobName" HeaderText="Job Name" HeaderButtonType="TextButton"
                                           DataField="JobName" UniqueName="JobName">
                                       </telerik:GridBoundColumn>
                                   </Columns>
                               </MasterTableView>
                               <ClientSettings EnableRowHoverStyle="true">
                                   <Selecting AllowRowSelect="true" />
                                   <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                               </ClientSettings>
                           </telerik:RadGrid>
                       </div>
                         
                   </ItemTemplate>
                   <Items>
                       <telerik:RadComboBoxItem runat="server" Text=" "></telerik:RadComboBoxItem>
                   </Items>
               </telerik:RadComboBox>
           </telerik:RadAjaxPanel>

Ivana
Telerik team
 answered on 01 May 2012
1 answer
141 views
hi, i have this code

<div id="contentlogin">
        <telerik:RadSplitter runat="server" Skin="Black" Orientation="Horizontal" BorderSize="0" PanesBorderSize="0" Width="500px">
            <telerik:RadPane runat="server" Scrolling="none" ShowContentDuringLoad="true">
                <telerik:RadSlidingZone runat="server" Width="500px">
                    <telerik:RadSlidingPane ID="tabslidelog" Title="<span class='txt11fffN'>Login</span>" IconUrl="~/img/blogs.png" TabView="TextAndImage" runat="server" Width="500px" MaxWidth="500" MinWidth="500" MaxHeight="150" EnableDock="true" EnableResize="false" Overlay="true">
                        Pane 1 Content
                    </telerik:RadSlidingPane>
                </telerik:RadSlidingZone>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>

my problem is in the width of tabview or the title from SlidingPane will be the same; attachment explains better me problem. Thanks.
Dobromir
Telerik team
 answered on 01 May 2012
1 answer
177 views
Hello

In my my application I have created Training .aspx page in that page i have used usercontrol Mydocument.ascx in that  user control i have used  telerik RadEditor Control  but i want my page scroll position set to Top I have written following  javascript code on Training.aspx page and also Mydocument.ascx page  but when I browse This page in IE-8 Page scroll position is set to the Cursor Position of Rad Editor  but I want to show my page from Top I want my page scroll position should be top so I have used Following Javascript Code it works fine in Other browser but in IE-8  after page load scroll position is  set according to cursor position of radEditor

<script type="text/jscript">
    var xPos, yPos;
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(BeginRequestHandler);
    prm.add_endRequest(EndRequestHandler);
    function BeginRequestHandler(sender, args) {

        xPos = $('#<%=reContent.ClientID %>').scrollLeft;
        yPos = $('#<%=reContent.ClientID %>').scrollTop;
    }
    function EndRequestHandler(sender, args) {
        $('#<%=reContent.ClientID %>').scrollLeft = xPos;
        $('#<%=reContent.ClientID %>').scrollTop = yPos;
    }
</script>

please reply as soon as possible
Rumen
Telerik team
 answered on 01 May 2012
1 answer
137 views
Hi, for 2 hours now I'm trying to get a selected value on page load...
I'm using jquery and I ve read every page about radcombox on client-side...

here's what I do.
Some one to tell me what's wrong?
Thanx

  $j(document).ready(function() {
      var combo = getElem("<%= myCombobox.ClientID %>");
      var item = combo.get_selectedItem();
      var val = item.get_value();
//code...
});
Dimitar Terziev
Telerik team
 answered on 01 May 2012
1 answer
112 views
I'm using the rad editor to store info in a db for a page. I tried, removing characters manually, but it would throw an error. So, then I tried using a command parameter i.e. cmd.parameters.addwithvalue("param", RadEditor1.text) but that loses all of the html stuff.
I'm assuming I need to encode and then decode it somehow, I just don't know the right methods. Can you help me out?
Rumen
Telerik team
 answered on 01 May 2012
1 answer
130 views
When using the editors ExportToPdf method, we often get the right hand side of the document cut off. Is this a known issue?
Rumen
Telerik team
 answered on 01 May 2012
3 answers
134 views
Not sure what the problem is. Only shows up in IE.


Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Wed, 25 Apr 2012 20:32:45 UTC


Message: 'undefined' is null or not an object
Line: 19069
Char: 1
Code: 0
URI: http://qa.teams2.ytb.com/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d1.0.61025.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f0f78f9-0731-4ae9-b308-56936732ccb8%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.1.519.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a7807982c-d856-4b9c-96d9-4b1b757dd848%3a16e4e7cd%3aed16cbdc%3af7645509%3a11a04f7e%3a24ee1bba%3ae330518b%3a1e771326%3a8e6f0d33%3a6a6d718d%3aaa288e2d%3a8674cba1%3ab7778d6c%3ac08e9f8a%3a59462f1%3aa51ee93e%3ae085fe68%3a58366029%3a874f8ea2%3a19620875%3a39040b5c%3a33108d14%3abd8f85e4%3ac8618e41%3ae4f8f289


Kate
Telerik team
 answered on 01 May 2012
1 answer
42 views
Hi All,

My question is very simple... I have a radgrid containing a Master table and detail table for each row. When I click on either of the row, I want to know, where did I clicked... Is it master table or detail table ? Is there any property to know on which table I clicked on (master or detail)...

Please help me out...

Thanks & Regards,
Ramesh Sambari
Jayesh Goyani
Top achievements
Rank 2
 answered on 01 May 2012
3 answers
287 views
Hello

I have a simple ASP.net handler which returns objects via JSON.
I want to use RadTreeView to display nodes corresponding to it.

All works fine, except I cannot find a way to control the icons (plus, minus and spinner) manually.
My JSON objects contain a flag "hasChildren" and the JSON is only one level deep per request.

I can make requests, get child objects, add them to the telerik tree, recursive if needed, etcetera ... but I cannot find how to manually visualize this ajax/loading behaviour and the "hasChildren" flag.

I noticed that the ExpandMode property on a node is related to this.. however I think it is not an option since it is 0 by default = TreeNodeExpandMode.ClientSide

Any help?
Plamen
Telerik team
 answered on 01 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?