Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
101 views
Hi all,

After adding a NestedViewTemplate to my grid, there is automatic added a GridExpandColumn. That it is fine, but how do i define attributes as Width etc., at this column? By adding the <telerik:GridExpandColumn></telerik:GridExpandColumn> for set the settings, there just are added to ExpandColumns...
Ahrensberg
Top achievements
Rank 1
 answered on 28 Sep 2009
7 answers
341 views
Hi,

I have on page RadComboBox with ItemTemplate:
<telerik:RadComboBox ID="ddlDestination" runat="server" DataSourceID="dsDestination" DataTextField="country" DataValueField="countryID" OnClientSelectedIndexChanged="ChangeItem"
<ItemTemplate> 
     <%#Eval("country") %> 
     <asp:TextBox ID="txtContinentId" runat="server" Visible="false" Text='<%# Eval("continentID")%>'></asp:TextBox> 
</ItemTemplate> 
<CollapseAnimation Duration="200" Type="OutQuint" /> 
</telerik:RadComboBox> 

and I have javascript function
<script language="javascript" type="text/javascript"
        function ChangeItem(sender, eventArgs) 
        {     
            var item = eventArgs.get_item(); 
            var txt = item.findControl("txtContinentId"); 
            alert (txt); 
            fmAreaCenter(item.get_value()); 
        } 
    </script> 

which fire when OnClientSelectedIndexChanged fired.
How get value TextBox of current Item?
var txt = item.findControl("txtContinentId");



is not find textbox!


Yana
Telerik team
 answered on 28 Sep 2009
1 answer
114 views
I put this code inside xmlhttppanel


  
    <telerik:RadListBox runat="server" RegisterWithScriptManager="true" ID="lstDates" 
                            AllowDelete="true" Skin="Office2007" SelectionMode="Multiple" Width="300"
                            <ItemTemplate> 
                                <telerik:RadDateTimePicker ID="dtPicker" runat="server" SelectedDate='<%# Container.DataItem %>'> 
                                </telerik:RadDateTimePicker> 
                            </ItemTemplate> 
                        </telerik:RadListBox> 
                        <telerik:RadDateTimePicker ID="dtpDate" runat="server" Skin="Office2007" /> 
                        <br /> 
                        <asp:LinkButton ID="btnAddDate" runat="server" OnClientClick="callServer()" ValidationGroup="adddate"
                            <img id="Img1" src="~/images/btn_adddate.gif" runat="server" /></asp:LinkButton><br /> 
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Select Date first" 
                            ControlToValidate="dtpDate" ValidationGroup="adddate"></asp:RequiredFieldValidator> 

when requist return from server I receive this message from VS  : 'dateinput' not registered with script manager
and the strange I dont have control in this name , but I am working with date , is there any help
the function of callServer() contain the code of calling server




Lini
Telerik team
 answered on 28 Sep 2009
1 answer
39 views
While I am dragging the Image manager popup the content of the control dissapears and flashes as does the editor behind it. I am using version 2008.2.723.20.
Rumen
Telerik team
 answered on 28 Sep 2009
1 answer
144 views
Hi,
I have a couple of treeviews embedded in a radpanel as shown below. I am trying to catch the OnClientNodeClicked event in javascript, however when I add the OnClientNodeClicked="DoOnClientNodeClick
to the treeview definition I find that my server side event handler no longer gets called.

Ultimately, what I am trying to do is have the control expand or collapse regarless of whether the click on the plus/minus sign or on the text of the node.
Any guidance would be greatly appreciated.
Thanks ... Ed


Here is the javascript I am using:
        function DoOnClientNodeClick(sender, eventArgs)  
        {  
            var node = eventArgs.get_node();  
            node.toggle();  
            CollapseOthers(node);  
            return true;  
        }  
          
        function DoOnClientNodeExpanded(sender, eventArgs)  
        {  
            eventArgs.get_node().select();  
            CollapseOthers(eventArgs.get_node());  
            return true;  
        }  
        function CollapseOthers(node)  
        {  
            // if they are expanding a node then close all other root nodes  
            if (node.get_expanded())  
            {  
                var tv = node.get_treeView();  
                var nodeRoot;  
                var nCnt = 0;  
                // find the root node of the clicked on node  
                while (1)  
                {  
                    if (node.get_parent() == tv)  
                    {  
                        nodenodeRoot = node;  
                        break;  
                    }  
                    else  
                        nodenode = node.get_parent();  
                      
                    // a just in case check for a runaway loop  
                    if (nCnt++ > 250)  
                        return;  
                }  
                var i;  
                // collapse all other roots  
                for (i = 0; i < tv.get_nodes().get_count(); i++)  
                {  
                    if (tv.get_nodes().getNode(i) != nodeRoot)  
                    {  
                        tv.get_nodes().getNode(i).set_expanded(false);  
                    }  
                }  
            }  
        }  
 



