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

I want to add a custom header to each page of my pdf export.

My grid code has the following declaration.

1 - I have a left margin of 20px but my header does not align with the rest of the export. How can I add a padding to it.

2 - I also want to add a horizontal rule to each page just above the header. If I add it to the string below it just shows in the left cell and it also breaks my header into two separate pages.

string ExportTitle = "<b>ClientName</b><br />  " + " ReportName";
grid.ExportSettings.Pdf.PageHeader.LeftCell.Text = ExportTitle;
grid.ExportSettings.Pdf.PageHeader.LeftCell.TextAlign = GridPdfPageHeaderFooterCell.CellTextAlign.Left;                grid.ExportSettings.Pdf.PageLeftMargin = Unit.Pixel(20);
grid.ExportSettings.Pdf.PageRightMargin = Unit.Pixel(20);

 

Attila Antal
Telerik team
 answered on 11 May 2018
2 answers
291 views

Hi,

We are using latest RadGrid control with visual studio 2017. I have asp.net c# page with regular dropdownlist and RadGrid. Radgrid clientside binding should happen only when an item is selected in dropdownlist by passing selected value of dropdown to the webservice call. How can I do this binding on client side.

something like this:

protected void ddlDropdownList_SelectedIndexChanged(object sender, EventArgs e)
{   //clientside binding of grid should happen by passing ddlDropdownList.SelectedValue

}

Marin Bratanov
Telerik team
 answered on 11 May 2018
0 answers
219 views

We have a RadListBox where we are adding and removing items via client side code (sample add shown):

ListBox_AddItem = function (listbox, text, value) {
    var item = new Telerik.Web.UI.RadListBoxItem();
    item.set_value(value);
    item.set_text(text);
    var attributes = item.get_attributes();
    attributes.setAttribute("Name", text);
    attributes.setAttribute("ID", value);
    listbox.trackChanges();
    listbox.get_items().add(item);
    item.bindTemplate();
    listbox.commitChanges();

    return false;
}

<telerik:RadListBox runat="server" ID="RadListBox" ClientIDMode="AutoID"
                                        OnClientLoad="RadListBox_OnClientLoad">
                                        <ItemTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <%# Eval("Name") %>
                                                    </td>
                                                    <td id="DeleteColumn" style="float: right">
                                                        <a href="" onclick="return deleteRequestedBy('<%# Eval("id") %>')">
                                                            <img src="Images/deletered.png" width="20" height="20" alt="submit" />
                                                        </a>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                        <ClientItemTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        #= Attributes.Name#
                                                    </td >
                                                    <td id="DeleteColumn" style="float:right">
                                                        <a href="" onclick="return deleteRequestedBy('#= Attributes.ID#')">
                                                            <img src="Images/deletered.png" width="20" height="20" alt="submit" />
                                                        </a>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ClientItemTemplate>

                                    </telerik:RadListBox>

The ListBox is in a Tab on a RadTabStrip. When we add or remove items from the ListBox and then click on one of the other tabs we get an error:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

at System.Collections.ArrayList.get_Item(Int32 index)
at System.Web.UI.StateManagedCollection.System.Collections.IList.get_Item(Int32 index)
at Telerik.Web.UI.ControlItemCollection.get_Item(Int32 index)
at Telerik.Web.UI.ClientStateLogPlayer`1.Remove(ControlItemCollection items, Int32 index)
at Telerik.Web.UI.ClientStateLogPlayer`1.Play(ClientStateLogEntry entry)
at Telerik.Web.UI.ClientStateLogPlayer`1.Play(IEnumerable`1 clientStateLogEntry)
at Telerik.Web.UI.RadListBox.LoadLogEntries(RadListBoxClientState clientState)
at Telerik.Web.UI.RadListBox.LoadClientState(RadListBoxClientState clientState)
at Telerik.Web.UI.RadListBox.LoadPostData(String postDataKey, NameValueCollection postCollection)
at Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I've tried the solutions suggested (along with some variations):

https://www.telerik.com/forums/transfer-throws-exception

https://docs.telerik.com/devtools/aspnet-ajax/controls/listbox/troubleshooting/index-out-of-range-on-item-transfer-

However, none of the suggestions worked and don't seem to quite apply in this scenario i.e. we are not transferring.

 

 

Kieran
Top achievements
Rank 1
 asked on 11 May 2018
8 answers
2.5K+ views
How can I force a textbox to make all letters uppercase?
Chamara
Top achievements
Rank 1
 answered on 11 May 2018
5 answers
309 views
     How can I use one of the Telerik toolbar images for a custom toolbar button?
Jim
Top achievements
Rank 1
 answered on 10 May 2018
6 answers
367 views
Hi,

