Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
947 views
Hello,
I've written the code below in c# and i want to convert it to JavaScript
Because i need it in Client-side
is there anyone to convert it for me?

this is my C# code :
int res = 1;
       
       for (int i = 0; i < 15; i++)
       {
           int row = 0;
           if (((Telerik.Web.UI.RadButton)GridView1.Rows[i].FindControl("btn_1")).Checked != true)
           {
               row += 1;
           }
 
           if (((Telerik.Web.UI.RadButton)GridView1.Rows[i].FindControl("btn_2")).Checked != true)
           {
              row += 1;
           }
 
           if (((Telerik.Web.UI.RadButton)GridView1.Rows[i].FindControl("btn_3")).Checked != true)
           {              
               row += 1;
           }
           if (row == 0)
               row = 1;
           res = res * row;
       }

Thank you
Hassan
Hassan
Top achievements
Rank 1
 answered on 11 May 2013
1 answer
72 views
I have a RadPanelBar that I have setup based on the Accessing Nested Controls demo on the Telerik site.  I have a "Next" button at the bottom of each panel.  As I click next, the panel below is opened.  All is good.

As soon as I drop a RadDropDownTree into one of the panels, the "Next" button no longer functions.  I remove the RadDropDownTree and the button functions normally again.

Anyone have any info. on this?
Richard
Top achievements
Rank 2
 answered on 11 May 2013
2 answers
101 views
Hi there,

When I enable TrackChanges or Comments in markp, the speed of typing decreases dramatically. When trackchanges is set to true then the typing speed is normal, when it's set to false typing speed decreases. Why is this happening, i just cant seem to solve this. I'm using this version of AJAX Web UI 2012.3.1308.35.

P.S. When there is no comments or TrackChenges enabled the typing speed is normal.

Internet Explorer 9 is affected only both in compatibility and non compatibility mode.

This is html Code
<p><ins title="Inserted by RadEditorUser on Thursday, April 25, 2013
8:23:22 PM" class="reU0" cite="RadEditorUser"
timestamp="1366914202348">dfgdlfkgjdlk dflgkjdflgkjd fglkdjg
ldkfjgldf<span title="RadEditorUser: dfgdfg: Thursday, April 25, 2013 8:23:31
PM" class="reComment reU0" timestamp="1366914211489" comment="dfgdfg"
author="RadEditorUser">kjgldkfgjldkgj</span><span></span></ins><span>dfgdfgdlfkgjdlfkj
dglkjdfglkjdg<br
/><BR>sdlfkjsldkfjlskdfjlskdfjlskdfjdlfkgjldkfjgldkjgldkjfglkdjglkdjfglkjdfglkjdflgkj</span></p>


this is markup

<telerik:RadTabStrip
            ID="RadTabStrip_MultiChoice"
            runat="server"
            MultiPageID="RadMultiPage_MultiChoice"
            width="800px"
            Skin="Windows7"
            CausesValidation="False"
            BackColor="#F0F3F7"
            SelectedIndex="1">
 
            <Tabs>
                <telerik:RadTab
                    runat="server"
                    Text="<%$ Resources:UILanguage,RadPageViewGeneral %>"
                    PageViewID="RadPageView_General"
                    Selected="false" />
                <telerik:RadTab
                    runat="server"
                    Text="<%$ Resources:UILanguage,RadPageViewOptions %>"
                    PageViewID="RadPageView_ItemText"
                    Selected="false" />
                <telerik:RadTab
                    runat="server"
                    Text="<%$ Resources:UILanguage,RadPageViewPreview %>"
                    PageViewID="RadPageView1"
                    Selected="false" />
            </Tabs>
        </telerik:RadTabStrip>
 
        <telerik:RadMultiPage
            ID="RadMultiPage_MultiChoice"
            runat="server"
            width="800px"
            BackColor="#f0f3f7"
            BorderColor="#f0f3f7"
            BorderStyle="Solid" SelectedIndex="1"
            BorderWidth="1px" >
             
            <telerik:RadPageView
                ID="RadPageView_General"
                runat="server">
                 
                  <table style="padding:5px; border-style:none; empty-cells:hide">
                   
                    <tr>
                        <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataItemUid"
                                runat="server"
                                Text="<%$ Resources:UILanguage,ItemUID %>"
                                Visible="False" />
                        </td>
                         
                         <td class="FormCell_250">
                            <asp:TextBox
                                ID="dataItemUid"
                                runat="server"
                                Enabled="False"
                                Visible="False" />
                        </td>
                    </tr>
                     
                    <tr>
                         <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataIdSubjectCategory"
                                runat="server"
                                Text="<%$ Resources:UILanguage,IdSubjectCategory %>" />
                        </td>
                         
                        <td class="FormCell_250">
                            <data:EntityDropDownList
                                ID="dataIdSubjectCategory"
                                runat="server"
                                AppendDataBoundItems="True"
                                AppendNullItem="True"
                                CaseSensitiveKeySort="False"
                                DataSourceID="IdSubjectCategoryMasterSubjectCategoryDataSource"
 
                                DataValueField="IdSubjectCategory"
                                EnableClientScript="True"
                                NullItemText="<%$ Resources:UILanguage,EntityDropDownListNull %>"
                                Required="False"
