Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
163 views

I try to use Telerik.Web.UI -> RadHtmlChart and RangeBarSeries to implement chart as in attachment.

I have problem with FromField and ToField. This fields have DECIMAL type but i need DATETIME type.
Also i need to create "stacked" chart: all series located in the same column for specific category

If i used kendo i gain what i want (found in Your example) as below.
Can You help me achieve this in HtmlChart?

<script>

var data = [{

id: 1,

line: "Line1",

from: new Date("2014/01/01 11:30").getTime(),

to: new Date("2014/01/01 14:45").getTime(),

valueColor: "red"

}, {

id: 2,

line: "Line2",

from: new Date("2014/01/01 09:30").getTime(),

to: new Date("2014/01/01 09:45").getTime(),

valueColor: "green"

}, {

id: 3,

line: "Line2",

from: new Date("2014/01/01 09:45").getTime(),

to: new Date("2014/01/01 10:00").getTime(),

valueColor: "blue"

}, {

id: 4,

line: "Line2",

from: new Date("2014/01/01 10:00").getTime(),

to: new Date("2014/01/01 10:15").getTime(),

valueColor: "red"

}, {

id: 5,

line: "Line2",

from: new Date("2014/01/01 10:15").getTime(),

to: new Date("2014/01/01 14:00").getTime(),

valueColor: "green"

}, {

id: 6,

line: "Line2",

from: new Date("2014/01/01 15:15").getTime(),

to: new Date("2014/01/01 15:30").getTime(),

valueColor: "red"

}, {

id: 7,

line: "Line2",

from: new Date("2014/01/01 15:45").getTime(),

to: new Date("2014/01/01 16:00").getTime(),

valueColor: "red"

}];

$("#chart").kendoChart(

{

dataSource:

{

data: SqlDataSource1,

group: {

field: "id",

dir: "desc"

}

},

series:

[{

type: "rangeBar",

gap: 0.1,

fromField: "from",

toField: "to",

categoryField: "line",

spacing: -1,

colorField: "valueColor",

name: "Category: #: group.items[0].field #"

}],

valueAxis:

{

min: new Date("2014/01/01 08:00").getTime(),

max: new Date("2014/01/01 17:00").getTime(),

majorUnit: 60 * 60 * 1000, // 60 minutes in milliseconds

labels: {

template: "#= kendo.toString(new Date(value), 'HH:mm') #"

}

},

legend:

{

visible: true

}

});

</script>

I try to use Telerik.Web.UI -> RadHtmlChart and RangeBarSeries to implement chart as in attachment.
 
I have problem with FromField and ToField. This fields have DECIMAL type but i need DATETIME type.
Also i need to create "stacked" chart: all series located in the same column for specific category
 
If i used kendo i gain what i want (found in Your example) as below.
Can You help me achieve this in HtmlChart?
 

<script>

var data = [{

id: 1,

line: "Line1",

from: new Date("2014/01/01 11:30").getTime(),

to: new Date("2014/01/01 14:45").getTime(),

valueColor: "red"

}, {

id: 2,

line: "Line2",

from: new Date("2014/01/01 09:30").getTime(),

to: new Date("2014/01/01 09:45").getTime(),

valueColor: "green"

}, {

id: 3,

line: "Line2",

from: new Date("2014/01/01 09:45").getTime(),

to: new Date("2014/01/01 10:00").getTime(),

valueColor: "blue"

}, {

id: 4,

line: "Line2",

from: new Date("2014/01/01 10:00").getTime(),

to: new Date("2014/01/01 10:15").getTime(),

valueColor: "red"

}, {

id: 5,

line: "Line2",

from: new Date("2014/01/01 10:15").getTime(),

to: new Date("2014/01/01 14:00").getTime(),

valueColor: "green"

}, {

id: 6,

line: "Line2",

from: new Date("2014/01/01 15:15").getTime(),

to: new Date("2014/01/01 15:30").getTime(),

valueColor: "red"

}, {

id: 7,

line: "Line2",

from: new Date("2014/01/01 15:45").getTime(),

to: new Date("2014/01/01 16:00").getTime(),

valueColor: "red"

}];

$("#chart").kendoChart(

{

dataSource:

{

data: SqlDataSource1,

group: {

field: "id",

dir: "desc"

}

},

series:

[{

type: "rangeBar",

gap: 0.1,

fromField: "from",

toField: "to",

categoryField: "line",

spacing: -1,

colorField: "valueColor",

name: "Category: #: group.items[0].field #"

}],

valueAxis:

{

min: new Date("2014/01/01 08:00").getTime(),

max: new Date("2014/01/01 17:00").getTime(),

majorUnit: 60 * 60 * 1000, // 60 minutes in milliseconds

labels: {

template: "#= kendo.toString(new Date(value), 'HH:mm') #"

}

},

legend:

{

visible: true

}

});

</script>

I try to use Telerik.Web.UI -> RadHtmlChart and RangeBarSeries to implement chart as in attachment.
 
