Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
981 views
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PrePopulateAnswer.ascx.cs"
    Inherits="ctrlPrePopulate" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<script type="text/javascript">
    var RadGrid1;
    var DataItems;
    function gridCreated(sender, args) {
        RadGrid1 = sender;
 
    }
 
    function CheckAll(headerCheckBox) {
        var isChecked = headerCheckBox.checked;
 
        var checkboxes = RadGrid1.get_masterTableView().get_element().getElementsByTagName("INPUT");
 
        var index;
        for (index = 0; index < checkboxes.length; index++) {
            if (typeof (checkboxes[index].checked) !== "undefined") {
                if (isChecked) {
                    checkboxes[index].checked = true;
                }
                else {
                    checkboxes[index].checked = false;
                }
            }
        }
    }
 
</script>
<style type="text/css">
    .LinkButtonurl
    {
        color: #0033FF;
        font-size: 13px;
    }
</style>
<style type="text/css">
    .Grid
    {
        border: 1px #000000 solid;
        border-spacing: 0px;
    }
</style>
<asp:Panel ID="pnlElement" runat="server">
    <table class="GridOuterTable">
        <tr>
            <td>
                <table class="InnerForm">
                    <tr>
                        <td class="OuterTable">
                            <br />
                            <div style="vertical-align: middle; margin-left: 25px;">
                                <span style="font-family: 'Arial'; color: #000000; font-size: 13px;"><b>Form Name:
                                    <asp:Label runat="server" ID="lblFormName"></asp:Label></b></span>
                            </div>
                            <br />
                            <center>
                                <div style="vertical-align: middle; margin-left: 20px;">
                                    <asp:LinkButton ID="lbtnCancel1" runat="server" CssClass="SecondaryButton" Text="Cancel"
                                        OnClick="lbtnCancel_Click"></asp:LinkButton>
                                    <asp:LinkButton runat="server" Text="Save" ID="lbtnSave" CssClass="MainButton" OnClick="lbtnSave_Click"></asp:LinkButton>
                                </div>
                            </center>
                            <div style="vertical-align: middle; margin-left: 25px;" class="InformationIcon">
                                <asp:Panel runat="server" ID="pnl">
                                    This option will use the answers provided the last time the user completed this
                                    form.<br />
                                    In order for the option to work as expected, the user and participant/entity/program/staff
                                    must match the user and participant from the last time this form was completed.
                                </asp:Panel>
                            </div>
                            <div style="vertical-align: middle; margin-left: 18px;">
                                <asp:CheckBoxList runat="server" RepeatDirection="Vertical" ID="chklstPrepopulate"
                                    CssClass="Aligntext" OnSelectedIndexChanged="chklstPrepopulate_SelectedIndexChanged"
                                    AutoPostBack="true" />
                                <br />
                            </div>
                            <div id="divGridLabel" runat="server" style="vertical-align: middle; margin-left: 25px;">
                                Select the Questions you wish to populate with previous answers
                            </div>
                            <br />
                            <div id="divGrid" runat="server" style="vertical-align: middle; margin-left: 25px;
                                margin-right: 10px;">
                                <telerik:RadGrid ID="gvPrepopulate" DataSourceID="odsRadGrid" runat="server" GridLines="None"
                                    CssClass="AddBorders" ShowStatusBar="True" CellSpacing="0" AllowPaging="True"
                                    PageSize="20" PagerStyle-AlwaysVisible="true" OnItemDataBound="gvPrepopulate_ItemDataBound"
                                    AllowMultiRowSelection="True" HeaderStyle-HorizontalAlign="Left" Width="100%">
                                    <HeaderStyle BackColor="red" />
                                    <GroupingSettings CaseSensitive="false" />
                                    <ClientSettings EnableRowHoverStyle="false">
                                        <Selecting AllowRowSelect="false" />
                                        <ClientEvents OnGridCreated="gridCreated" />
                                    </ClientSettings>
                                    <MasterTableView EditMode="InPlace" AllowFilteringByColumn="True" ShowFooter="True"
                                        DataKeyNames="FormElementID" TableLayout="Auto" AutoGenerateColumns="false" DataSourceID="odsRadGrid"
                                        HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Left" FilterItemStyle-HorizontalAlign="Left"
                                        FilterItemStyle-VerticalAlign="Bottom">
                                        <PagerStyle AlwaysVisible="True" />
                                        <HeaderStyle CssClass="InnerHeaderStyle" Font-Bold="true" />
                                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridTemplateColumn Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblElementID" runat="server" Text='<%# Eval("FormElementID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn AllowFiltering="false" ShowFilterIcon="False" UniqueName="Temp">
                                                <HeaderTemplate>
                                                    <asp:CheckBox ID="chkHeader" runat="server" onclick="CheckAll(this);" />
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkPrepopulate" runat="server" Checked='<%# Eval("AllowPrePopulate") %>' />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn AndCurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true"
                                                DataField="Stimulus" FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Left"
                                                HeaderText="Questions" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="70%"
                                                ReadOnly="True" ShowFilterIcon="false" SortExpression="Questions" UniqueName="Questions">
                                                <HeaderStyle HorizontalAlign="Left" />
                                                <ItemStyle HorizontalAlign="Left" Width="70%" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AndCurrentFilterFunction="StartsWith" AutoPostBackOnFilter="true"
                                                DataField="FormElementType" FilterControlWidth="100%" HeaderText="Question Type"
                                                ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" ShowFilterIcon="false"
                                                SortExpression="Question Type" UniqueName="Question Type">
                                                <ItemStyle HorizontalAlign="Left" Width="30%" />
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <EditFormSettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                            </EditColumn>
                                        </EditFormSettings>
                                        <FilterItemStyle HorizontalAlign="Left" VerticalAlign="Bottom" />
                                    </MasterTableView>
                                    <FilterMenu EnableImageSprites="true">
                                    </FilterMenu>
                                    <PagerStyle AlwaysVisible="True" />
                                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                    </HeaderContextMenu>
                                </telerik:RadGrid>
                            </div>
                            <asp:ObjectDataSource ID="odsRadGrid" runat="server" SelectMethod="GetGroupQuestionElementAll"
                                TypeName="SocialSolutions.ETOSoftware.BusinessLayer.SingleForm">
                                <SelectParameters>
                                    <asp:QueryStringParameter Name="FormID" QueryStringField="FormID" Type="Int32" />
                                    <asp:Parameter DefaultValue="False" Name="IsGroup" Type="Boolean" />
                                    <asp:SessionParameter Name="_sessionData" SessionField="SessionData" Type="Object" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <br />
                            <center>
                                <div style="vertical-align: middle; margin-left: 20px;">
                                    <asp:LinkButton ID="lbtnCancel" runat="server" CssClass="SecondaryButton" Text="Cancel"
                                        OnClick="lbtnCancel_Click"></asp:LinkButton>
                                    <asp:LinkButton runat="server" Text="Save" ID="lbtnSave2" CssClass="MainButton" OnClick="lbtnSave_Click"></asp:LinkButton>
                                </div>
                            </center>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Panel>