/>
                             
                            <asp:RequiredFieldValidator
                                ID="ReqVal_dataIdSubjectCategory"
                                runat="server"
                                ControlToValidate="dataIdSubjectCategory"
                                Display="Dynamic"
                                ErrorMessage="<%$ Resources:UILanguage,ValidatorRequired %>"
                                SetFocusOnError="True" />
                             
                            <data:MasterSubjectCategoryDataSource
                                ID="IdSubjectCategoryMasterSubjectCategoryDataSource"
                                runat="server"
                                SelectMethod="GetByIdSubject">
                                <Parameters>
                                    <asp:SessionParameter Name="IdSubject" SessionField="IdSubject" />
                                </Parameters>
                            </data:MasterSubjectCategoryDataSource>
                        </td>
                    </tr>
                     
                    <tr>
                        <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataIdDifficulty"
                                runat="server"
                                Text="<%$ Resources:UILanguage,IdDifficulty %>" />
                        </td>
                         
                        <td class="FormCell_250">
                            <data:EntityDropDownList
                                ID="dataIdDifficulty"
                                runat="server"
                                AppendDataBoundItems="True"
                                AppendNullItem="True"
                                CaseSensitiveKeySort="False"
                                DataSourceID="IdDifficultyMasterDifficultyDataSource"
                                DataValueField="IdDifficulty"
                                EnableClientScript="True"
                                NullItemText="<%$ Resources:UILanguage,EntityDropDownListNull %>"
                                Required="False"
 />
 
                            <asp:RequiredFieldValidator
                                ID="ReqVal_dataIdDifficulty"
                                runat="server"
                                ControlToValidate="dataIdDifficulty"
                                Display="Dynamic"
                                ErrorMessage="<%$ Resources:UILanguage,ValidatorRequired %>"
                                SetFocusOnError="True" />
                             
                            <data:MasterDifficultyDataSource
                                ID="IdDifficultyMasterDifficultyDataSource"
                                runat="server"
                                SelectMethod="GetAll" />
                        </td>
                    </tr>
                     
                    <tr>
                        <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataIdBehaviour"
                                runat="server"
                                Text="<%$ Resources:UILanguage,IdBehaviour %>" />
                        </td>
                         
                        <td class="FormCell_250">
                            <data:EntityDropDownList
                                ID="dataIdBehaviour"
                                runat="server"
                                AppendDataBoundItems="True"
                                AppendNullItem="True"
                                CaseSensitiveKeySort="False"
                                DataSourceID="IdBehaviourMasterBehaviourDataSource"
                                DataValueField="IdBehaviour"
                                EnableClientScript="True"
                                NullItemText="<%$ Resources:UILanguage,EntityDropDownListNull %>"
                                Required="False"
 />
                             
                            <asp:RequiredFieldValidator
                                ID="ReqVal_dataIdBehaviour"
                                runat="server"
                                ControlToValidate="dataIdBehaviour"
                                Display="Dynamic"
                                ErrorMessage="<%$ Resources:UILanguage,ValidatorRequired %>"
                                SetFocusOnError="True" />
                                 
                            <data:MasterBehaviourDataSource
                                ID="IdBehaviourMasterBehaviourDataSource"
                                runat="server"
                                SelectMethod="GetAll" />
                        </td>
                    </tr>
                     
                    <tr>
                        <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataIdCompetence"
                                runat="server"
                                Text="<%$ Resources:UILanguage,IdCompetence %>" />
                        </td>
                         
                        <td class="FormCell_250">
                            <data:EntityDropDownList
                                ID="dataIdCompetence"
                                runat="server"
                                AppendDataBoundItems="True"
                                AppendNullItem="True"
                                CaseSensitiveKeySort="False"
                                DataSourceID="IdCompetenceMasterCompetenceDataSource"
                                DataValueField="IdCompetence"
                                EnableClientScript="True"
                                ErrorText=""
                                NullItemText="<%$ Resources:UILanguage,EntityDropDownListNull %>"
                                Required="False"
