Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
66 views
I added context menu to a page on my website, and added EnableHeaderContextMenu="true" to my parameters. But when I right click on the grid, the menu does not show any sorting options. I have this same MasterTableView on another page in the site, and it works fine. The two look the same.

<MasterTableView Width="100%" TableLayout="Auto" NoMasterRecordsText="No Items Found"
    AllowAutomaticInserts="false" AllowMultiColumnSorting="false" AutoGenerateColumns="false" EnableHeaderContextMenu="true"
    AllowPaging="true" PageSize="20" AllowSorting="true" DataKeyNames="OrderID"
    CommandItemSettings-RefreshText="Refresh List" CommandItemDisplay="Top" PagerStyle-Position="TopAndBottom"
    CommandItemSettings-ShowAddNewRecordButton="false">

The only functional difference on this page is that the grid is not initially loaded with data. It is a search page. However, even once a search is performed and data is in the grid, there are no sort options.

Any ideas?
Rayne
Top achievements
Rank 1
 answered on 08 Mar 2018
4 answers
1.7K+ views

when using the radasyncupload in a scenario that you have several steps to complete until the final save can be done AND the upload of the file is not in the final step, you may find yourself in the situation that either you check the file in code behind (and force the postback trigger) or you postpone to the end when really processing the file to check if it's OK. 

First option has a drawback that you get the file info in your code behind but at the next postback you have nothing left as the radasyncupload looses its information. Second option has the drawback that you come with comment on missing file or other file problem in a step that does not correspond with the step they uploaded the file.

How to come over this????

Solution: just add a radtextbox (readonly) to your form below the radasyncupload. On client upload you set the value of that textbox. You have a regular required field validator linked to the textbox. If the upload is successful and valid you set the textbox with the filename and the validator passes. If the file upload is not done or invalid the textbox keeps or gets an  empty string. The validator will not pass and the next button will keep you at the page until the file thing is solved. When the file upload is correct you can have a postback going to next step and rewind to the previous step and you still find your file in radasyncupload. Only at the last step where you assigned the button ID as the postbacktrigger of radasyncupload the data including the file will be available at code behind and can be processed.

 

Below is the javascript that I used. I create dynamic upload controls on a form depending if the user defined to have upload controls. The number of upload controls is less than 10 at max. Each control has its related textbox to check the upload status and test it with a related required field validator.

function OnClientValidationFailed(sender, args) {
        // get the index number of the file upload object (if you have several on the same page the last character is the index number
        var CurrentFileIndex = sender.get_id().slice(-1);
        // reset the corresponding TB to an empty string to detect that is has not been uploaded
        var textbox = $find('RegisterForm1_Step3_TB_REQUIRED_file' + CurrentFileIndex);
        textbox.set_value('');
    }

      

    function OnClientFileUploaded(sender, args) {
        var CurrentFileIndex = sender.get_id().slice(-1);
        var textbox = $find('RegisterForm1_Step3_TB_REQUIRED_file'+CurrentFileIndex);
        textbox.set_value(args.get_fileName()); 
    }

    function OnClientFileUploadRemoved(sender, args) {
        var CurrentFileIndex = sender.get_id().slice(-1);
        var textbox = $find('RegisterForm1_Step3_TB_REQUIRED_file' + CurrentFileIndex);
        textbox.set_value('');
    }
   


S
Top achievements
Rank 1
 answered on 08 Mar 2018
1 answer
138 views

So, here is the scenario...

I have a tab strip with 3 tabs.  Each has a RadGrid with summary sales information by year.  I am using a Sparkline to visually represent the data in one of the columns.

This would wonderfully in the first tab, which is visible when the page renders.  The sparkline is properly sized to fit in the cells of the radgrid.  However when I move to another tab - the sparkchart is trying to render in a 100px by 100px square that is cutting off and looks terrible.  As soon as I sort of filter or do anything to rebind the Radgrid on these other tabs, it looks ok.  

So, now I am trying to figure out how to repaint or properly resize these sparklines in the radgrids that are in the tabs that are not visible on page load.  Ideally, I could run a jQuery loop and redraw them?  We want to avoid forcing a server trip for a rebind on tab changes if at all possible.  Any help appreciated.

Attila Antal
Telerik team
 answered on 08 Mar 2018
0 answers
91 views

