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

     I am trying to remove an appointment from the radscheduler on client side. I have a standard asp button that will fire a javascript function but I'm not sure on the syntax for removing an appointment from the radscheduler. Could I get some guidance. Thanks.

 

function DeleteAnAppointment()
        {
            $("#" + "<%= RadScheduler1.ClientID %>").deleteAppointment(2);
        }
 
<asp:LinkButton runat="server" ID="btnCancelAppointment" CssClass="btn btn-default" OnClientClick="DeleteAnAppointment();">
                        CANCEL
                    </asp:LinkButton>
 
<telerik:RadScheduler ID="RadScheduler1" runat="server"
                        StartInsertingInAdvancedForm="true"
                        EnableDescriptionField="true"
                        OverflowBehavior="Auto"
                        OnClientAppointmentClick="appointmentClick"
                        OnClientAppointmentMoving="appointmentMoving"
                        OnClientFormCreated="formCreated"
                        OnAppointmentClick="RadScheduler1_AppointmentClick"
                        OnAppointmentInsert="RadScheduler1_AppointmentInsert"
                        Height="700px"
                        Width="100%"
                        Skin="Bootstrap"
                        Culture="en-GB"
                        AdvancedForm-Modal="True"
                        MinutesPerRow="15"
                        HoursPanelTimeFormat="hh:mm tt"
                        NumberOfHoveredRows="1"
                        SelectedView="WeekView"
                        OnTimeSlotCreated="RadScheduler1_TimeSlotCreated"
                        AllowEdit="false"
                        AllowInsert="true"
                        AllowDelete="false"
                        AgendaView-UserSelectable="True"
                        TimelineView-UserSelectable="False"
                        Localization-AdvancedDescription="Notes"
                        ShowFooter="False"
                        ShowAllDayRow="False"
                        DayView-UserSelectable="False" OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnDataBound="RadScheduler1_DataBound">
                    <MonthView ReadOnly="True" VisibleAppointmentsPerDay="4" />
                    <AdvancedForm Modal="True" EnableCustomAttributeEditing="true" />
                    <TimelineView UserSelectable="False" />
                    <AgendaView UserSelectable="True" />
                    <AppointmentTemplate>
                        <div style="font-weight:bold;"><%# Eval("ApptClientID") %></div>
                        <div><%# Eval("Title") %> <%# Eval("Surname") %></div>
                    </AppointmentTemplate>
                </telerik:RadScheduler>
Vessy
Telerik team
 answered on 07 Mar 2018
10 answers
353 views
Hello,

I'm using a RadGrid with grouping and hope to customize the PDF export.  

My customer needs additional data in the group headers, so I've customized the RadGrid_ItemDataBound method to apply extensive formatting (see screen shot below).  To achieve this I set the e.Item.DataCell.Text property to a string containing my HTML:

