Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
645 views

Hi,

While i try to edit my rad editor it through an error Cannot read property 'replace' of undefined.

 

Please help me.

 

Thanks,

Rajiv

Rajiv
Top achievements
Rank 1
 answered on 02 Jul 2019
1 answer
258 views
  • ASP.NET version: 4.0.30319
  • OS: Windows Server 2012 R2
  • Browser: Google Chrome v66.0.3359.139 (Official Build) (64-bit)
  • Exact Telerik Version: 2014.1.225.40 (2007-2014 Telerik AD)
  • Preferred programming language: VB.NET

Hello, I'm currently implementing infinite scroll/load more functionality for news articles on our website. Do you have any documentation or advice on how we can initialize the RadSocialShare control client-side? I can load the initial batch of articles with their respective RadSocialShare controls, but because we're adding load more, we don't have the title and url to share until the user scrolls to the bottom of the page. Is there a way to find out which components we need in order to wire up RadSocialShare controls for the subsequent batches of articles?

Thanks!

Charles
Top achievements
Rank 1
 answered on 01 Jul 2019
3 answers
1.0K+ views
I am hoping someone can point me in the right direction.  I have a dataset displaying in my RadGrid.  When we export to Excel (HTML) I would like to remove some of the rows - based on a DataKeyValue.  How/where would I do this?
Attila Antal
Telerik team
 answered on 01 Jul 2019
6 answers
776 views

I have a hyperlink within a Radgrid which opens up a RadWindow for the user. 

 

                                <telerik:GridTemplateColumn HeaderText="Id" ReadOnly="true" SortExpression="Lookup" UniqueName="Lookup">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="hlWorkOrderId" Text='<%#Eval("Lookup")%>' NavigateUrl='<%#String.Format("javascript:openWindow({0});", Eval("WorkOrderId"))%>' Enabled='<%#String.IsNullOrEmpty(CurrentUser).Equals(False).ToString%>' runat="server" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>

The user is requesting that when they click on the hyperlink, they want that row in the grid highlighted.   How can I pass the selected row index to the javascript function in the Hyperlink?  

Vessy
Telerik team
 answered on 01 Jul 2019
6 answers
1.0K+ views
How do I get a reference to a button in a template column of my grid during PreRender?