I'm trying to click on a row and edit it. I've got the EditMode="InPlace" in the radgrid. I'm new to Javascript and I'm probably missing something that triggers the edit of the column. I'm trying to complete this task on the client side.  

What am I missing please?

 

Javascript:

function RowClickEdit(grid, args) {

var dataItem = args.get_gridDataItem();

var type = dataItem.getDataKeyValue("listTypeID");

oWnd.show(); return false;}

 

HTML:

<ClientSettings >

<Selecting AllowRowSelect="True"></Selecting>

<ClientEvents OnRowClick="RowClickEdit"></ClientEvents>

</ClientSettings>

J
Top achievements
Rank 1
 asked on 08 Mar 2018
2 answers
99 views
Hi, 

Referring to this example 
http://demos.telerik.com/aspnet-ajax/menu/examples/functionality/offsetingthegroups/defaultcs.aspx 

is there a way to automated the offset?

I have a menu that is dynamically loaded and would like the expanded group to be aligned to the top always.
Some of the menu has 1 line, 2 lines or 3 lines and I find it is a bit hard to do the offset calculation.
Thanks.




Bryan
Top achievements
Rank 1
 answered on 08 Mar 2018
0 answers
382 views

I am the process of implementing ASP.NET Identity in a Telerik ASP.NET Ajax 2016.1.225 webapplication, due to the client's request for a more modern login (two-factor i.e.)

A few of the comboboxes are using EnableLoadOnDemand, set up with: <WebServiceSettings Method="GetCompanyNames" Path="booker_bestil_service2.aspx" />  

Codebehind signature is:

    [WebMethod(EnableSession = true)]
    public static RadComboBoxData GetCompanyNames(RadComboBoxContext context)

 

After disabling the old formsauthentication, and moving to ASP.NET Identity, this doesn't work. It gives a "Authentication failed", due to the 401 redirect to the login page. Attached is a snip from Fiddler.

How can I setup EnableLoadOnDemand with ASP.NET Identity?

Thanks :-)

aspliid
Top achievements
Rank 1
 asked on 08 Mar 2018
2 answers
188 views

here is my aspx page 

<%@ Page Language="C#" AutoEventWireup="true"  CodeBehind="ScheduleAppointment.aspx.cs" Inherits="iCRA_UI.FieldTech.ScheduleAppointment" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html>

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

    <title></title>

 
    <script src="lib/qsf.js"></script>
    <link href="lib/qsf.css" rel="stylesheet" />
    <script src="poupup.js"></script>

   
