Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
388 views
while page loading, "RadAsyncUpload " control not rendering properly for millisecond. it is not applying metrotouch css to file upload contorl for millisecond.
following are the code information
     <telerik:RadAsyncUpload ID="MyFile1" runat="server" MultipleFileSelection="Disabled" Skin="MetroTouch" EnableViewState="true" MaxFileInputsCount="1" 
                                PostbackTriggers="rdbAccreditationCertificateYes,rdbAccreditationCertificateNo,rdbFirewallYes,rdbFirewallNo,rdbIRSYes,rdbIRSNo,rdbYes,rdbNo,Lnkproceed,LnkAddRow,lnkDelete,btnRemove,lnkBack,LnkSaveContinue">
                                <Localization Select="Browse" />
                            </telerik:RadAsyncUpload>

Please refer attached file
anup
Top achievements
Rank 1
 answered on 13 Mar 2019
5 answers
365 views
Hello,
I try to change values of a cell in a radGrid before exporting the grid to Excel as shown below. For testing purpose I set the value to "123". After exporting, Excel does not show "123" at all. Why is that? I try to Rebind() before exporting and it doesn't work either.

Private Sub exp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exp.Click
       For Each rowItem As GridDataItem In RadGrid1.Items
            rowItem ("E").Text = "123"
        Next
       RadGrid1.MasterTableView.ExportToExcel()
End Sub
Geoff
Top achievements
Rank 1
 answered on 12 Mar 2019
3 answers
186 views

When I select a row in the RadGrid, a FormView is populated with the details.  But when I update the data in the FormView, the data is updated in the RadGrid, but the FormView is no longer visible.  I'm guessing because the row selection is lost, even though the selected row remains highlighted due to the js I'm using.  How can I fix this issue?  I just want the row selection on the RadGrid to remain even after I update, insert, or delete data from the FormView, so that the FormView remains visible.

Here's the RadGrid:

<telerik:RadGrid runat="server" ID="rgVendors" DataSourceID="sdsRgVendors" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" ShowGroupPanel="True" OnSelectedIndexChanged="rgVendors_OnSelectedIndexChanged">
                <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="True">
                    <Selecting AllowRowSelect="True"></Selecting>
                    <ClientEvents OnRowCreated="rgVendors_RowCreated" OnRowSelected="rgVendors_RowSelected" OnRowDeselected="rgVendors_RowDeselected" />
                </ClientSettings>
                <MasterTableView ClientDataKeyNames="venIdPk" DataKeyNames="venIdPk" DataSourceID="sdsRgVendors">
                    <Columns>
                        <telerik:GridBoundColumn DataField="venIdPk" ReadOnly="True" HeaderText="venIdPk" SortExpression="venIdPk" UniqueName="venIdPk" DataType="System.Int32" FilterControlAltText="Filter venIdPk column"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="venNm" HeaderText="Vendor" SortExpression="venNm" UniqueName="venNm" FilterControlAltText="Filter venNm column" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="venAddress" HeaderText="Address" SortExpression="venAddress" UniqueName="venAddress" FilterControlAltText="Filter venAddress column" ReadOnly="True" AllowFiltering="False" AllowSorting="False" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="venCity" HeaderText="City" SortExpression="venCity" UniqueName="venCity" FilterControlAltText="Filter venCity column" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="stateProvAcro" HeaderText="State/Province" SortExpression="stateProvAcro" UniqueName="stateProvAcro" FilterControlAltText="Filter stateProvAcro column" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="venZipCode" HeaderText="Zip Code" SortExpression="venZipCode" UniqueName="venZipCode" FilterControlAltText="Filter venZipCode column" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="venPh" HeaderText="Phone" SortExpression="venPh" UniqueName="venPh" FilterControlAltText="Filter venPh column" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                        <telerik:GridCheckBoxColumn DataField="venActive" HeaderText="Active" SortExpression="venActive" UniqueName="venActive" DataType="System.Boolean" FilterControlAltText="Filter venActive column" AllowFiltering="False" AllowSorting="False" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="True" ItemStyle-HorizontalAlign="Center"></telerik:GridCheckBoxColumn>
                    </Columns>
                </MasterTableView>
                <AlternatingItemStyle BackColor="#DCDCDC"></AlternatingItemStyle>
            </telerik:RadGrid>

Here's part of the FormView:

<asp:FormView
    runat="server"
    ID="fvVenDets"
    DataKeyNames="venIdPk"
    DataSourceID="sdsFvVenDets"
    OnItemCommand="fvVenDets_OnItemCommand"
    OnItemUpdated="fvVenDets_OnItemUpdated"
    OnItemInserted="fvVenDets_OnItemInserted"
    OnItemDeleted="fvVenDets_OnItemDeleted">
 
    <ItemTemplate>...</ItemTemplate>
    <EditItemTemplate>...</EditItemTemplate>
    <InsertItemTemplate>...</InsertItemTemplate>
 
</asp:FormView>

Here's the js to maintain the row selection:

<script type="text/javascript">
                var selected = {};
 
                function rgVendors_RowSelected(sender, args) {
                    var venid = args.getDataKeyValue("venIdPk");
                    if (!selected[venid]) {
                        selected[venid] = true;
                    }
                }
                function rgVendors_RowDeselected(sender, args) {
                    var venid = args.getDataKeyValue("venIdPk");
                    if (selected[venid]) {
                        selected[venid] = null;
                    }
                }
                function rgVendors_RowCreated(sender, args) {
                    var venid = args.getDataKeyValue("venIdPk");
                    if (selected[venid]) {
                        args.get_gridDataItem().set_selected(true);
                    }
                }   
            </script>
Attila Antal
Telerik team
 answered on 12 Mar 2019
1 answer
547 views

I want the user to choose the desired chart type (bar or line).  In my code I am generating the chart and the only difference is in either creating the series with a ColumnSeries or a LineSeries. How do I declare the variable cs to use either type.

I tried defining cs as an Object but then to use it with the properties it needs to be casted but the type could be either.

 

if (RadComboBoxChartType.SelectedValue=="Bar")
   cs = new ColumnSeries();
else
   cs = new LineSeries();
 
cs.Name = row["Description"].ToString();
cs.Appearance.FillStyle.BackgroundColor = generator.NextColor();
cs.TooltipsAppearance.ClientTemplate = "#= series.name# : #= dataItem.value#";
cs.LabelsAppearance.Visible = false;
RadHtmlChartDashboard.PlotArea.Series.Add(cs);

 

 

Vessy
Telerik team
 answered on 12 Mar 2019
10 answers
344 views
I would like to replace the standard RadMenu mobile button icon (the three bars from RenderMode="mobile") with a custom image.

Is this possible?
Peter Milchev
Telerik team
 answered on 12 Mar 2019
1 answer
751 views

Hello,

 

I am having trouble in increasing the size of the button. I did change the height and color options in the css file but it does nto change. I attached a image to this email which shows the button. How can i increase the size of this button?

 

<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" AllowedFileExtensions="pdf,jpg,jpeg,txt"
                                       MultipleFileSelection="Automatic"  CssClass="wizInternalLabels" dir="rtl"
                                       PostbackTriggers="btnCustomFinish"  >
                                       <Localization Select=" Select a document to upload "   />
                                        
                                   </telerik:RadAsyncUpload>

 

.ruButton.ruBrowse
{
min-width:500px;
font-size:18px;
    color:Red;
font-weight:bold;
height:100px;
}

 

.wizInternalLabels
{
color:#00008B;
font-size:x-large;
height:200px;
}

 

 

Thanks in Advance

Peter Milchev
Telerik team
 answered on 12 Mar 2019
7 answers
375 views

In my database I have a column called "Current_Due" which is set as a numeric datatype (Oracle).  When I autogenerate my grid, the column is being typed as a GridBoundColumn instead of a GridNumericColumn. 

1.)  Do I need to change something to have it bind as a different column type?

2.)  In my RadGrid1_ColumnCreated event, I try to cast it as a GridNumericColumn and get an error.  Anyone know how to cast as a different column type?  I'm doing - GridNumericColumn numericColumn = e.Column as GridNumericColumn;

 

 

Eyup
Telerik team
 answered on 12 Mar 2019
3 answers
692 views

Hi,

I have a RadGrid with filters. The FilterType is "HeaderContext".
I have restricted the filter options contained in the drop down list according to the field type.
For example, for a numeric field, I use options "GreaterThan", "LessThan"  etc. For a string, I use options "Contains", "StartsWith" etc.

To achieve this, I use the following:

<ClientSettings>
                    <Scrolling AllowScroll="false" />
                    <ClientEvents OnFilterMenuShowing="FilterMenuShowing" />
                </ClientSettings>
                <FilterMenu EnableImageSprites="False" OnClientShowing="MenuShowing" />

However, these events are not invoked when the value RadGrid's FilterType is "HeaderContext".
This means that for each data type, the filter option drop down list contains all options, many of which are irrelavant.

Please can you offer some assistance that will enable me to restrict the filter options contained in the DropDownList where the FilterType of the RadGrid is "HeaderContext".

 

Thanks,

 

Rob