Here is a grid (ShotDetail_RadGrid) that has tabs on each row of data. On the first of these tabs is another grid (Attachments_RadGrid) with the ImageButton I'm trying to get the reference to:
<telerik:RadGrid ID="ShotDetail_RadGrid" runat="server" DataSourceID="ShotDetail_SqlDataSource" Skin="Black"
    GridLines="None" ShowStatusBar="True" Width="1100px" CellSpacing="0" AutoGenerateColumns="False">
    <HierarchySettings ExpandTooltip="Show related merch" CollapseTooltip="Collapse merch"></HierarchySettings>
    <ExportSettings IgnorePaging="True">
        <Pdf PageBottomMargin="0.5in" PageHeight="8.5in" PageLeftMargin="0.35in" PageRightMargin="0.35in" PageTopMargin="0.5in"
            PageWidth="11in" />
    </ExportSettings>
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="ShotID" DataSourceID="ShotDetail_SqlDataSource" AllowCustomPaging="True">
        <NestedViewTemplate>
            <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
                <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Merchandise" PageViewID="PageView1" Selected="True">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Shot Support" PageViewID="PageView2">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Completed Images">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                    <telerik:RadPageView runat="server" ID="PageView1">
                        <asp:Label ID="ShotID_Label" Text='<%# Eval("ShotID") %>' Visible="false" runat="server" />
                        <asp:SqlDataSource ID="Merch_SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Alderman_ConnectionString %>"
                            SelectCommand="sp_web_Merch_Grid_sel" SelectCommandType="StoredProcedure">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="ShotID_Label" PropertyName="Text" Type="Int32" Name="ShotID" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <telerik:RadGrid ID="Merch_RadGrid" runat="server" AutoGenerateColumns="False" DataSourceID="Merch_SqlDataSource"
                            GridLines="None" CellSpacing="0">
                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                            </ClientSettings>
                            <MasterTableView DataSourceID="Merch_SqlDataSource">
                                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="Barcode" DataType="System.Int64" Display="False" HeaderText="Barcode"
                                        UniqueName="Barcode">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Source" HeaderText="Vendor" UniqueName="Source" FilterControlAltText="Filter Source column">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="SKU" HeaderText="SKU" UniqueName="SKU">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="SKU2" HeaderText="SKU2" UniqueName="SKU2">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" EnableImageSprites="True">
                            </HeaderContextMenu>
                        </telerik:RadGrid>
                    </telerik:RadPageView>
                    <telerik:RadPageView runat="server" Width="100%" ID="PageView2">
                        <asp:SqlDataSource ID="Attachments_SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:Alderman_ConnectionString %>"
                            SelectCommand="SELECT [AttachmentTitle], [LinkedFromID] FROM [tAttachments] WHERE (([LinkedFromID] = @ShotID) AND ([LinkedFromTable] = @LinkedFromTable) AND (AttachmentIsInvalid = 0))">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="ShotID_Label" PropertyName="Text" Type="Int32" Name="ShotID" />
                                <asp:Parameter DefaultValue="tShots" Name="LinkedFromTable" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <telerik:RadGrid ID="Attachments_RadGrid" runat="server" DataSourceID="Attachments_SqlDataSource" GridLines="None"
                            CellSpacing="0">
                            <MasterTableView DataSourceID="Attachments_SqlDataSource" AutoGenerateColumns="False">
                                <CommandItemSettings ExportToPdfText="Export to PDF" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridTemplateColumn UniqueName="ColumnDownload">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="DownloadForShot_ImageButton" runat="server" ImageUrl="~/Images/view.gif" OnClick="DownloadForShot_ImageButton_Click" />
                                            <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="AttachmentTitle" HeaderText="Documents" UniqueName="ColumnAttachment">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                            </HeaderContextMenu>
                        </telerik:RadGrid>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
            </asp:Panel>
        </NestedViewTemplate>
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True">
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="JobShot" HeaderText="Shot" UniqueName="JobShot">
                <HeaderStyle Width="100px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description">
                <HeaderStyle Width="700px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MerchCount" DataType="System.Int16" HeaderText="Merch Count" UniqueName="MerchCount"
                AllowFiltering="False">
                <HeaderStyle Width="50px" />
                <ItemStyle Wrap="True" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="JobNumber" Display="False" HeaderText="JobNumber" UniqueName="JobNumber"
                FilterControlAltText="Filter JobNumber column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ShotID" DataType="System.Int32" HeaderText="ShotID" UniqueName="ShotID"
                Display="False">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
        <PagerStyle AlwaysVisible="True" />
    </MasterTableView>
    <PagerStyle AlwaysVisible="True" />
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>

Here is my PreRender code. The viewImageButton is never set.
protected void ShotDetail_RadGrid_PreRender(object sender, EventArgs e)
{
    if (!Page.IsPostBack) {
        //*** Associate each Attachments_RadGrid with its own postback script to open the file.
        for (int i = 0; i <= ShotDetail_RadGrid.MasterTableView.Items.Count - 1; i++) {
            Panel aspPanel = ShotDetail_RadGrid.MasterTableView.Items(i).ChildItem.FindControl("InnerContainer");
            RadGrid attachmentsGrid = aspPanel.FindControl("Attachments_RadGrid");
 
            RadScriptManager ScriptManager1 = default(RadScriptManager);
            ScriptManager1 = (RadScriptManager)this.Parent.FindControl("RadScriptManager1");
            ScriptManager1.RegisterPostBackControl(attachmentsGrid);
 
            ImageButton viewImageButton = attachmentsGrid.MasterTableView.FindControl("DownloadForShot_ImageButton");
            viewImageButton.Attributes.Add("onclick", " ExportButtonClick ();");
        }
    }
}