</head>
<body>
    <form id="form1" runat="server">
 <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />

     <telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManager1" runat="server" EnableShadow="true">
        </telerik:RadWindowManager>


   
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ConfigurationPanel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1">
        <div class="demo-container no-bg">
            <telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler1" GroupBy="Speaker" CustomAttributeNames="Completed" GroupingDirection="Horizontal"
                OnNavigationCommand="RadScheduler1_NavigationCommand" 
                AppointmentStyleMode="Default" DataSourceID="EventsDataSource" DataKeyField="ID"
                FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" DataSubjectField="Description"  RowHeight="40px" EnableTimeZonesEditing="true"
                DataStartField="StartTime" DataEndField="EndTime" DataRecurrenceField="RecurrenceRule"
                SelectedView="DayView" DataRecurrenceParentKeyField="RecurrenceParentID" AllowInsert="true" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentDelete="RadScheduler1_AppointmentDelete"  OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnResourceHeaderCreated="RadScheduler1_ResourceHeaderCreated"
               
                OverflowBehavior="Auto">
                <AdvancedForm Modal="true"></AdvancedForm>
                <MonthView UserSelectable="true"></MonthView>
                <TimelineView />
                <ResourceHeaderTemplate>
                    <asp:Panel ID="ResourceImageWrapper" runat="server" CssClass="ResCustomClass">
                        <asp:Image ID="SpeakerImage" runat="server" AlternateText='<%= Eval("Text") %>'></asp:Image>
                    </asp:Panel>
                </ResourceHeaderTemplate>
                <ResourceTypes>
                    <telerik:ResourceType KeyField="UserID" Name="Speaker" TextField="Fullname" ForeignKeyField="UserID"
                        DataSourceID="SpeakersDataSource1"></telerik:ResourceType>
                </ResourceTypes>
                <ResourceStyles>
                    <telerik:ResourceStyleMapping Type="Speaker" Key="1" BackColor="#eb901b"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="Speaker" Key="2" BackColor="#8fd21b"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="Speaker" Key="3" BackColor="#278ce9"></telerik:ResourceStyleMapping>
                    <telerik:ResourceStyleMapping Type="Speaker" Key="4" BackColor="#f14db2"></telerik:ResourceStyleMapping>
                </ResourceStyles>
                <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
                <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
            </telerik:RadScheduler>
        </div>
    </telerik:RadAjaxPanel>
    <asp:SqlDataSource ID="SpeakersDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:SQL %>" SelectCommand="SELECT * FROM [user_view]"
        >
    </asp:SqlDataSource>

          <asp:SqlDataSource ID="SpeakersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>" SelectCommand="SELECT * FROM [sp_view]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="EventsDataSource" runat="server"
        ConnectionString="<%$ ConnectionStrings:myConnectionString %>"
        SelectCommand="SELECT * FROM [sp_view]" InsertCommand="INSERT INTO [sp_view] ([Description], [StartTime], [EndTime], [SpeakerID]) VALUES (@Description, @Start, @End, @SpeakerID)"
       UpdateCommand="UPDATE [sp_view] SET [Description] = @Description, [Start] = @Start, [End] = @End, [RoomID] = @RoomID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [UserID] = @SpeakerID WHERE [UserID] = @ID"
        DeleteCommand="DELETE FROM [sp_view] WHERE [UserID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Description" Type="String"></asp:Parameter>
            <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="End" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="RoomID" Type="Int32" DefaultValue="1"></asp:Parameter>
            <asp:Parameter Name="RecurrenceRule" Type="String"></asp:Parameter>
            <asp:Parameter Name="RecurrenceParentID" Type="Int32"></asp:Parameter>
            <asp:Parameter Name="SpeakerID" Type="Int32"></asp:Parameter>
            <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
        </UpdateParameters>
     <InsertParameters>
            <asp:Parameter Name="Description" Type="String"></asp:Parameter>
            <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="End" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="RoomID" Type="Int32" DefaultValue="1"></asp:Parameter>
            <asp:Parameter Name="RecurrenceRule" Type="String"></asp:Parameter>
            <asp:Parameter Name="RecurrenceParentID" Type="Int32"></asp:Parameter>
            <asp:Parameter Name="SpeakerID" Type="Int32"></asp:Parameter>
        </InsertParameters>
    </asp:SqlDataSource>
 

    <div style="display:none">


    <asp:Button ID="Button1" OnClick="Button1_Click"  runat="server" Text="Button" />
            </div>
    
    </form>
</body>
</html>

 

on the code behide 

RadScheduler1_AppointmentDelete(object sender, AppointmentDeleteEventArgs e)
        {

} its not working 

 

Please help us ASAP

 

Regards 

Aakash 

Peter Milchev
Telerik team
 answered on 08 Mar 2018
0 answers
105 views

In a project the telerik ui for asp.net ajax controls are working but when I remove the assemblies for the 2008 version and add references to the 2018 version I only see guarbage like ???????

I also added the resource files to the app_globalresources and app_data and it didn't solve it.

 


Anooshiravan
Top achievements
Rank 1
 asked on 08 Mar 2018
1 answer
55 views

Has anyone come across anything similar to this?

We've got a completely dynamically generated grid, complete with frozen columns and the ability to edit individual specific data fields within a row just by clicking on it.  This all works, just giving you some background.

One of the fields opens a window where you can add/edit/delete records separate to the grid (ie different the cell editing above), however on closing the window the grid updates, refreshing to take into account the newly added/changed record which was saved via the window.  This also works fine in that the grid, even on it being refreshed, maintains its scroll position.

The odd behaviour that we're experiencing is that if at the row you clicked on to open the window is at the bottom for instance, after the window has been closed and the grid refresh (still looks to maintain the scroll position at this point), then clicking on the horizontal scrollbar (either the bar itself or the arrow button) will scroll the grid to the top.  This happens in Chrome, FF or Edge, but does not happen in IE11.

Has anyone experienced anything similar?

Thanks

 

Cheryl
Top achievements
Rank 1
Iron
 answered on 07 Mar 2018
7 answers
380 views

Hi,

When I type any text in the editor without changing the default font style the text doesn't get saved with the font style.

Is there any solution to always save the font style?

Thanks

Rumen
Telerik team
 answered on 07 Mar 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?