/>
 
                            <asp:RequiredFieldValidator
                                ID="ReqVal_dataIdCompetence"
                                runat="server"
                                ControlToValidate="dataIdCompetence"
                                Display="Dynamic"
                                ErrorMessage="<%$ Resources:UILanguage,ValidatorRequired %>"
                                SetFocusOnError="True" />
                             
                            <data:MasterCompetenceDataSource
                                ID="IdCompetenceMasterCompetenceDataSource"
                                runat="server"
                                SelectMethod="GetAll" />
                        </td>
                    </tr>
                     
                    <tr>
                         <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataLanguage"
                                runat="server"
                                Text="<%$ Resources:UILanguage,Language %>" />
                        </td>
                         
                        <td class="FormCell_250">
                            <data:EntityDropDownList
                                ID="dataIdLanguage"
                                runat="server"
                                AppendDataBoundItems="True"
                                AppendNullItem="True"
                                CaseSensitiveKeySort="False"
                                DataSourceID="MasterLanguageDataSource"
                                DataValueField="IdLanguage"
                                EnableClientScript="True"
                                ErrorText=""
                                NullItemText="<%$ Resources:UILanguage,EntityDropDownListNull %>"
                                Required="False"
/>
                             
                            <asp:RequiredFieldValidator
                                ID="ReqValdataIdLanguage"
                                runat="server"
                                ControlToValidate="dataIdLanguage"
                                Display="Dynamic"
                                ErrorMessage="<%$ Resources:UILanguage,ValidatorRequired %>"
                                SetFocusOnError="True" />
                             
                            <data:MasterLanguageDataSource
                                ID="MasterLanguageDataSource"
                                runat="server"
                                SelectMethod="GetAll" />
                        </td>
                    </tr>
 
                    <tr>
                        <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataMaxPoints"
                                runat="server"
                                Text="<%$ Resources:UILanguage,MaxPoints %>" />
                        </td>
                         
                        <td class="FormCell_250">
                            <asp:TextBox
                                ID="dataMaxPoints"
                                runat="server"
                                Enabled="False"
                                Width="20px">
                            </asp:TextBox>
                        </td>
                    </tr>
                     
                    <tr>
                        <td class="FormCell_150">
                            <asp:Label
                                ID="lbldataNote"
                                runat="server"
                                Text="<%$ Resources:UILanguage,Note %>" />
                        </td>
                         
                        <td class="FormCell_250">
                            <asp:TextBox
                                ID="dataNote"
                                runat="server"
                                TextMode="MultiLine"
                                Width="250px"
                                Height="100px" />
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
             
            <telerik:RadPageView
                ID="RadPageView_ItemText"
                runat="server"
                width="800px">
            
 
                            </telerik:RadPageView>
                             
                                        <telerik:RadPageView
                ID="RadPageView1"
                runat="server"
                width="800px">
                 
