Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
385 views
Hi all,
I want customization the RadSchedule lock like attachment picture. Please help me.
Thanks
Rumen
Telerik team
 answered on 12 Jun 2019
1 answer
534 views

     I'm trying to display images on my gridimagecolumn without me having to upload it myself but instead it does it automatically when i load the grid. How do I do that? 

 

My template is => 

 <telerik:GridBinaryImageColumn  DataField="Profile" HeaderText="Profile" UniqueName="Upload" ImageHeight="60px" ImageWidth="60px" ResizeMode="Fit"></telerik:GridBinaryImageColumn>   

 

I haven't yet figure the code out on how to go about this...This is what I have so far.

protected void uxUsedGrid_InsertCommand(object source, GridCommandEventArgs e)
        {
            _InsertCommand(source, e);
        }
 
        private void _InsertCommand(object source, GridCommandEventArgs e)
        {
 
            GridEditFormInsertItem insertItem = e.Item as GridEditFormInsertItem;
            RadAsyncUpload radAsyncUpload = insertItem["Upload"].FindControl("AsyncUpload1") as RadAsyncUpload;
 
            UploadedFile file = radAsyncUpload.UploadedFiles[0];
            byte[] fileData = new byte[file.InputStream.Length];
            file.InputStream.Read(fileData, 0, (int)file.InputStream.Length);
 
            
        }
 
protected void AsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            long totalBytes = 0;
            int MaxTotalBytes = 1000000;
            if ((totalBytes < MaxTotalBytes) && (e.File.ContentLength < MaxTotalBytes))
            {
                e.IsValid = true;
                totalBytes += e.File.ContentLength;
                IsRadAsyncValid = true;
            }
            else
            {
                e.IsValid = false;
                IsRadAsyncValid = false;
            }
        }

 

I have look at this Demo and while it was helpful, it mostly focused on the client uploading the files and basing it off from that to upload the images. 

Any help is appreciated!

Eyup
Telerik team
 answered on 12 Jun 2019
5 answers
475 views

RadDatePicker inside UpdatePanel in Microsoft Edge browser throws JavaScript error when doing a post-back (see attached image).

The error: "Unable to get property 'length' of undefined or null reference".

Any ideas how to fix this, or a work-around?

 

Microsoft Edge 44.17763.1.0

Telerik Controls: Telerik.Web.UI, Version=2019.1.409.45

 

My Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EdgeDatePickerIssue.Default" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title>Default</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server" ScriptMode="Release" />
 
        <asp:UpdatePanel runat="server" ID="upPanel">
            <ContentTemplate>
                <label>Select Date:</label>
                <telerik:RadDatePicker ID="dpStartDate" runat="server"
                    MaxDate="2020-01-01" MinDate="2000-01-01"
                    AutoPostBack="true" OnSelectedDateChanged="dpStartDate_SelectedDateChanged" />
 
                <telerik:RadButton ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>

 

 

Rumen
Telerik team
 answered on 12 Jun 2019
3 answers
218 views

https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/excel-export-multiple-grids/defaultcs.aspx?product=grid

 

Just now,i copy the source code(only aspx  and aspx.cs) from this demo,but can not run.

 

My question is :

       Can I download the all the source code (include dll and others) about this demo?

Vessy
Telerik team
 answered on 12 Jun 2019
8 answers
776 views
Hi. it is my primer tuto post.
Topic: how use RadConfirm() function in a button (or another control with similar ClientEvents) without make a full postback (just it is different to use confirm javascript function).

scenario:
Asp.net framework 4, RadControls for asp.net 2011 Q2, c# development

Steps.
1.    Add this controls to you aspx file.
    RadScriptManager
    RadAjaxManager
    RadWindowManager
    RadButton
    Another controls that satisfy your needs.
2.    Set ajax manager to your fits, for example set radbutton as fire control and a image control as updated control
3.    Set onClientClicked event of your radbutton as: 'CheckItem'
4.    Set CommandName argument as 'btnShowImage' (or of you preference, this must identify unique control)
<telerik:RadButton ID="btnShowImage" runat="server" Text="Show Image"
OnClick="btnShowImage_Click" CommandName="btnShowImage"
onclientclicked="CheckItem">
</telerik:RadButton>

5.    include next javascript code in your aspx file.
function CheckItem(sender, e) {
    if (sender._commandName == "btnShowImage") {
        RadConfirm("¿are sure?", btnShowImageResume, 330, 100, null, "Confirm.");
        sender.set_autoPostBack(false);
    }
    else {
        sender.set_autoPostBack(true);
    }
}
 
function btnShowImageResume(arg) {
    if (arg) {
        __doPostBack("btnShowImage", "onclick");
    }
}