protected void myGrid_ItemDataBound(object sender, GridItemEventArgs e) { 
 
if (e.Item is GridGroupHeaderItem) { 
 
//stylize group header 
GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item; 
 
item.DataCell.Text = "<table><tr><td><b>Custom Group Header</b></td></tr></table>"
 
 

This works great in the browser!  However, my custom group header is ignored in the PDF (see other screen shot).  Would someone provide instruction on customizing Group Headers within the PDF export?  

I am familiar with using the myGrid_PdfExporting method to make changes when the PDF is exported.

Thanks much!

Steven
Attila Antal
Telerik team
 answered on 07 Mar 2018
2 answers
554 views

I have a RadCheckBox on my page header:
     <telerik:RadCheckBox ID="rckMeasurables" Text="Show Measurables?" class="Sunset" OnClientCheckedChanged="check_changed" runat="server" />

if the checkbox is checked it should show half a dozen columns on a RadGrid

        <telerik:RadCodeBlock ID="rcBlock" runat="server">
            <script type="text/javascript">
                function check_changed()
                {
                    var rckMeasurables = $find("<%= rckMeasurables.ClientID %>");
                    var theGrid = $find('<%= rgDraftProspects.ClientID %>');
                    var theView = theGrid.get_masterTableView();
                    var theColumns = theView.get_columns();
                    for (var i = 10; i < 18; i++)
                    {
                        // javascript to hide or show columns
                    }

                }
            </script>
        </telerik:RadCodeBlock>

theGrid is null!

the Ajax Manager:

        <telerik:RadAjaxManager ID="raManager" runat="server" >
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgDraftProspects">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgDraftProspects" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rckMeasurables">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgDraftProspects" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

 

help!  what am I missing?  the script finds the checkbox but the grid is null
             

Chris
Top achievements
Rank 1
 answered on 07 Mar 2018
0 answers
112 views

I have an ASP.Net page with RadTextboxes.  All the RadTextboxes use Rendermode of Lightweight and use Office2007 skin.

On the ASP.Net page is a RadButton that allows the user to print the panel to a printer.

One of the RadTextboxes for QR Output has a width of 645px.

The problem is no matter what width the RadTextbox for QR Output is that it keeps showing in the printout as the default width for the RadTextbox.

Does not matter what browser is used (IE, Chrome, Firefox).

I need the printout to show the RadTextbox for QR Output as the same width as what the ASP.Net page shows.

Attached is a Screenshot of the ASP.Net and a picture of the printout.

Please help me resolve this.  Thanks!

Sincerely,

Keith Jackson

Keith
Top achievements
Rank 1
 asked on 07 Mar 2018
1 answer
91 views

Hi there,

 I am trying to find the same functionality which is in the following link:

 

https://demos.telerik.com/aspnet-ajax/calendar/server-side-programming/server-side-events/defaultcs.aspx

 

for ASP.NET MVC and the closest I have found is:

https://demos.telerik.com/aspnet-mvc/calendar/selection

 

The issue with this is that I need to keep control key down to select the dates and I can only select by rows and not columns. 

 

I would like to have the exact features as the first link.

 

Could you please point me to the right direction?

 

Thanks,

 

Amir

Viktor Tachev
Telerik team
 answered on 07 Mar 2018
2 answers
113 views

When I add a RadEditor to the page through an ajax call(get) it appears on the page but doesn't work properly.

01.$.ajax({
02.                        type: "GET",
03.                        url: "/Showmodule.aspx",
04.                        data: { Mid: "MyList", path: "" },
05.                        cache: false,
06.                        success: function (data) {
07.                            CheckLoginStatus(data);
08.                            $('.contentModule').empty().append(data);
09.                        }
10. 
11. });

 

For example I can't resize it or it event can't get focus to edit anything.

Do you have any suggestions on the problem?

thanks in advance.


Anooshiravan
Top achievements
Rank 1
 answered on 07 Mar 2018
1 answer
98 views

Please advise

Im using RadEditor, dll 2015

and have this error:

Uncaught TypeError: Cannot read property 'modeButtonsContainer' of undefined
    at c.RadEditor._getModeButtonsWrapper (ScriptResource.axd?d=ShRx8_PXUOW4gcbA-duY_wSu-krGlei5V9yCuOgtGKkhhj6Qmd-uOC6sRguCClwxaq6LO_oBjeAwhubMobfjSUX9q3nKWK-LrE6jkT4grWxE9Pkib7kVNn-kIYXLCZmRWsuyxaey4VjRz4HuIRle2Q2&t=112cd203:10119)
    at c.RadEditor._registerModeChangeHandler (ScriptResource.axd?d=ShRx8_PXUOW4gcbA-duY_wSu-krGlei5V9yCuOgtGKkhhj6Qmd-uOC6sRguCClwxaq6LO_oBjeAwhubMobfjSUX9q3nKWK-LrE6jkT4grWxE9Pkib7kVNn-kIYXLCZmRWsuyxaey4VjRz4HuIRle2Q2&t=112cd203:10120)
    at c.RadEditor.dispose (ScriptResource.axd?d=ShRx8_PXUOW4gcbA-duY_wSu-krGlei5V9yCuOgtGKkhhj6Qmd-uOC6sRguCClwxaq6LO_oBjeAwhubMobfjSUX9q3nKWK-LrE6jkT4grWxE9Pkib7kVNn-kIYXLCZmRWsuyxaey4VjRz4HuIRle2Q2&t=112cd203:9738)
    at _Application$disposeElement [as disposeElement] (ScriptResource.axd?d=0YuojD0FDpUdgDXZvn1N6gcGC2PQ8tSGF9aboCWtmieJ31tieolspZt9wT87smXT_u9A1NEYYP4EFhgl3KUDoWxqAr-DmgkPctQ2_pUbyDQvq96ZlLneZoFLJlkllX7zQbX9OwC10DtbpMbnB56Tgg2&t=34a51159:5811)
    at PageRequestManager$_updatePanel [as _updatePanel] (ScriptResource.axd?d=hrWHA2tSpnXBeZZDGEQqFjQ5p49yq-Lztmpu_tTTeE8XdMjirE57bXi_YYaOFqP1qAbyl6wdKjSwjdFciTgI9wX2eY2o2tUwatucz0yxZ56w9X5XZyFz_mhS4r-OsfEaGGZ73AojDpPrHVBeZdAsEA2&t=34a51159:1954)
    at PageRequestManager$_scriptIncludesLoadComplete [as _scriptIncludesLoadComplete] (ScriptResource.axd?d=hrWHA2tSpnXBeZZDGEQqFjQ5p49yq-Lztmpu_tTTeE8XdMjirE57bXi_YYaOFqP1qAbyl6wdKjSwjdFciTgI9wX2eY2o2tUwatucz0yxZ56w9X5XZyFz_mhS4r-OsfEaGGZ73AojDpPrHVBeZdAsEA2&t=34a51159:1804)
    at PageRequestManager.<anonymous> (ScriptResource.axd?d=0YuojD0FDpUdgDXZvn1N6gcGC2PQ8tSGF9aboCWtmieJ31tieolspZt9wT87smXT_u9A1NEYYP4EFhgl3KUDoWxqAr-DmgkPctQ2_pUbyDQvq96ZlLneZoFLJlkllX7zQbX9OwC10DtbpMbnB56Tgg2&t=34a51159:609)
    at ScriptResource.axd?d=0YuojD0FDpUdgDXZvn1N6gcGC2PQ8tSGF9aboCWtmieJ31tieolspZt9wT87smXT_u9A1NEYYP4EFhgl3KUDoWxqAr-DmgkPctQ2_pUbyDQvq96ZlLneZoFLJlkllX7zQbX9OwC10DtbpMbnB56Tgg2&t=34a51159:628
    at _ScriptLoader$_loadScriptsInternal [as _loadScriptsInternal] (ScriptResource.axd?d=hrWHA2tSpnXBeZZDGEQqFjQ5p49yq-Lztmpu_tTTeE8XdMjirE57bXi_YYaOFqP1qAbyl6wdKjSwjdFciTgI9wX2eY2o2tUwatucz0yxZ56w9X5XZyFz_mhS4r-OsfEaGGZ73AojDpPrHVBeZdAsEA2&t=34a51159:460)
    at _ScriptLoader$_nextSession [as _nextSession] (ScriptResource.axd?d=hrWHA2tSpnXBeZZDGEQqFjQ5p49yq-Lztmpu_tTTeE8XdMjirE57bXi_YYaOFqP1qAbyl6wdKjSwjdFciTgI9wX2eY2o2tUwatucz0yxZ56w9X5XZyFz_mhS4r-OsfEaGGZ73AojDpPrHVBeZdAsEA2&t=34a51159:476)

Regards

Rumen
Telerik team
 answered on 07 Mar 2018
6 answers
570 views

I have a requirement where I have to dynamically create the columns based on the number of people taking a test over a given period of time.  There will be 2 column per employee (a "score" column and a "possible points" column).  So what I would like to do is to put the person's name in the heading spanning these two columns.  I have done this many times but never with auto generated columns.  Here is a real stripped down version of what I am trying to do as well as the error I am receiving...

 

<telerik:RadGrid
    runat="server"
    ID="grid"
    AutoGenerateColumns="true"
    GroupingEnabled="true"
    OnDataBound="grid_DataBound"
    OnNeedDataSource="grid_NeedDataSource"
    />

 

using System;
using System.Data;
using Telerik.Web.UI;
 
public partial class Mike : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    { }
 
    protected void grid_DataBound(object sender, EventArgs e)
    {
        if (grid.MasterTableView != null && grid.MasterTableView.ColumnGroups.Count > 0)
        {
            foreach (GridColumn column in grid.MasterTableView.AutoGeneratedColumns)
            {
                if (column.UniqueName.Contains("ZoeBarnes"))
                {
                    column.ColumnGroupName = "ZoeBarnes";
                }
                if (column.UniqueName.Contains("FrancisUnderwood"))
                {
                    column.ColumnGroupName = "FrancisUnderwood";
                }
                if (column.UniqueName.Contains("RachelPosner"))
                {
                    column.ColumnGroupName = "RachelPosner";
                }
            }
        }
    }
 
    protected void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        GridColumnGroup gcg1 = new GridColumnGroup();
        gcg1.HeaderText = "Zoe Barnes";
        gcg1.Name = "ZoeBarnes";
        grid.MasterTableView.ColumnGroups.Add(gcg1);
 
        GridColumnGroup gcg2 = new GridColumnGroup();
        gcg2.HeaderText = "Rachel Posner";
        gcg2.Name = "RachelPosner";
        grid.MasterTableView.ColumnGroups.Add(gcg2);
 
        GridColumnGroup gcg3 = new GridColumnGroup();
        gcg3.HeaderText = "Francis Underwood";
        gcg3.Name = "FrancisUnderwood";
        grid.MasterTableView.ColumnGroups.Add(gcg3);
 
        DataTable table = new DataTable();
        table.Columns.Add("ScoreZoeBarnes", typeof(int));
        table.Columns.Add("PossibleZoeBarnes", typeof(int));
        table.Columns.Add("ScoreRachelPosner", typeof(int));
        table.Columns.Add("PossibleRachelPosner", typeof(int));
        table.Columns.Add("ScoreFrancisUnderwood", typeof(int));
        table.Columns.Add("PossibleFrancisUnderwood", typeof(int));
 
        table.Rows.Add(10, 15, 14, 15, 12, 15);
        grid.DataSource = table;
    }
}

 