I have problem with FromField and ToField. This fields have DECIMAL type but i need DATETIME type.
Also i need to create "stacked" chart: all series located in the same column for specific category
 
If i used kendo i gain what i want (found in Your example) as below.
Can You help me achieve this in HtmlChart?
 

<script>

var data = [{

id: 1,

line: "Line1",

from: new Date("2014/01/01 11:30").getTime(),

to: new Date("2014/01/01 14:45").getTime(),

valueColor: "red"

}, {

id: 2,

line: "Line2",

from: new Date("2014/01/01 09:30").getTime(),

to: new Date("2014/01/01 09:45").getTime(),

valueColor: "green"

}, {

id: 3,

line: "Line2",

from: new Date("2014/01/01 09:45").getTime(),

to: new Date("2014/01/01 10:00").getTime(),

valueColor: "blue"

}, {

id: 4,

line: "Line2",

from: new Date("2014/01/01 10:00").getTime(),

to: new Date("2014/01/01 10:15").getTime(),

valueColor: "red"

}, {

id: 5,

line: "Line2",

from: new Date("2014/01/01 10:15").getTime(),

to: new Date("2014/01/01 14:00").getTime(),

valueColor: "green"

}, {

id: 6,

line: "Line2",

from: new Date("2014/01/01 15:15").getTime(),

to: new Date("2014/01/01 15:30").getTime(),

valueColor: "red"

}, {

id: 7,

line: "Line2",

from: new Date("2014/01/01 15:45").getTime(),

to: new Date("2014/01/01 16:00").getTime(),

valueColor: "red"

}];

$("#chart").kendoChart(

{

dataSource:

{

data: SqlDataSource1,

group: {

field: "id",

dir: "desc"

}

},

series:

[{

type: "rangeBar",

gap: 0.1,

fromField: "from",

toField: "to",

categoryField: "line",

spacing: -1,

colorField: "valueColor",

name: "Category: #: group.items[0].field #"

}],

valueAxis:

{

min: new Date("2014/01/01 08:00").getTime(),

max: new Date("2014/01/01 17:00").getTime(),

majorUnit: 60 * 60 * 1000, // 60 minutes in milliseconds

labels: {

template: "#= kendo.toString(new Date(value), 'HH:mm') #"

}

},

legend:

{

visible: true

}

});

</script>

Danail Vasilev
Telerik team
 answered on 21 Aug 2015
18 answers
1.1K+ views
Okay, I've read and tried every approach on the forums about this (I think), so I PROMISE you this is my exhausted efforts causing me to post a probably pretty tired topic.

Pretty simple: I have a page that is in a masterpage (not sure if thats important) with a link on it that opens a radwindow (I will put the code out below). That opens just fine. The page in the radwindow is a simple data-entry page, upon where I hit the "Save" button, it saves to the database, then closes the radwindow on postback. In the same radwindow, theres a cancel button that only calls the javascript to close the radwindow, and that works just fine. The code-behind that is supposed to close the window on postback just calls the same function that WORKS for the cancel button; the page posts back and the window re-opens, except its NOT modal (the initial window is modal) so the background is not greyed out, and its also twice the width it once was. Once the window has wrongfully reopened, the cancel button no longer works, and the save button just keeps posting back without closing.

I've already tried double-checking that the javascript is firing on postback by putting in alerts.

The link that opens the radwindow:
<asp:LinkButton ID="lbAddPhone" runat="server" onclientclick="javascript:InsertPhone(); return false;">+ Phone/Email</asp:LinkButton> 


InsertPhone()
function InsertPhone() { 
        var hid = document.getElementById("<%= hidContactId.ClientID %>"); 
        var oWnd = $find("<%= wndAddPhone.ClientID %>"); 
        oWnd.setUrl("popup_addcontact.aspx?which=3&id=" + hid.value); 
        oWnd.show(); 
    } 

Now for the popup_addcontact.aspx page:
protected void btnPhoneSave_Click(object sender, EventArgs e) 
    { 
        string closingscript = "closeWin();"
        ScriptManager.RegisterStartupScript(thisthis.GetType(), "closeWin", closingscript, true); 
    } 

closeWin()
function closeWin() { 
            var wind = GetRadWindow(); 
            wind.close(); 
        } 
 
function GetRadWindow() { 
            var oWindow = null
             
            if (window.radWindow) { 
                oWindow = window.radWindow; 
            } 
            else if (window.frameElement.radWindow) { 
                oWindow = window.frameElement.radWindow; 
            } 
             
            return oWindow; 
        } 

If anyone has any insight, I'd greatly appreciate it. Like I said, I have confirmed that the javascript IS firing, and I have tried several different methods of code-behind injection, including putting a literal control on the host page.

Thanks!
Stamo Gochev
Telerik team
 answered on 21 Aug 2015
2 answers
129 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
87 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
330 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
128 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
115 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
99 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
150 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
99 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?