Attila Antal
Telerik team
 answered on 12 Mar 2019
2 answers
193 views
Hello,

I've sound some other discussions in the forum on not posting back with a client search, but, I'd like it to leave the drop down open. This happens if the client search function throws an error, so I feel like there should be a way to tell it to cancel and not close the results box. Here's what I have right now:

function txtAutoSearch_Search(sender, args) {
    if (args.get_value() == null) {
        sender._element.control._postBackOnSearch = false;
    } else {
        sender._element.control._postBackOnSearch = true;
    }
}

This actually works very nicely as a way to make it so that, if they haven't selected a result, it won't post back. But, when people hit "enter", the results still close, and that confuses some folks. Is there a way to safely cancel the post and leave the box open? Basically, some line I could add after the "_postBackOnSearch = false;" bit?

Thanks,

Mike

Kasim
Top achievements
Rank 2
 answered on 12 Mar 2019
0 answers
247 views

I am trying to prevent users from creating overlapping events in our calendar.  I was able to implement this somewhat successfully using the demo at https://demos.telerik.com/aspnet-ajax/scheduler/examples/limitconcurrentappointments/defaultvb.aspx.  I am having an issue though due to the fact that we use a customized Advanced Form template for our events.  On insert or update, I can use the ExceedsLimit() function to cancel the insert or update, but the Advanced Form is cleared out and loses all of the information the user has entered.  Ideally we would present the user with an error message and allow them to fix the data rather than having to enter it all over from scratch.  Is this possible?

I updated the Advanced Insert and Edit Forms demo located at https://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultvb.aspx to demonstrate the issue.

DefaultVB.aspx

<%@ Page Language="vb" AutoEventWireup="true" Inherits="Scheduler.Examples.AdvancedFormTemplate.DefaultVB"
    CodeFile="DefaultVB.aspx.vb" MasterPageFile="~/MasterPageCDNDisabled.master" %>
 
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="scheduler" TagName="AdvancedForm" Src="AdvancedFormCS.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link rel="Stylesheet" type="text/css" href="styles.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceholder1" runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
        <script type="text/javascript" src="scripts.js"></script>
    </telerik:RadScriptBlock>
    <telerik:RadNotification runat="server" ID="RadNotification1" Title="Error" TitleIcon="warning" ContentIcon="warning"
        Position="Center" Width="430px" Height="200px" AutoCloseDelay="10000" ShowSound="warning" Font-Size="Large">
        <NotificationMenu Visible="false"></NotificationMenu>
    </telerik:RadNotification>
    <div class="demo-container no-bg">
        <telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1"
            SelectedDate="2012-04-16"
            OnDataBound="RadScheduler1_DataBound"
            OnAppointmentCreated="RadScheduler1_AppointmentCreated"
            OnAppointmentInsert="RadScheduler1_AppointmentInsert"
            OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
            OnClientFormCreated="schedulerFormCreated"
            CustomAttributeNames="AppointmentColor"
            EnableDescriptionField="true">
            <AdvancedForm Modal="true" EnableTimeZonesEditing="true" />
            <Reminders Enabled="true" />
            <AppointmentTemplate>
                <div class="rsAptSubject">
                    <%# Eval("Subject") %>
                </div>
                <%# Eval("Description") %>
            </AppointmentTemplate>
            <AdvancedEditTemplate>
                <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit"
                    Subject='<%# Bind("Subject") %>'
                    Description='<%# Bind("Description") %>'
                    Start='<%# Bind("Start") %>'
                    End='<%# Bind("End") %>'
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
                    Reminder='<%# Bind("Reminder") %>'
                    AppointmentColor='<%# Bind("AppointmentColor") %>'
                    UserID='<%# Bind("User") %>'
                    RoomID='<%# Bind("Room") %>'
                    TimeZoneID='<%# Bind("TimeZoneID") %>' />
            </AdvancedEditTemplate>
            <AdvancedInsertTemplate>
                <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert"
                    Subject='<%# Bind("Subject") %>'
                    Start='<%# Bind("Start") %>'
                    End='<%# Bind("End") %>'
                    Description='<%# Bind("Description") %>'
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
                    Reminder='<%# Bind("Reminder") %>'
                    AppointmentColor='<%# Bind("AppointmentColor") %>'
                    UserID='<%# Bind("User") %>'
                    RoomID='<%# Bind("Room") %>'
                    TimeZoneID='<%# Bind("TimeZoneID") %>' />
            </AdvancedInsertTemplate>
            <TimelineView UserSelectable="false" />
            <TimeSlotContextMenuSettings EnableDefault="true" />
            <AppointmentContextMenuSettings EnableDefault="true" />
        </telerik:RadScheduler>
    </div>
 