amol
Top achievements
Rank 1
 answered on 28 Dec 2017
0 answers
124 views

Hi this is my style:

    <style type="text/css">
        .style1
        {
            width: 100%;
        }

        .border_tr table tr
        {
            outline: 0.5px solid #999;
        }

            .border_tr table tr.nooutline
            {
                outline: 0px none;
            }

        .borders {
            outline: 0.5px solid #999;
        }
    </style>

The class ".border_tr table tr" applies normally but when I use RadClientExportManager It does not apply to the pdf which is generated.

My Script:

    <script type="text/javascript">
        function exportElement() {
            var exp = $find("<%= RadClientExportManager1.ClientID %>");
            exp.exportPDF($telerik.$("#PageContents"));
}
</script>

<telerik:RadClientExportManager runat="server" ID="RadClientExportManager1">
            <PdfSettings filename="Myfile.pdf" />
        </telerik:RadClientExportManager>

<input type="button" onclick="exportElement()" value="export" />

And my div where style is not applied in the pdf

 

<div class="border_tr" id="PageContents">
            <table width="100%">
                <tr>
                    <td>
                        <asp:Label ID="lblcltName" runat="server" Text="Client Name :" Font-Bold="true"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:Label ID="lbltxtcltName" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCaseManager" runat="server" Text="Case Manager :" Font-Bold="true"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:Label ID="lbltxtCaseManager" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblphyreviewer" runat="server" Text="Physician Reviewer :" Font-Bold="true"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:Label ID="lbltxtphyreviewer" runat="server"></asp:Label>
                    </td>
                </tr>

</table>

</div>

 

The pdf generated does not have any borders

Sam
Top achievements
Rank 1
 asked on 28 Dec 2017
0 answers
44 views

Hi,

How can i expand selected node for show child nodes after filter?

Bunyamin
Top achievements
Rank 1
 asked on 27 Dec 2017
0 answers
70 views

Hello,