Thanks!

Attila Antal
Telerik team
 answered on 01 Jul 2019
5 answers
827 views
Is there a way to use only a single command to disable all the telerik controls on a singe page in one command?

If there isn't, they can still be disabled individually, but it is a nice time saving trick if there is.

Note that we have found tutorials that describe how to individually make telerik controls read only, through programming code.  (Here is a good example: http://www.telerik.com/forums/programmatically-enabling-disabling-grid-row-editing)

Rumen
Telerik team
 answered on 01 Jul 2019
1 answer
76 views
How to call server side(on click) event after client side radconfirm window without using __dopostback in callback function?
Peter Milchev
Telerik team
 answered on 28 Jun 2019
9 answers
300 views
Hi,

I am printing a grid using the following code. But it prints the entire grid with search header and Delete image of the grid. Is there any way that I avoid search header and Delete column from the grid just on print page. Following is my code. Also in below code I had to use documnet.getelementbyid commnad to find the grid because $find is not working for me.


function

 

PrintRadGrid(radGridId){

 

 

var radGrid = document.getElementById(radGridId);

 

 

var sh = '<%= ClientScript.GetWebResourceUrl(rgrdUser.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",rgrdUser.Skin)) %>';

 

 

var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";

 

 

var htmlcontent = styleStr + "<body>" + radGrid.outerHTML + "</body></html>";

 

previewWnd.document.open();

previewWnd.document.write(htmlcontent);

previewWnd.document.close();

previewWnd.print();

 

 

 

 

 

 

}


Thanks,
Lubna.

Peter Milchev
Telerik team
 answered on 28 Jun 2019
27 answers
491 views
Hi All,

i have a rad grid in which i am assigning datasource on code behind , how to print this grid    

            <telerik:RadGrid Width="100%" HeaderStyle-Height="22px" HeaderStyle-HorizontalAlign="Left"
                    GridLines="Horizontal" DataKeyNames="UnitId" AutoGenerateColumns="false" AllowSorting="true"
                    MasterTableView-HierarchyDefaultExpanded="true" AllowPaging="false" ID="gvReportUnit"
                    runat="server" OnDetailTableDataBind="gvReportUnit_DetailTableDataBind" OnSortCommand="gvReportUnit_SortCommand">
                    <PagerStyle Mode="NumericPages"></PagerStyle>
                    <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                    </ClientSettings>
                    <MasterTableView AllowSorting="true" DataKeyNames="UnitId" Width="100%">
                        <Columns>
                            <telerik:GridBoundColumn DataField="UnitId" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Unit ID" ItemStyle-CssClass="ItemStyle" ItemStyle-VerticalAlign="Top"
                                ItemStyle-HorizontalAlign="Left" SortExpression="UnitNameId" HeaderStyle-HorizontalAlign="Left"
                                ItemStyle-Width="100%">
                                <ItemTemplate>
                                    <%# Eval("UnitNameId") %>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <DetailTables>
                            <telerik:GridTableView AllowPaging="false" AutoGenerateColumns="false" AllowSorting="false"
                                GridLines="Horizontal" Width="100%" runat="server">
                            </telerik:GridTableView>
                        </DetailTables>
                    </MasterTableView>
                </telerik:RadGrid>

Thanks
Pankaj Agarwal

Peter Milchev
Telerik team
 answered on 28 Jun 2019
8 answers
817 views
I have implemented  a server side pagination in my rad grid and I have set VirtualItemCount as the maximum row count of the table. In RadGridPageIndexChanged i have bind the radgrid dynamically calling the server side sp. I want to print the whole record of the table. Could you please help me to print the data of all record through javascript.
Peter Milchev
Telerik team
 answered on 28 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?