On the server side I have the following code
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init  
        Dim tv As RadTreeView = rpiAccounts.FindControl("rtvAccount")  
        AddHandler tv.NodeExpand, AddressOf tvAccounts_NodeExpand  
        AddHandler tv.ContextMenuItemClick, AddressOf rtvAccount_ContextMenuItemClick  
        AddHandler tv.NodeClick, AddressOf rtvAccount_NodeClick  
        AddHandler tv.NodeDrop, AddressOf rtvAccount_NodeDrop  
 
        tv = rpiLevels.FindControl("rtvLevel")  
        AddHandler tv.NodeClick, AddressOf rtvLevel_NodeClick  
    End Sub 

                                <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Vista" ExpandMode="SingleExpandedItem" Width="402px" > 
                                    <CollapseAnimation Duration="100" Type="None" /> 
                                    <Items> 
                                        <telerik:RadPanelItem id="rpiAccounts" runat="server" Text="Accounts">  
                                            <ItemTemplate> 
                                                <telerik:RadTreeView ID="rtvAccount" runat="server"  EnableDragAndDrop="true" 
                                                     EnableDragAndDropBetweenNodes="true" Skin="Vista" CausesValidation="false" 
                                                     OnClientNodeClicked="DoOnClientNodeClick"

                                                     OnClientNodeExpanded

 

="DoOnClientNodeExpanded"

 

                                                     > 
                                                    <CollapseAnimation Duration="100" Type="OutQuint" /> 
                                                    <ExpandAnimation Duration="100"/>  
                                                </telerik:RadTreeView> 
                                            </ItemTemplate> 
                                        </telerik:RadPanelItem> 
                                        <telerik:RadPanelItem id="rpiLevels" runat="server" Text="Levels">  
                                            <ItemTemplate> 
                                                <telerik:RadTreeView ID="rtvLevel" runat="server" Skin="Vista" CausesValidation="false"
                                                     OnClientNodeClicked="DoOnClientNodeClick"

                                                     OnClientNodeExpanded

 

="DoOnClientNodeExpanded"

 

                                                    >  
                                                    <CollapseAnimation Duration="100" Type="OutQuint" /> 
                                                    <ExpandAnimation Duration="100" /> 
                                                </telerik:RadTreeView> 
                                            </ItemTemplate> 
                                        </telerik:RadPanelItem> 
                                    </Items> 
                                    <ExpandAnimation Duration="100" Type="None" /> 
                                </telerik:RadPanelBar> 
Yana
Telerik team
 answered on 28 Sep 2009
1 answer
95 views
I have a RadDatePicker I am using on a child page.  The master page includes a jQuery.js file - which wreaks havoc on how many RadControls work and appears to disregard any skin set for the RadDatePicker.

<script type="text/javascript" src="/js/jquery132.js"></script> 

Commenting out the jQuery.js line fixes the RadControls problem, but then I can't use additional jQuery, I get a javascript error that basically tells me that $ is undefined.

From other articles/posts it would appear that the $ is invalid as far as the RadControls are concerned, as it uses a different variable to avoid conflicts.  It appears to be conflicting for me though.  Any ideas?

I have my RadScriptManager set up as follows:
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" > 
    <Scripts> 
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
    </Scripts> 
</telerik:RadScriptManager> 

I have tried the $ assignment as follows, to no avail:
<script type="text/javascript"
window.$ = $telerik.$; 
</script> 



Nikolay Rusev
Telerik team
 answered on 28 Sep 2009
8 answers
123 views
    <telerik:RadInputManager ID="RadInputManager1" runat="server">   
       <telerik:TextBoxSetting BehaviorID="TextBoxBehavior1" ErrorMessage="BAD!">  
            <Validation   
                Location="/Services/Membership.svc"   
                ValidateOnEvent="All" 
                Method="ValidNewUsername" 
             /> 
            <TargetControls> 
                <telerik:TargetInput ControlID="TextBox1" /> 
            </TargetControls>       
            <ClientEvents OnValidating="onValidating" />     
        </telerik:TextBoxSetting>     
    </telerik:RadInputManager>      
      
    <script type="text/javascript">  
        function onValidating(sender, args) {  
            alert('hello');                            
        }      
    </script> 

