Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
132 views
Hi there , I read many articles on ticker , some of them are http://demos.telerik.com/aspnet-ajax/rotator/examples/multiplescroller/defaultcs.aspx and http://demos.telerik.com/aspnet-ajax/ticker/examples/functionality/radticker/defaultcs.aspx , code is shown in aspx format how to get the same code in cshtml format .
Helen
Telerik team
 answered on 21 Aug 2015
1 answer
90 views
Hi there , I read many articles on ticker , some of them are Demo1and ​Demo1, code is shown in aspx format how to get the same code in cshtml format .
I also tried only telerik tags in Razor views but still no working , I've installed tekerik trial version. does that make any difference
<telerik:RadTicker ID="RadTicker1" AutoStart="true" Width="300px">
    <items>
        <telerik:RadTickerItem runat="server" ID="RadTickerItem1" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
             consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
            cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.">
        </telerik:RadTickerItem>
    </items>
</telerik:RadTicker>
Helen
Telerik team
 answered on 21 Aug 2015
3 answers
332 views
<telerik:RadAsyncUpload runat="server" ID="radUpload" MultipleFileSelection="Automatic" ManualUpload="true" HideFileInput="true" Localization-Select="Select files ..." EnableFileInputSkinning="true" OnClientFilesSelected="onFilesSelected"></telerik:RadAsyncUpload>

 

Hi,

 Based on above code, just want to ask how to loop through selected files to get the row and size? Please take note that ManualUpload is set to true.

Basically I want to have below piece of code (but this was created for OnClientFileSelected)

args.get_fileInputField().files[0].size;
 
var row = args.get_row();               
$(row).addClass("file-row");

Aneliya Petkova
Telerik team
 answered on 21 Aug 2015
3 answers
130 views
Helllo

I am using ext.net prgramming and also telerik editor but rad editor gives the following error when i used it in ext.net

"Control with type 'Telerik.Web.UI.RadEditor' cannot be handled by layout"

And this my html code :

 <ext:FieldSet runat="server" Title="Editor">
                                            <Content>
                                                <telerik:RadEditor ID="txtMoreDescription" runat="server" >
                                                </telerik:RadEditor>
                                            </Content>
                                            <Listeners>
                                                <AfterRender Fn="UpdateSetting" Delay="500" />
                                            </Listeners>
                                        </ext:FieldSet>







Test Pyxis
Top achievements
Rank 1
 answered on 21 Aug 2015
1 answer
116 views

Hi there , I read many articles on ticker , some of them are Demo1 and ​ Demo2 , code is shown in aspx format how to get the same code in cshtml format .

I also tried only telerik tags in Razor views but still no working , I've installed tekerik trial version. does that make any difference
<telerik:RadTicker ID="RadTicker1" AutoStart="true" Width="300px">
    <items>
        <telerik:RadTickerItem runat="server" ID="RadTickerItem1" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
             consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
            cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.">
        </telerik:RadTickerItem>
    </items>
</telerik:RadTicker>

Helen
Telerik team
 answered on 21 Aug 2015
3 answers
102 views

Hi

I've got 3 RadHtmlCharts one below the other. The​y have different value range f.e. Chart1 from -9 to 5 and Chart2 from -100000 to + 100000. That causes the situation shown on picture, that they are placed not in line. I've already tried to adjust it in JS, but didn't manage to.