I am using RadclientDatasource to bind data unto grid. it is working fine. but i want to pass parameter based on selection. Please check my code and let me know how to pass parameter while selecting and Inserting

<telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="True">
            <ClientEvents OnCustomParameter="ParameterMap" OnDataParse="Parse" OnRequestFailed="rg_OnRequestFailed" />
            <DataSource>
                <WebServiceDataSourceSettings BaseUrl="/BackStage/BackStageWCFService.svc/">
                    <Select Url="getLocation" DataType="JSON" />                   
                    <Insert Url="InsertLocation" DataType="JSON" />                
                </WebServiceDataSourceSettings>
            </DataSource>
            <Schema>
                <Model ID="att_typ_id">
                    <telerik:ClientDataSourceModelField FieldName="prt_loc_id" DataType="Number" />
                    <telerik:ClientDataSourceModelField FieldName="effective_date" DataType="Date" />
                    <telerik:ClientDataSourceModelField FieldName="termination_date" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="rep_loc_code" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="rep_loc_id" DataType="Number" />
                    <telerik:ClientDataSourceModelField FieldName="pln_prt_id" DataType="Number" />
                </Model>
            </Schema>
        </telerik:RadClientDataSource>

Javascript
-------------
function ParameterMap(sender, args) {
               
               if (args.get_type() == "read") {                  
                    args.set_parameterFormat({ customersJSON: kendo.stringify(args.get_data().models) });
                }             
            }

Appcode
-------------
<WebGet()> _
<AspNetCacheProfile("NoCache")> _
    Public Function getLocation() As LocationResult
        Dim entities As New EnrollmentEntities()
        Return New LocationResult() With { _
          .Data = entities.PART_REPORTING_LOCATIONS.Where(Function(d) d.PRT_LOC_ID = Here need to pass parameter).ToList().[Select](Function(c) New ServiceLocations() With { _
           .prt_loc_id = c.PRT_LOC_ID, _
           .termination_date = If(HttpUtility.HtmlEncode(c.TERMINATION_DATE) IsNot Nothing, HttpUtility.HtmlEncode(c.TERMINATION_DATE.Value.ToString("MM-dd-yyyy")), ""), _
           .effective_date = c.EFFECTIVE_DATE, _
           .rep_loc_code = HttpUtility.HtmlEncode(c.LEVEL_REP_LOC.REP_LOC_CODE), _
           .rep_loc_id = c.REP_LOC_ID, _
           .pln_prt_id = c.PLN_PRT_ID _
         }).ToList(), _
          .Count = 100 _
        }
    End Function


Please check my code and help ASAP


Thanks in advance,
Dhamu
Marin Bratanov
Telerik team
 answered on 10 May 2018
0 answers
159 views

Hi,

            I am using RadWizard inside a RadWindow where I need to get the wizard shld get resize as the window is resized and this two controls should be responsive on all devices(Mobile). Please help me with a sample . I have checked this example https://demos.telerik.com/aspnet-ajax/wizard/application-scenarios/radwizard-in-radwindow/defaultcs.aspx.

But in this example the wizard is not changing as window is resized.

Please help me ASAP.

 

 

Thanks,

Shabana

 

 

Shabana
Top achievements
Rank 1
 asked on 10 May 2018
7 answers
180 views

Not working for some reason in version 2012.3.1308.35

Getting different error details but essentially boils down to 0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException:  is neither a DataColumn nor a DataRelation for table .

MasterTableView has AllowFilteringByColumn = "true"...

DataTextField is set to column name from datatable so binding works fine...

Using inside usercontrol with RadAjaxManager (Not the Proxy control)

Becoming a frustrating thing...lol

Any Ideas???

Thanks,

Tim

 

Attila Antal
Telerik team
 answered on 09 May 2018
0 answers
132 views
Hello,
I'm attempting to call SetFocus()  explicitly for a Telerik rad editor control over the Tab key press and button click event as well. 
It's working for another browser but in chrome SetFocus() work only first time after that SetFocus() is not working.
Rohan
Top achievements
Rank 1
 asked on 09 May 2018
9 answers
826 views
Hi,

I have a RadGrid and we are doing some client side operations on it. But After Paging I am losing all the operations what we did previously using javascript. Help me so that all functionality remains unchanged after paging. Help me solving this. Here I will explain:


I have a Radgrid with one checkbox and one text box (By Default it will be "0"). using javascript If I check a checkbox the text in textbox must be changed to "100". If I did these operations and click paging and get return from paging all the functionality is missing and get reset.

Help me how can we achieve this without losing functionality after paging.

Thanks.

 
Scott
Top achievements
Rank 2
 answered on 09 May 2018
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?