<telerik:RadEditor
                                ID="dataMarkingScheme"
                                runat="server"
                                ContentFilters="DefaultFilters" EnableComments="true" EnableTrackChanges="true" >
 
                                <TrackChangesSettings CanAcceptTrackChanges="False" />
                                <Tools>
                                    <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="Cut" />
                                        <telerik:EditorTool Name="Copy" />
                                        <telerik:EditorTool Name="Paste" />
                                        <telerik:EditorTool Name="PasteFromWord" />
                                        <telerik:EditorTool Name="Undo" />
                                        <telerik:EditorTool Name="Redo" />
                                        <telerik:EditorTool Name="BackColor" />
                                        <telerik:EditorTool Name="Superscript" />
                                        <telerik:EditorTool Name="Subscript" />
                                        <telerik:EditorTool Name="InsertOrderedList" />
                                        <telerik:EditorTool Name="InsertUnorderedList" />
                                        <telerik:EditorTool Name="Indent" />
                                        <telerik:EditorTool Name="Outdent" />
                                        <telerik:EditorTool Name="ImageManager" />
                                        <telerik:EditorTool Name="InsertTable" />
                                    </telerik:EditorToolGroup>
                                    <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="FontName" />
                                        <telerik:EditorTool Name="RealFontSize" />
                                        <telerik:EditorTool Name="Bold" />
                                        <telerik:EditorTool Name="Italic" />
                                        <telerik:EditorTool Name="Underline" />
                                        <telerik:EditorTool Name="StrikeThrough" />
                                        <telerik:EditorTool Name="JustifyLeft" />
                                        <telerik:EditorTool Name="JustifyCenter" />
                                        <telerik:EditorTool Name="JustifyRight" />
                                        <telerik:EditorTool Name="JustifyFull" />
                                        <telerik:EditorTool Name="ForeColor" />
                                    </telerik:EditorToolGroup>
                                    <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="AddComment" />
                                        <telerik:EditorTool Name="RemoveComment" />
                                        <telerik:EditorTool Name="RemoveAllComments" />
                                        <telerik:EditorTool Name="TrackChangesDialog" />
                                        <telerik:EditorTool name="AcceptTrackChange" />
                                        <telerik:EditorTool name="RejectTrackChange" />
                                        <telerik:EditorTool name="AcceptAllTrackChanges" />
                                        <telerik:EditorTool name="RejectAllTrackChanges" />
                                        <telerik:EditorTool name="EnableTrackChangesOverride" />
                                    </telerik:EditorToolGroup>
                                </Tools>
                            </telerik:RadEditor>
                            </telerik:RadPageView>
                             
          </telerik:RadMultiPage>
</asp:Content>
Ardian
Top achievements
Rank 1
 answered on 11 May 2013
1 answer
122 views

I would like to turn the ID column of a dynamically created table into an edit button.  Is this possible?  I have seen plenty of documents on creating button columns, but I want to convert a column from text to a button column in the _ColumnCreated or covert each cell in the _PreRender.

Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryRadGrid.PreRender
    Dim intColIndex As Integer
    Dim gridRow As GridDataItem
 
    For Each column As GridColumn In QueryRadGrid.MasterTableView.AutoGeneratedColumns
        If column.UniqueName = "ID" Then
            intColIndex = column.OrderIndex
            For Each gridRow In QueryRadGrid.MasterTableView.Items
                Dim editCol As GridButtonColumn = New GridButtonColumn
                editCol.ButtonType = GridButtonColumnType.LinkButton
                editCol.DataTextField = gridRow.Cells(intColIndex).Text
                ' How do I convert this cell???
                'gridRow.Cells(intColIndex) = ???
            Next
        End If
    Next

Private Sub QueryRadGrid_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles QueryRadGrid.ColumnCreated
    Dim field As String
    Try
        field = e.Column.UniqueName
        If Not field = Nothing AndAlso field <> "" AndAlso field <> "ExpandColumn" Then
            If DataSet.Tables(TableName).Columns(field).ColumnName = "ID" Then
                e.Column.HeaderText = ""
                     DO SOMETHING HERE TO CONVERT COLUMN

Jayesh Goyani
Top achievements
Rank 2
 answered on 11 May 2013
0 answers
63 views
My subscribed forum threads look different. Some threads that I have subscribed to are not there and the sort order seems unusual.

FYI.

Marty

UPDATE: Looks back to normal now.
moegal
Top achievements
Rank 1
 asked on 11 May 2013
1 answer
115 views

There is a dropdownlist being populated in the OnItemDataBound event.