I have successfully configured a webservice to validate a textbox; however, it only occurs on the submit and not on the blur. The client-side onValidating function is being called on the blur, but there is no visual sign or invalid values despite the service returning a false. When I submit the form, however, the typical error messages are displayed (without a server trip). How can I get the error messages to display on blur?
Tsvetoslav
Telerik team
 answered on 28 Sep 2009
3 answers
125 views

Hi All,

Thanks in advance to anybody who may be able to help me. 

I am having two problems with an implementation of RadGrid. The first is how to define a custom filter method for percentage values. I have a grid with some columns as integers and others as percentages (double). I would like for the user to be able to filter these values based on their percentage value (0-100) and not their rate value (0-1). For example, filter by 1.79 as opposed to 0.0179. I realize the easiest way to do this is to cast the user input as a double and divide by 100 to obtain the corresponding rate, however I am not sure how to do this.

The second problem I am having is scrolling with frozen columns and headers. It seems that when I declare frozen columns, the grid does not scroll to the right entirely and truncates the right-most columns from view. The more frozen columns I have, the more columns get truncated from the right. Below are screenshots to illustrate the problem:

Without frozen columns (Link Outage is right-most column): http://216.196.244.34/scroll.jpg
With 2 frozen columns (Link Outage is no longer viewable): http://216.196.244.34/freezescrollbroken.jpg

NOTE: The RadGrid I have declared in code has the static columns as well as a dozen or so dynamic columns, generated at run-time.

                RadGrid1.ClientSettings.Scrolling.AllowScroll = true
                RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2; 
                RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = true
                                <telerik:RadGrid Width="800px" OnItemCommand="radGridItemCommand" Skin="Hay" ID="RadGrid1" runat="server" AllowPaging="True" AllowFilteringByColumn="True" AllowSorting="True" GridLines="None" AutoGenerateColumns="False" OnItemDataBound="radGridItemDataBound" OnNeedDataSource="radGridNeedDataSource" > 
                                    <MasterTableView Height="100%" PageSize="24" RetrieveAllDataFields="false" AllowSorting="true"
                                        <Columns> 
                                            <telerik:GridBoundColumn FilterImageUrl="img/arrow-icon.png" FilterControlWidth="50" DataField="Data_Date" SortExpression="Data_Date" HeaderText="Date" DataFormatString="{0:MM/dd/yy}"></telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn Visible="false" FilterControlWidth="15" DataField="Data_Hour" SortExpression="Data_Hour" HeaderText="Hour2"></telerik:GridBoundColumn> 
                                            <telerik:GridTemplateColumn FilterImageUrl="img/arrow-icon.png" FilterControlWidth="15" HeaderText="Hour" SortExpression="Data_Hour"
                                                <ItemTemplate> 
                                                    <asp:LinkButton ID="hourLinkButton" runat="server" CommandName="Click" CausesValidation="false" CommandArgument='<% # Eval("Data_Date").ToString() + "|" + Eval("Data_Hour").ToString() %>' Text='<% #Eval("Data_Hour") %>' OnClick="AntennaLevel"/> 
                                                </ItemTemplate> 
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridBoundColumn Visible="false" FilterControlWidth="15" DataField="Week" SortExpression="Week" HeaderText="Week"></telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn Visible="false" FilterControlWidth="15" DataField="Month" SortExpression="Month" HeaderText="Month"></telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn FilterControlWidth="15" Visible="False" DataField="MarketNum" SortExpression="MarketNum" HeaderText="MarketNum"></telerik:GridBoundColumn> 
                                        </Columns> 
                                    </MasterTableView> 
                                    <AlternatingItemStyle BackColor="#c9fca3"/>        
                                </telerik:RadGrid> 



Thanks again for any assistance you can provide,
Kyle
Tsvetoslav
Telerik team
 answered on 28 Sep 2009
1 answer
56 views
Hi,

I want text box instead of combo in paging. I want allow to customer to enter paging size of grid. How can i do that?

lakmal

Vlad
Telerik team
 answered on 28 Sep 2009
5 answers
417 views
Can someone tell me how to make only certain dates available. Basically we want to show a calendar, but need to only allow the user to select a date that falls on a Saturday. I am using radCalendarControl for 3.5
Yavor
Telerik team
 answered on 28 Sep 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?