This should simply output one row of data with the person's name spanning the two columns relating to them.  However I am getting the following error:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index]
   System.Web.UI.ControlCollection.get_Item(Int32 index) +9807837
   System.Web.UI.WebControls.TableCellCollection.get_Item(Int32 index) +29
   Telerik.Web.UI.GridHeaderItem.AdjustColSpan() +131
   Telerik.Web.UI.RadGrid.ControlPreRender() +1084
   Telerik.Web.UI.RadCompositeDataBoundControl.OnPreRender(EventArgs e) +44
   System.Web.UI.Control.PreRenderRecursiveInternal() +88
   System.Web.UI.Control.PreRenderRecursiveInternal() +160
   System.Web.UI.Control.PreRenderRecursiveInternal() +160
   System.Web.UI.Control.PreRenderRecursiveInternal() +160
   System.Web.UI.Control.PreRenderRecursiveInternal() +160
   System.Web.UI.Control.PreRenderRecursiveInternal() +160
   System.Web.UI.Control.PreRenderRecursiveInternal() +160
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +985

 

Any idea why?

Eyup
Telerik team
 answered on 07 Mar 2018
2 answers
148 views

Hi,

I have a Radgrid with a ColName that consist of value of A to G, that represent the value to be displayed in the corresponding column (Column A, Column B, etc) with the value of ID. Kindly refer to the attached image.

Below is the logic, but I'm not familiar with the correct syntax, can anyone please correct my syntax such as how to retrieve and set the value from the column.

Thank you.

 

Best regards,

George

 

 

 

 

 

 

George
Top achievements
Rank 1
 answered on 07 Mar 2018
1 answer
79 views

Hello,

I am having trouble centering a RadGrids header when exporting to PDF. If you take a look at the attached file, my table in the header is not aligned. Are you able to adjust the margin within the header?

Here are my export settings for the pdf

EadradGrid.ExportSettings.Pdf.PageWidth = Unit.Parse("210mm");
EadradGrid.ExportSettings.Pdf.PageHeader.LeftCell.Text = " ";
EadradGrid.ExportSettings.Pdf.PageHeader.MiddleCell.Text = headerLeftCell;
EadradGrid.ExportSettings.Pdf.PageHeader.RightCell.Text = " ";
EadradGrid.ExportSettings.Pdf.PageRightMargin = Unit.Parse("20mm");
EadradGrid.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("20mm");

 

It seems that the PageRightMargin and PageLeftMargin only affect the body of the PDF and not the Header. 

 

 

Attila Antal
Telerik team
 answered on 06 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?