protected void RadGrid1_OnItemDataBound(object source, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
            GridEditableItem gEditableItem = (GridEditableItem)e.Item;
       
             //hit the framework and get a datatable
  
             DropDownList ddlEffectiveDate = (DropDownList)gEditableItem["efct_period_date"].FindControl("DdlEffectiveDate");
  
                 ddlEffectiveDate.DataSource = dt;
                dlEffectiveDate.DataTextField = "start_date";
                ddlEffectiveDate.DataValueField = "period_id";
                ddlEffectiveDate.DataBind();
                  
                ddlEffectiveDate.Items.Remove(ddlEffectiveDate.Items[0]);
   
  
  
                 


That last line removes the firstitem of the datatable that I've bound the dropdown list to- but the value from the column itself somehow ends up appended into the dropdown list.   I'd like to know what event that happens in.

I want to remove the column value from the dropdownlist Edit Item.   How do I do that?
Jayesh Goyani
Top achievements
Rank 2
 answered on 11 May 2013
7 answers
279 views
I have a very annoying issue: RadcomboBox does not display properly. It looks like the bottom line of control rectangular is missing
and the top line appears to be not 100% straight. This is shown in all IE, firefox and chrome. I attached a screenshot here. This issue makes screen look ugly.

I am using 2013.1.227.40 trial version.

Your help is appreciated.

Kevin
Kevin Sheng
Top achievements
Rank 1
 answered on 10 May 2013
2 answers
244 views
This is what I have:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="btnTest"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="btnTest" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"  
        Skin="Default"> 
    </telerik:RadAjaxLoadingPanel> 
    <asp:Button runat="server" Text="OK" ID="btnTest" /> 

and my code behind:
protected void Page_Load(object sender, EventArgs e) 
    { 
        if (Page.IsPostBack) 
        { 
            throw new Exception("test"); 
        } 
    } 



When i click the button nothing happens, no alert box, no exception notification nothing...can someone point me in the right direction?

Thanks


Mark
Top achievements
Rank 1
 answered on 10 May 2013
3 answers
199 views

Hello,

I'd like to persist the selected Items on client side. I've found an article that describes the solution for RadGrids: http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html .

I tried to apply this solution for RadTreeList. I've replaced the OnRowCreated, OnRowSelected, OnRowDeselected, OnGridCreated event handlers with OnItemCreated, OnItemSelected, OnItemDeselected, OnTreeListCreated event handlers. When the grid is created the OnItemCreated even handler fires and the connected javascript is invoked. When this script invokes the args.get_item().set_selected(true); method I receive a javascript error message the tells me that the this._owner._selectedItems is null. After debugging the script I found that the _owner is null. I thought when this event handler is fired all properties of the item has been set. It seems that I was wrong.

Could you tell me how I can change the selection of a item when the page is loaded or the node is expanded or the control is paginated?

Daniel
Telerik team
 answered on 10 May 2013
1 answer
185 views
I have radtreeview inside radcombobox.

 <telerik:RadComboBox ID="cbTreeViewSelect" runat="server"  ShowToggleImage="True" Skin="Metro" 
                    Style="vertical-align: middle;" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
                    EmptyMessage="Choose a kit" ExpandAnimation-Type="None" CollapseAnimation-Type="None"
                    Font-Bold="true" AutoPostBack="true" Height="350px" CssClass="NormalText12Combo" OnTextChanged="cbTreeViewSelect_TextChanged">
                    <ItemTemplate>
                    
                        <telerik:RadTreeView runat="server" ID="tvTree" OnClientNodeClicking="nodeClicking"
                            CssClass="NormalText12Combo" Width="100%" Height="340px" OnNodeClick="tv_NodeClick"
                            OnDataBound="tvTree_DataBound" />
                           
                    </ItemTemplate>
                    <Items>
                        <telerik:RadComboBoxItem Text="" />
                    </Items>
                </telerik:RadComboBox> 



and scripts as described below.

function nodeClicking(sender, args) {
        var comboBox = $find("<%=cbTreeViewSelect.ClientID %>");
        
        var node = args.get_node()

        var g = node.get_value();
       
        if (g == "0") {
            args.set_cancel(true);
            node.toggle();
            comboBox.attachDropDown();
            comboBox.expand();
        }
        else {
            comboBox.set_text(node.get_text());

            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text(node.get_text());
            comboBox.commitChanges();

            $("#<%=hidValue.ClientID %>").val(node.get_value());

            comboBox.hideDropDown();
        }
        // Call comboBox.attachDropDown if:
        // 1) The RadComboBox is inside an AJAX panel.
        // 2) The RadTreeView has a server-side event handler for the NodeClick event, i.e. it initiates a postback when clicking on a Node.
        // Otherwise the AJAX postback becomes a normal postback regardless of the outer AJAX panel.

        //comboBox.attachDropDown();
    }

    function StopPropagation(e) {
        if (!e) {
            e = window.event;
        }

        e.cancelBubble = true;
    }

    function OnClientDropDownOpenedHandler(sender, eventArgs) {
        var tree = sender.get_items().getItem(0).findControl("tvTree");
        var selectedNode = tree.get_selectedNode();
        if (selectedNode) {
            selectedNode.scrollIntoView();
        }
    }


In IE its working fine but in firefox when i click on hyperlink of top node of treeview it expands the tree but it hides(collapse) dropdown.

i want to keep that treeview and dropdown expanded.

Thanks in advance.
msigman
Top achievements
Rank 2
 answered on 10 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?