My code (I've tried many combinations):

var chart = $find("<%=timeChart.ClientID%>");

chart.get_kendoWidget()._plotArea.axisY.box.expand(50,50);

chart.get_kendoWidget()._plotArea.axisY.box.​pad(50);​

chart.get_kendoWidget()._plotArea.axisY.box.x2 = 150;

chart.repaint();

chart.get_kendoWidget().redraw();

chart.get_kendoWidget()​​.refresh();

 

None of this have worked.

I'm looking forward for your help

Greets,

Maciek

Stamo Gochev
Telerik team
 answered on 21 Aug 2015
1 answer
159 views

Hi,

I have a problem with RadDatePicker controls in Asp.Net.

I am dynamically creating 2 RadDatePicker controls at runtime and I want to apply CompareValidator to check if the 'From Date' is less than the 'To Date'. The controls are dynamically created so i have set the AutoPostBack = false. With that the controls are not throwing the validation if i choose the wrong dates.

The condition is:

Date Validation checks - From Date <= To date

Here is my code:

for (int j = 0; j < slistArray.Length; j++)
                {

int counter = 0;

int DateRangeFound = 0;

switch (QuestionType)
                            {

case "DateRange":
                                    if (QuestionName == "DateFrom")
                                    {
                                        RadDatePicker rdpDateFrom = new RadDatePicker();
                                        rdpDateFrom.CssClass = "form-control form-control-item";
                                        rdpDateFrom.ID = "rdpDateFrom" + j.ToString() + "-" + counter;
                                        rdpDateFrom.AutoPostBack = false;
                                        rdpDateFrom.DatePopupButton.Visible = true;
                                        rdpDateFrom.ShowPopupOnFocus = true;
                                        rdpDateFrom.EnableScreenBoundaryDetection = true;
                                        rdpDateFrom.MaxDate = DateTime.Now;

                                        txtC1.Controls.Add(rdpDateFrom);

                                        ++DateRangeFound;
                                    }
                                    else if (QuestionName == "DateTo")
                                    {
                                        RadDatePicker rdpDateTo = new RadDatePicker();
                                        rdpDateTo.CssClass = "form-control form-control-item";
                                        rdpDateTo.ID = "rdpDateTo" + j.ToString() + "-" + (counter - 1);
                                        rdpDateTo.AutoPostBack = false;
                                        rdpDateTo.DatePopupButton.Visible = true;
                                        rdpDateTo.ShowPopupOnFocus = true;
                                        rdpDateTo.EnableScreenBoundaryDetection = true;
                                        rdpDateTo.MaxDate = DateTime.Now;

                                        txtC1.Controls.Add(rdpDateTo);​

                                        ++DateRangeFound;
                                    }
                                    if (DateRangeFound > 1)
                                    {
                                        CompareValidator cvdpDate = new CompareValidator();
                                        cvdpDate.ID = "cvdpDate" + j.ToString() + "-" + counter;
                                        cvdpDate.ControlToCompare = "rdpDateFrom" + j.ToString() + "-" + (counter - 1);
                                        cvdpDate.ControlToValidate = "rdpDateTo" + j.ToString() + "-" + (counter - 1);
                                        cvdpDate.Operator = ValidationCompareOperator.GreaterThanEqual;
                                        cvdpDate.Type = ValidationDataType.Date;
                                        cvdpDate.Text = "*";
                                        cvdpDate.ForeColor = Color.Red;
                                        cvdpDate.ErrorMessage = "End date must be equal or greater than start date - please correct dates.";

                                        txtC1.Controls.Add(cvdpDate);

                                    }
                                    break;

}

panelBody.Controls.Add(txtC1);
                            counter++;

}

 

Any suggestions for the client side jquery validation will also be helpful. 

 

Thank you.

Viktor Tachev
Telerik team
 answered on 20 Aug 2015
1 answer
101 views

I am currently attempting to add custom nodes to the file explorer view, with the selection of the lowest level of each node displaying the contents of multiple listed directories (create nodes with custom names as their own 'custom trees' where the contents of the corresponding listview would include those of directory1 + 2 + 3 etc.) Here is what I have so far, and I am looking for the equivalent value of the 'viewpath' from the main fileexplorer object for each individual node. 

protected void BindDataTable()
    {
        RadTreeNode temp_node;
        DataTable node_template = CreateDirectoryTable();

        foreach (DataRow row in node_template.Rows)
        {
            temp_node = new RadTreeNode();
            temp_node.Text = (string)row[1];
            temp_node.Value = (string)row[2];

            FileExplorerBase.TreeView.Nodes.Add(temp_node);
        }
    }​

 Is it a simple property in the node object? Because I cannot seem to find it. Or is this functionality present in the treeview object directly?

Vessy
Telerik team
 answered on 20 Aug 2015
4 answers
455 views
I have a combo box and a button inside of a EditFormSettings \ FormTemplate.  In the Items_command event of the grid I trap the buitton click event and I'm tryiong to enable or disable it.

Here is the page code

<

 

telerik:RadGrid ID="RadGrid1" runat="server">

 

 

<HeaderContextMenu EnableTheming="True">

 

 

<CollapseAnimation Type="OutQuint" Duration="200">

 

 

</CollapseAnimation>

 

 

</HeaderContextMenu>

 

 

<MasterTableView CommandItemDisplay="Top" DataKeyNames="Contact_ID" Width="100%"

 

 

ExpandCollapseColumn-Display="true" HierarchyDefaultExpanded="false"

 

 

EditMode="EditForms" AllowPaging="True" PageSize="5">

 

 

<ItemTemplate>

 

 

<span lang="en-us">ITEM TEMPLATE</span>

 

 

</ItemTemplate>

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</ExpandCollapseColumn>

 

 

<EditFormSettings EditFormType="Template">

 

 

<FormTemplate>

 

 

<asp:DropDownList ID="cboCountry" runat="server" Enabled="false">

 

 

</asp:DropDownList>

 

 

<asp:Button runat="server" ID="butCountry" text="change" CausesValidation="False"

 

 

CommandName="ChangeCountry" />

 

 

<br />

 

 

<br />

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

<FilterMenu EnableTheming="True">

 

 

<CollapseAnimation Type="OutQuint" Duration="200">

 

 

</CollapseAnimation>

 

 

</FilterMenu>

 

 

</telerik:RadGrid>

 



and here is the Item_command event in the code behind


 

Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand

 

 


Dim
strCommand As String

 

strCommand = e.CommandName.ToUpper


Select

 

Case strCommand

 

 

    Case Is = "CHANGECOUNTRY"

 

 

       Dim editItem As GridDataItem = CType(e.Item, GridDataItem)

 

       Dim

 

ContactCombo As DropDownList = CType(editItem.FindControl("cboCountry"), DropDownList)

 

        ContactCombo.Enable = "True"

 

    End Select

 

 

End Sub

 


Why is it that I can't get a handle to the combo box ?

Any help would be great !
Viktor Tachev
Telerik team
 answered on 20 Aug 2015
5 answers
491 views

We have a rad grid.We are binding the grid using datatable and auto generated columns are true.

We want to add all the cell values and display the sum of all the cell values in other column when cell click.

we have tried with row selected event but the sum is not displaying properly when moving from one cell to other.

Please help us to fix the issue.

 

1.       We are
able to fetch the selected cell value but unable to fetch the remaining
corresponding cell values. You can find the same in the sample project
(BatchEdit.aspx – OnBatchEditCellValueChanged event)

 2.       We are
able to fetch the selected cell value and corresponding cell values in the same
row by hardcoding the column names, but dynamically we are unable to get the
values of the cell. You can find the same in the sample project
(OnRowSelected.aspx – OnRowSelected event)

we have used the following code

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

  <script type="text/javascript">
      function RowSelected(sender, eventArgs) {
          var grid = sender;
          var MasterTable = grid.get_masterTableView();
         
          var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
          var cell1 = MasterTable.getCellByColumnUniqueName(row, "Value1");
          var cell2 = MasterTable.getCellByColumnUniqueName(row, "Value2");
          var cell3 = MasterTable.getCellByColumnUniqueName(row, "Value3");
          var cell4 = MasterTable.getCellByColumnUniqueName(row, "Value4");
          var total = 0;
          var arr = [];
          var total = 0;
      
          var columnlength = grid.get_masterTableView().get_columns().length;
          for (i = 0 ; i < columnlength; i++) {
              cell = grid.get_masterTableView().get_columns()[i].get_uniqueName();
           
              var cell = MasterTable.getCellByColumnUniqueName(row, cell);
              var val = parseInt(cell.innerText);
              arr[i] = val;
             

          }
          for (i = 1; i < arr.length; i++) {

              total += arr[i];
          }

          var cell1 = MasterTable.getCellByColumnUniqueName(row, "Sum");
          cell1.innerText = total;
          cell1.eventArgs.set_cancel(true);


      }
    </script>
   <%-- var grid = $find("<%=RadGrid1.ClientID%>");
    var tableView = sender.get_masterTableView();
    var batchManager = sender.get_batchEditingManager();
    var items = tableView.get_dataItems();
    var mapValues = [];
    for (var i = 0; i < items.length; i++) {
        var mapCell = items[i].get_cell("Map");
        var mapValue = batchManager.getCellValue(mapCell);
        mapValues.push(mapValue);
    }--%>
</head>
<body>
    <form id="form1" runat="server">
         <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
         <asp:HiddenField ID="HiddenField1" runat="server" />
    <div>
    <telerik:RadGrid ID="RadGrid1" runat="server">
        <MasterTableView EditMode="Batch" BatchEditingSettings-EditType="Cell" >
        </MasterTableView>
        <ClientSettings>
            <Selecting AllowRowSelect="True" CellSelectionMode="MultiCell" />
            <ClientEvents OnRowClick="RowSelected" />
        </ClientSettings>
    </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

and code behind is

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class OnRowSelected : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GetValues();
    }
    private void GetValues()
    {
        DataTable dtTable = new DataTable();
        dtTable.Columns.Add("Sum");
        dtTable.Columns.Add("Value1"); dtTable.Columns.Add("Value2");
        dtTable.Columns.Add("Value3"); dtTable.Columns.Add("Value4");

        DataRow dr = dtTable.NewRow();
        dr["Sum"] = "";
        dr["Value1"] = "1"; dr["Value2"] = "2";
        dr["Value3"] = "3"; dr["Value4"] = "4";
        dtTable.Rows.Add(dr);

        DataRow drr = dtTable.NewRow();
        drr["Sum"] = "";
        drr["Value1"] = "5"; drr["Value2"] = "6";
        drr["Value3"] = "7"; drr["Value4"] = "8";
        dtTable.Rows.Add(drr);


        RadGrid1.DataSource = dtTable;
        RadGrid1.DataBind();

    }
}

Any other information please contact us.

Viktor Tachev
Telerik team
 answered on 20 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?