</asp:Content>

 

DefaultVB.aspx.vb

Imports System
Imports System.Web.UI
Imports System.Drawing
Imports System.Web.UI.WebControls
 
Imports Telerik.Web.UI
 
Namespace Scheduler.Examples.AdvancedFormTemplate
    Public Class DefaultVB
        Inherits System.Web.UI.Page
 
        Private Const ProviderSessionKey As String = "Telerik.Web.Examples.Scheduler.AdvancedFormTemplate.DefaultVB"
 
        ' You can safely ignore this method.
        ' Its purpose is to limit the changes to the underlying data only to the active user session.
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
 
            Dim manager As ScriptManager = RadScriptManager.GetCurrent(Page)
            manager.Scripts.Add(New ScriptReference(ResolveUrl("AdvancedForm.js")))
 
            Dim provider As XmlSchedulerProvider
            If ((Session(ProviderSessionKey) Is Nothing) _
               OrElse Not IsPostBack) Then
                provider = New XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments_CustomTemplates.xml"), False)
                Session(ProviderSessionKey) = provider
            Else
                provider = CType(Session(ProviderSessionKey), XmlSchedulerProvider)
            End If
            RadScheduler1.Provider = provider
        End Sub
 
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            RadScheduler1.TimeZoneID = "Pacific Standard Time"
        End Sub
 
        Protected Sub RadScheduler1_DataBound(ByVal sender As Object, ByVal e As EventArgs)
            RadScheduler1.ResourceTypes.FindByName("User").AllowMultipleValues = True
            RadScheduler1.ResourceTypes.FindByName("Room").AllowMultipleValues = False
        End Sub
 
        Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As Object, ByVal e As AppointmentCreatedEventArgs)
            If e.Appointment.RecurrenceState = RecurrenceState.Master OrElse e.Appointment.RecurrenceState = RecurrenceState.Occurrence Then
                Dim recurrenceStateDiv As New Label()
                recurrenceStateDiv.CssClass = "rsAptRecurrence"
                Dim recurrenceStateIcon As New Label()
                recurrenceStateIcon.CssClass = "t-font-icon t-i-recurrence"
                recurrenceStateDiv.Controls.Add(recurrenceStateIcon)
                e.Container.Controls.AddAt(0, recurrenceStateDiv)
            End If
            If e.Appointment.RecurrenceState = RecurrenceState.Exception Then
                Dim recurrenceStateDiv As New Label()
                recurrenceStateDiv.CssClass = "rsAptRecurrenceException"
                Dim recurrenceStateIcon As New Label()
                recurrenceStateIcon.CssClass = "t-font-icon t-i-recurrence-exception"
                recurrenceStateDiv.Controls.Add(recurrenceStateIcon)
                e.Container.Controls.AddAt(0, recurrenceStateDiv)
            End If
        End Sub
 
        Protected Sub RadScheduler1_AppointmentDataBound(ByVal sender As Object, ByVal e As SchedulerEventArgs)
            Dim colorAttribute As String = e.Appointment.Attributes("AppointmentColor")
            If Not String.IsNullOrEmpty(colorAttribute) Then
                Dim colorValue As Integer
                If Integer.TryParse(colorAttribute, colorValue) Then
                    Dim borderColorValue As Integer = CInt(If(colorValue < -&H7F7F7F, colorValue + &H202020, colorValue - &H202020))
                    e.Appointment.BackColor = Color.FromArgb(colorValue)
                    e.Appointment.BorderColor = Color.FromArgb(borderColorValue)
                End If
            End If
            e.Appointment.ToolTip = e.Appointment.Subject + ": " + e.Appointment.Description
        End Sub
 
        Protected Sub RadScheduler1_AppointmentInsert(sender As Object, e As SchedulerCancelEventArgs)
            If ExceedsLimit(e.Appointment) Then
                e.Cancel = True
                RadNotification1.Show("Cannot add appointment! There are too many appointments in this time slot. You can only have " & AppointmentsLimit)
            End If
        End Sub
 
        Private Const AppointmentsLimit As Integer = 1
 
        Private Function ExceedsLimit(apt As Appointment) As Boolean
            Dim appointmentsCount As Integer = 0
            For Each existingApt As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(apt.Start, apt.[End])
                If existingApt.Visible Then
                    appointmentsCount += 1
                End If
            Next
 
            Return (appointmentsCount > AppointmentsLimit - 1)
        End Function
    End Class
End Namespace
Michael
Top achievements
Rank 1
 asked on 11 Mar 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?