Explain: btnShowImage is a button which when pressed displays the image in an image field (or your explicit need). this button must have some postback event for this example 'onclick' event (behind code). when user clicks on the radbutton fires client side event 'CheckItem' if command name parameter match with button then function call RadConfirm method: "RadConfirm(confirm message, javascript function that be executed after user take a decision, width, height, objet reference, message tittle);"
After, javascript cancel objet postback (preventing that compiler continues with onclick event code.) else continues with postback.
When user takes a decision RadConfirm call resume function in this example:'btnShowImageResume' function, this function validate if arg parameter (result) is true then executes onclick event of the control else does not do nothing (you can execute another event if you want). when we call to _dopostback javascript function, RadAjaxManager evalues situation and execute its.

I hope they will be of great help.
Marin Bratanov
Telerik team
 answered on 11 Jun 2019
6 answers
1.6K+ views
Hi 

Is it possible for the RadDateTimePicker to display and select the hours and minutes separately?
Marin Bratanov
Telerik team
 answered on 11 Jun 2019
6 answers
1.0K+ views
I cannot see to figure out how to force a RadComboBox to requery for its list of items client-side.

One solution I tried was to surround the RadComboBox with a RadAjaxPanel (by the way when I do that the VS parser claims that RadComoBox is not a known element even though the solution compiles and runs fine.). In addition, I wired up the ItemsRequested event to populate the control. Then on the client side I call something like:
var combo = $find("<%=this.MySpiffyCombo.ClientID %>"); 
combo.requestItems(); 
 

Another solution I tried was to use RadAjaxManager (which would be my preferred choice) where the AjaxControlID on the AjaxSetting and its only AjaxUpdatedControl item's ControlID are both set to the RadComboBox. Then on the client I tried:
var ajaxManager= $find("<%=this.RadAjaxManager1.ClientID %>"); 
ajaxManager.ajaxRequest("foo"); 

Which did not fire on the server. Then I tried:
var ajaxManager = $find("<%=this.RadAjaxManager1.ClientID %>"); 
ajaxManager.ajaxRequestWithTarget("<%=this.MySpiffyCombo.UniqueID %", "");  

I also tried wiring up the AjaxRequest event on the RadAjaxManager and again it did not fire.

What am I missing here? What is the Hoyle technique for ajax-ifying a RadComboBox and forcing a ajax refresh of its items?

jroughgarden
Top achievements
Rank 1
 answered on 10 Jun 2019
7 answers
1.0K+ views

I have a radhtmlchart using BarSeries with one data series.  The data is sourced from a linq query, not generated directly in codebehind like the demo for colorizing bars shows.  What I would like to do is colorize the bars depending on a second value in the results of the query.

The top of the chart code is straightforward.  I'm leaving out non-relevant code but let me know if there's something else you need to see.

            <telerik:RadHtmlChart ID="BarChart1" runat="server">
                <PlotArea>
                    <Series>
                        <telerik:BarSeries DataFieldY="DailyGrossQty" Name="Daily Gross Qty" Visible="true" Stacked="false" gap=".4" spacing="0.4">
                            <Appearance>
                                <FillStyle BackgroundColor="#145e8e"></FillStyle>
                            </Appearance>
                        </telerik:BarSeries>

 

The linq query is also straightforward:

            var x = from Z in db.spDailyData(ReportDate)
                    select Z;

           BarChart1.DataSource = x.OrderByDescending(o => o.DailyGrossQty).Take(25);

There is another field in the stored procedure called 'Division' and I would like to conditionally color the bars based on the value there, overriding the default.

What would be the simplest approach to that?

Thanks.

-Dan

 

 

Vessy
Telerik team
 answered on 10 Jun 2019
3 answers
327 views
Hey guys,

I am using LoadOnDemand throughout this app in all my RadComboBox instances... Here is an example...

 

<telerik:RadComboBox ID="rcProject" Runat="server" AllowCustomText="false"

 

 

 

AutoPostBack="True" EmptyMessage="Type a Project Name"

 

 

 

EnableLoadOnDemand="True" EnableVirtualScrolling="True" Filter="StartsWith"

 

 

 

Height="22px" MaxHeight="200px" OnItemsRequested="rcProject_ItemsRequested"

 

 

 

ShowMoreResultsBox="true"

 

 

 

ToolTip="You can type or scroll and select. What you type, must exist in the list"

 

 

 

Width="200px">

 

 

 

</telerik:RadComboBox>

 

 


My issue is that once a value is selected in this combobox, once the user clicks on the combobox to select another item... the previously selected item is the only thing showing up in the list... because of the item selected is a match...

I have tried to clear the text, value of the combobox in the rcProject_ItemsRequested event handler but not able to get it to clear... The text is still there. Could you help me with a client side workaround? I have seen some other posts but unable to implement anything, I keep getting Object is null...

Thanks much,

Sergiu Pascutiu
Dave
Top achievements
Rank 1
 answered on 07 Jun 2019
1 answer
147 views

In the Radscheduler I have the grid divided every 30 minutes. but if for example I have a 2-hour appointment, it fills the slot with a single appointment. How do I leave the 30-minute split even when entering long appointments?

 

Peter Milchev
Telerik team
 answered on 07 Jun 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?