I'm having issues with horizontal scrolling in my application. Headers are fixed, and headers and items are aligned vertically as expected. The problem is when I scroll all the way to the right, the headers stop scrolling before the items do and they become misaligned. There is an image attached that highlights this issue.

Please let me know what I can do to rectify this issue; I expect that when I scroll all the way to the right that the headers and items below are still perfectly aligned vertically.

Please note, this happens only when the contents of the grid expand beyond the vertical size thus forcing a vertical scroll bar within the grid.

 

Thanks!

ww1711
Top achievements
Rank 1
 asked on 27 Dec 2017
0 answers
77 views

Hi Community.

I have a SharePoint 2010 web part that uses Telerik ASP.Net Ajax UI and Skin component (version 2013.3.1114.35).

The skins work fine in the http site but fail to load in the https site. Identical web.config in both sites.

Same Telerik.Web.UI.Web.Resource.axd version in both http and https site under teh <handlers> and <httphandlers> sections in web.config.

I debugged and the Telerik API 'GetEmbeddedSkinNames' in http site retrieves all skins and return none in https so it falls to 'Default' skin.

In the C# project the both Telerik assemblies (Telerik.Web.UI and Telerik.Web.UI.Skins) have 'Specific Version= true' in the dll property window.

In the WFE server's GAC there are multiple Telerik assemblies (3 Telereik.Web.UI and 2 Telerik.Web.UI.Skins - the version I use is the latest registered in the GAC.

 

Just to make everything else even more confusing, in the test site (replica of Production) http and https work fine both.

Any idea? I'd try everything that you suggest me as I hit a point that I have no more ideas (and energy) to work on this! :)

Thank you and Happy Holidays!

 

 

 

loco
Top achievements
Rank 1
 asked on 27 Dec 2017
17 answers
541 views
Hi guys!
I'm a bit stuck with binding data to the Scheduler control. For example, in the AppointmentTemplate I have a label and I need to fill it's Text property with some data, based on the bound DataItem. If I use AppointmentCreated event handler, I can access the label fine using e.Container , but e.Appointment.DataItem is always NULL. If I use AppointmentDataBound event handler, DataItem does contain the object I need, but I can't figure out how to access the label.

Thanx a lot in advance!
Regards,
Andy
Marin Bratanov
Telerik team
 answered on 25 Dec 2017
1 answer
93 views

Hi, 

We are using ASP.NET and Telerik Version 2017.2.711.45 and have the following problem: 

In some situations we are showing a radconfirm window using the following code: 

var RWM = GetRadWindowManager();
var wdw = RWM.radconfirm(msg, CallbackFn, "auto", PUHeight + "px", null, "", ""); 

In IE11 everything works as expected and no request is send to the server. Unfortunately, in Firefox and Chrome RWM.radconfirm sends a request to the server. In some pages we are doing several things only if not isPostBack is true (normally only if the page is processed for the first time). Because of the unexpected request of radconfirm we are running into trouble. 
Is there a way to avoid this request using radconfirm in Firefox and Chrome? If not: Is there a way to identify, that the request was send by radconfirm? 

 

Thanks,

Matthias

Marin Bratanov
Telerik team
 answered on 25 Dec 2017
0 answers
66 views

Batch edit does not save when editing only one item and saving. If you edit more than one and save it works fine but not a single edit and saving.

Can be reproduced here:
https://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultvb.aspx

Edit one field and click Save changes. Does not update change.

Any workarounds available?

 

Mike
Top achievements
Rank 1
 asked on 24 Dec 2017
0 answers
78 views
We've got a UTC time coming from the database and being assigned to a GridDateTimeColumn in a Grid. We change the time to local time on the ItemDataBound. That all works great. The challenge we have is that when we use the built-in export to Excel, the column reverts back to UTC time. After many hours of searching online and in the forums and trying everything from trying to re-change the value i the ItemCommand, the ExcelMLWorkBookCreated, the ExcelMLExportRowCreated, the prerender and everywhere else we could think of, we're stumped. We can change other items stylistically with those functions but we can't figure out a way to get the DateTime to either export as it is displayed in the grid (local time) or to re-convert it to local time for the export.
Jeff
Top achievements
Rank 1
 asked on 23 Dec 2017
0 answers
98 views

Hi Support,

I am using telerik rad spreadsheet control. I have created sample application in which I am able to load excel file in sreadsheet control. But when I am trying to load excel in webpage with master page i am getting java script error "uncaught exception: Cant handle character '|'"

Please suggest.

Parimal
Top achievements
Rank 1
 asked on 23 Dec 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?