Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
171 views
I need a print function to the RadPageview as below:
1. Print the selected RadPageView only (means only print the content for the selected tab)
2. Print all the RadPageView (combined all the content which in different tab)

(Note: The RadTabStrip is integrated with RadMultipage)

Does anybody can provide me the "Print function" code for the RadPageview?

Thank you.
Kate
Telerik team
 answered on 16 Sep 2013
2 answers
137 views
I am using the Radgrid to support Social Activity streams. I am using GridTemplateColumn to format the activityStream Posts and Comments to the Posts. When I click on expand (1 comment link) to view the comments to the posts, the format of the Posts below the Comments somehow reformat. Below is the Aspx page. I have also provided 2 screen shots; One with the view of Activity Stream before expanding a Post to view the comments, the second view is after expanding a Post. Notice that the comment is not indented as well notice the Posts below the comment. They is no alternating row colors and the font seems to have changed. I have viewed the page on various browsers and the result is the same. If you would to see alive demonstration I can setup a GoToMeeting. Note that to expand a post I am clicking on the 1 Comments link on each post rather than using the built-In expand /Collapse + column. 

<telerik:RadGrid ClientSettings-Resizing-AllowColumnResize="true" PageSize="10" ID="grdActivityStream"
    Height="679px" Width="97.0%" ShowStatusBar="True" runat="server" AutoGenerateColumns="False"
    AllowSorting="True" AllowPaging="false" GridLines="None" Skin="Vista" ClientSettings-Selecting-AllowRowSelect="True"
    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
    AllowMultiRowSelection="True" OnItemInserted="grdActivityStream_ItemInserted"
    OnNeedDataSource="grdActivityStream_NeedDataSource" ClientSettings-Scrolling-AllowScroll="true"
    ClientSettings-Scrolling-UseStaticHeaders="true" ClientSettings-Scrolling-ScrollHeight="100%"
    OnPreRender="grdActivityStream_PreRender" OnItemCommand="grdActivityStream_ItemCommand"
    OnItemUpdated="grdActivityStream_ItemUpdated" OnItemDataBound="grdActivityStream_ItemDataBound"
    CellSpacing="0">
    <MasterTableView DataKeyNames="ID" AllowMultiColumnSorting="True" CommandItemDisplay="Top"
        AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
        EditMode="PopUp" ClientDataKeyNames="ID">
        <CommandItemTemplate>
            <div style="float: left;">
            </div>
            <div style="float: right; text-align: right;">
                <asp:Label ID="lblRecordCount" runat="server" Text="" OnPreRender="lblRecordCount_PreRender"></asp:Label>
                <asp:LinkButton ID="lnkPageHelp" runat="server" OnClientClick="openPageHelp();return false;"><img style="border:0px" alt="" src="Images/Fast Icon Images/help3.png"  /> </asp:LinkButton>
                <asp:LinkButton ID="lnkRefresh" runat="server" CommandName="Refresh"><img style="border:0px" alt="" src="Images/Fast Icon Images/refresh2.png"  /> Refresh</asp:LinkButton>
            </div>
        </CommandItemTemplate>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="false" FilterControlAltText="ExpandColumn column">
        </ExpandCollapseColumn>
        <PagerTemplate>
            <asp:Panel ID="pnlPager" CssClass="pager" runat="server">
                <div style="margin: 0px; float: right;">
                    Displaying page
                    <%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>
                    of
                    <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                    , items
                    <%# (int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") + 1 %>
                    to
                    <%# (int)DataBinder.Eval(Container, "Paging.LastIndexInPage") + 1 %>
                    of
                    <%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>
                </div>
                <div style="width: 260px; margin: 0px; padding: 0px; float: left; margin-right: 10px;
                    margin-bottom: 300px; white-space: nowrap;">
                    <asp:Button ID="Button1" runat="server" OnClientClick="changePage('first'); return false;"
                        CommandName="Page" CommandArgument="First" Text="" CssClass="PagerButton FirstPage" />
                    <asp:Button ID="Button2" runat="server" OnClientClick="changePage('prev'); return false;"
                        CommandName="Page" CommandArgument="Prev" Text="" CssClass="PagerButton PrevPage" />
                    <span style="vertical-align: middle;">Page:</span>
                    <telerik:RadNumericTextBox ID="numTargetPage" Width="25px" Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>'
                        runat="server">
                        <ClientEvents OnValueChanged="numTargetPage_ValueChanged" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                    <span style="vertical-align: middle;">of
                        <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                    </span>
                    <asp:Button ID="Button3" runat="server" OnClientClick="changePage('next'); return false;"
                        CommandName="Page" CommandArgument="Next" Text="" CssClass="PagerButton NextPage" />
                    <asp:Button ID="Button4" runat="server" OnClientClick="changePage('last'); return false;"
                        CommandName="Page" CommandArgument="Last" Text="" CssClass="PagerButton LastPage" />
                </div>
                <div>
                    <span style="margin-right: 3px;">Page size:</span>
                    <telerik:RadComboBox ID="ddlPageSize" DataSource="<%# new object[]{10, 20, 30, 40, 50} %>"
                        Style="margin-right: 20px;" Width="40px" SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>'
                        runat="server" OnClientSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                    </telerik:RadComboBox>
                </div>
                <asp:Panel runat="server" ID="NumericPagerPlaceHolder" />
            </asp:Panel>
        </PagerTemplate>
        <PagerStyle Mode="NumericPages" PageButtonCount="10" AlwaysVisible="true" />
        <Columns>
            <telerik:GridClientSelectColumn FilterControlAltText="Filter column column" Visible="false"
                UniqueName="selControl">
                <FooterStyle HorizontalAlign="Center" />
                <HeaderStyle HorizontalAlign="Center" Width="40px" />
                <ItemStyle HorizontalAlign="Center" />
            </telerik:GridClientSelectColumn>
            <telerik:GridTemplateColumn HeaderText="" UniqueName="BriefDesc" AllowFiltering="false">
                <ItemTemplate>
                    <table style="border-style: hidden; border-width: 0px; border-color: transparent;
                        empty-cells: hide;">
                        <tr style="border-style: hidden; empty-cells: hide;">
                            <td style="border-style: hidden; empty-cells: hide;">
                                <asp:ImageButton ID="imgPersonalPhoto" runat="server" Width="55px" Height="55px" />
                                <asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>' Visible="false"></asp:Label>
                                <asp:Label ID="lblPersonID" runat="server" Text='<%# Eval("PersonID") %>' Visible="false"></asp:Label>
                                <asp:Label ID="lblContextID1" runat="server" Text='<%# Eval("ContextID1") %>' Visible="false"></asp:Label>
                                <asp:Label ID="lbLinkUrl" runat="server" Text='<%# Eval("LinkUrl") %>' Visible="false"></asp:Label>
                                <asp:Label ID="lblLinkName" runat="server" Text='<%# Eval("LinkName") %>' Visible="false"></asp:Label>
                            </td>
                            <td style="border-style: hidden; empty-cells: hide;">
                                <table style="border-style: none; border-width: 0px; empty-cells: hide; outline-style: none;
                                    border-color: transparent;">
                                    <tr style="border-style: hidden;">
                                        <td style="border-style: hidden;">
                                            <asp:LinkButton ID="lnkName" runat="server" Text='<%# Eval("Name") %>' OnClick="lnkName_Click"
                                                Visible="true" /> 
                                            <asp:LinkButton ID="lnkGroup" runat="server" Visible="false" OnClick="lnkGroup_Click" /> 
                                            <asp:LinkButton ID="lnkHashtag1" runat="server" Visible="false" OnClick="lnkHashtag1_Click" /> 
                                            <asp:LinkButton ID="lnkHashtag2" runat="server" Visible="false" OnClick="lnkHashtag2_Click" /> 
                                            <asp:LinkButton ID="lnkHashtag3" runat="server" Visible="false" OnClick="lnkHashtag3_Click" /> 
                                            <asp:LinkButton ID="lnkHashtag4" runat="server" Visible="false" OnClick="lnkHashtag4_Click" /> 
                                            <asp:LinkButton ID="lnkHashtag5" runat="server" Visible="false" OnClick="lnkHashtag5_Click" /> 
                                            <asp:LinkButton ID="lnkHashtag6" runat="server" Visible="false" OnClick="lnkHashtag6_Click" /> 
                                        </td>
                                    </tr>
                                    <tr style="border-style: hidden; empty-cells: hide;">
                                        <td style="border-style: hidden; empty-cells: hide;">
                                            <asp:Label ID="lblComment" runat="server" Text='<%# Eval("Comment") %>' Visible="True"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                                <table style="border-style: none; border-width: 0px; empty-cells: hide; outline-style: none;
                                    border-color: transparent;">
                                    <tr style="border-style: hidden; empty-cells: hide;">
                                        <td style="border-style: hidden; empty-cells: hide;">
                                            <a href="javascript:;" onclick="javascript:window.open('<%#Eval("LinkUrl") %>  ','','scrollbars=no, status=no, resizable=yes');return false;">
                                                <%# Eval("LinkName") %></a>
                                        </td>
                                    </tr>
                                </table>
                                <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                    border-color: transparent;">
                                    <tr style="border-style: hidden;">
                                        <td style="width: 75px; border-style: hidden; empty-cells: hide;">
                                            <asp:LinkButton ID="btnCollapse" runat="server" CommandName="ExpandCollapse" ToolTip="Collapse"
                                                Visible="False " />
                                            <asp:LinkButton ID="btnExpand" runat="server" CommandName="ExpandCollapse" ToolTip="Expand" />
                                        </td>
                                        <td style="border-style: hidden; empty-cells: hide;">
                                            <asp:LinkButton ID="lnkComment" Width="95px" Text="Post Comment" runat="server"></asp:LinkButton>
                                            <telerik:RadToolTip ID="RadToolTip1" Skin="Vista" runat="server" TargetControlID="lnkComment"
                                                ShowEvent="OnClick" VisibleOnPageLoad="false" Modal="false" Position="BottomCenter"
                                                HideEvent="ManualClose" Width="200px" Height="150px" BackColor="White">
                                                <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                    border-color: transparent; padding-bottom: 10px;">
                                                    <tr style="border-style: hidden; empty-cells: hide;">
                                                        <td style="border-style: hidden; empty-cells: hide;">
                                                            <telerik:RadTextBox ID="txtComment" MaxLength="256" runat="server" Width="550px"
                                                                TextMode="MultiLine" Rows="3" ToolTip="Provide a meaningful Comment">
                                                            </telerik:RadTextBox>
                                                            <telerik:RadUpload ID="uplUploadPhoto" runat="server" Visible="false" ControlObjectsVisibility="None"
                                                                OverwriteExistingFiles="true" Localization-Select="Add" TargetFolder="~/Images/Photos/"
                                                                ToolTip="Click on Add to upload your photo">
                                                            </telerik:RadUpload>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                    border-color: transparent; empty-cells: hide; padding-bottom: 15px;">
                                                    <tr style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <asp:Label ID="lblUrlLabel" runat="server" Text="URL Label:"></asp:Label>
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <telerik:RadTextBox ID="txtUrlLabel" runat="server">
                                                            </telerik:RadTextBox>
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <asp:Label ID="lblUrlLabel1" runat="server" Text="URL:"></asp:Label>
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <telerik:RadTextBox ID="txtUrl" runat="server" Width="250px">
                                                            </telerik:RadTextBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                    border-color: transparent; \">
                                                    <tr style="border-style: hidden; empty-cells: hide;">
                                                        <td style="border-style: hidden; empty-cells: hide;">
                                                            <asp:LinkButton ID="lnkUpload" Width="55px" Text="Upload" Visible="false" runat="server"
                                                                OnClick="lnklnkUpload_Click"></asp:LinkButton>
                                                            <asp:LinkButton ID="lnkShare" runat="server" Text="Post" OnClick="lnkShare_Click" />
                                                        </td>
                                                        <td style="border-style: hidden; empty-cells: hide;">
                                                            <asp:LinkButton ID="lnkCancel" runat="server" OnClick="lnkCancel_Click" Text="Cancel" />
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </telerik:RadToolTip>
                                        </td>
                                        <td style="border-style: hidden; empty-cells: hide;">
                                            <asp:LinkButton ID="lnkEdit" Width="40px" Text="Edit" runat="server"></asp:LinkButton>
                                            <telerik:RadToolTip ID="RadToolTipEdit" Skin="Vista" runat="server" TargetControlID="lnkEdit"
                                                ShowEvent="OnClick" VisibleOnPageLoad="false" Modal="false" Position="BottomCenter"
                                                HideEvent="ManualClose" Width="200px" Height="150px" BackColor="White">
                                                <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                    border-color: transparent; padding-bottom: 10px;">
                                                    <tr style="border-style: hidden; empty-cells: hide;">
                                                        <td style="border-style: hidden; empty-cells: hide;">
                                                            <telerik:RadTextBox ID="txtCommentEdit" MaxLength="256" runat="server" Width="550px"
                                                                TextMode="MultiLine" Rows="3" ToolTip="Provide a meaningful Comment">
                                                            </telerik:RadTextBox>
                                                            <telerik:RadUpload ID="RadUpload1" runat="server" Visible="false" ControlObjectsVisibility="None"
                                                                OverwriteExistingFiles="true" Localization-Select="Add" TargetFolder="~/Images/Photos/"
                                                                ToolTip="Click on Add to upload your photo">
                                                            </telerik:RadUpload>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                    border-color: transparent; empty-cells: hide; padding-bottom: 15px;">
                                                    <tr style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <asp:Label ID="UrlLableEdit" runat="server" Text="URL Label:"></asp:Label>
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <telerik:RadTextBox ID="txtUrlLableEdit" runat="server">
                                                            </telerik:RadTextBox>
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <asp:Label ID="lblUrlEdit" runat="server" Text="URL:"></asp:Label>
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <telerik:RadTextBox ID="txtUrlEdit" runat="server" Width="250px">
                                                            </telerik:RadTextBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                    border-color: transparent; \">
                                                    <tr style="border-style: hidden; empty-cells: hide;">
                                                        <td style="border-style: hidden; empty-cells: hide;">
                                                            <asp:LinkButton ID="LinkButton1" Width="55px" Text="Upload" Visible="false" runat="server"
                                                                OnClick="lnklnkUpload_Click"></asp:LinkButton>
                                                            <asp:LinkButton ID="lnkUpdate" runat="server" Text="Update" OnClick="lnkUpdate_Click" />
                                                        </td>
                                                        <td style="border-style: hidden; empty-cells: hide;">
                                                            <asp:LinkButton ID="lnkCancelEdit" runat="server" OnClick="lnkCancelEdit_Click" Text="Cancel" />
                                                        </td>
                                                        <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                            border-color: transparent;">
                                                            <asp:Label ID="lblErrorEdit" runat="server" ForeColor="Red"></asp:Label>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </telerik:RadToolTip>
                                        </td>
                                        <td style="border-style: hidden; empty-cells: hide;">
                                            <asp:LinkButton ID="lnkDelete" Width="40px" Text="Delete" runat="server" OnClientClick="javascript:return confirm('Delete Comment?')"
                                                OnClick="lnkdelete_Click"></asp:LinkButton>
                                        </td>
                                        <td style="border-style: hidden; empty-cells: hide;">
                                            <asp:Label ID="lblTimeStamp" runat="server" Text='<%# Eval("Timestamp") %>' Visible="True"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <DetailTables>
            <telerik:GridTableView DataKeyNames="ID" DataSourceID="SqlActivityStreamResponse"
                runat="server" CommandItemDisplay="Top" ClientSettings-Selecting-AllowRowSelect="True"
                Skin="Vista" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                ClientSettings-Scrolling-AllowScroll="true" ClientSettings-Scrolling-UseStaticHeaders="true"
                EditMode="PopUp" CssClass="innerGridBorder">
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="false"></PagerStyle>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" />
                </ParentTableRelation>
                <CommandItemTemplate>
                </CommandItemTemplate>
                <CommandItemSettings ExportToPdfText="Export to Pdf" ShowExportToExcelButton="True"
                    ShowExportToPdfButton="True"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="False" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="" UniqueName="BriefDesc" AllowFiltering="false">
                        <ItemTemplate>
                            <table style="border-style: hidden; border-width: 0px;">
                                <tr style="border-style: hidden;">
                                    <td style="border-style: hidden;">
                                        <asp:ImageButton ID="imgPersonalPhoto" runat="server" Width="55px" Height="55px" />
                                    </td>
                                    <td style="border-style: hidden;">
                                        <table style="border-style: none; border-width: 0px; empty-cells: hide">
                                            <tr style="border-style: hidden;">
                                                <td style="border-style: hidden;">
                                                    <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>' Visible="True"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr style="border-style: hidden;">
                                                <td style="border-style: hidden;">
                                                    <asp:Label ID="lblComment" runat="server" Text='<%# Eval("Comment") %>' Visible="True"></asp:Label>
                                                </td>
                                            </tr>
                                            <table style="border-style: none; border-width: 0px; empty-cells: hide; outline-style: none;
                                                border-color: transparent;">
                                                <tr style="border-style: hidden; empty-cells: hide;">
                                                    <td style="border-style: hidden; empty-cells: hide;">
                                                        <a href="javascript:;" onclick="javascript:window.open('<%#Eval("LinkUrl") %>  ','','scrollbars=no, status=no, resizable=yes');return false;">
                                                            <%# Eval("LinkName") %></a>
                                                    </td>
                                                </tr>
                                            </table>
                                    </td>
                                </tr>
                            </table>
                            <table style="border-style: hidden; border-width: 0px;">
                                <tr style="border-style: hidden;">
                                    <td style="border-style: hidden; padding-left: 65px">
                                    </td>
                                    <td style="border-style: hidden; empty-cells: hide;">
                                        <asp:LinkButton ID="lnkEditComment" Width="40px" Text="Edit" runat="server"></asp:LinkButton>
                                        <telerik:RadToolTip ID="RadToolTipEditComment" Skin="Vista" runat="server" TargetControlID="lnkEditComment"
                                            ShowEvent="OnClick" VisibleOnPageLoad="false" Modal="false" Position="BottomCenter"
                                            HideEvent="ManualClose" Width="200px" Height="150px" BackColor="White">
                                            <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                border-color: transparent; padding-bottom: 10px;">
                                                <tr style="border-style: hidden; empty-cells: hide;">
                                                    <td style="border-style: hidden; empty-cells: hide;">
                                                        <telerik:RadTextBox ID="txtCommentEditComment" MaxLength="256" runat="server" Width="550px"
                                                            TextMode="MultiLine" Rows="3" ToolTip="Provide a meaningful Comment">
                                                        </telerik:RadTextBox>
                                                        <telerik:RadUpload ID="RadUpload1" runat="server" Visible="false" ControlObjectsVisibility="None"
                                                            OverwriteExistingFiles="true" Localization-Select="Add" TargetFolder="~/Images/Photos/"
                                                            ToolTip="Click on Add to upload your photo">
                                                        </telerik:RadUpload>
                                                    </td>
                                                </tr>
                                            </table>
                                            <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                border-color: transparent; empty-cells: hide; padding-bottom: 15px;">
                                                <tr style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                    border-color: transparent;">
                                                    <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                        <asp:Label ID="UrlLableEdit" runat="server" Text="URL Label:"></asp:Label>
                                                    </td>
                                                    <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                        <telerik:RadTextBox ID="txtUrlLableEditComment" runat="server">
                                                        </telerik:RadTextBox>
                                                    </td>
                                                    <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                    </td>
                                                    <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                        <asp:Label ID="lblUrlEdit" runat="server" Text="URL:"></asp:Label>
                                                    </td>
                                                    <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                        <telerik:RadTextBox ID="txtUrlEditComment" runat="server" Width="250px">
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                            <table style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                border-color: transparent; \">
                                                <tr style="border-style: hidden; empty-cells: hide;">
                                                    <td style="border-style: hidden; empty-cells: hide;">
                                                        <asp:LinkButton ID="lnkUpdateComment" Width="55px" Text="Upload" Visible="false"
                                                            runat="server" OnClick="lnklnkUpload_Click"></asp:LinkButton>
                                                        <asp:LinkButton ID="lnkUpdate" runat="server" Text="Update" OnClick="lnkUpdateCommment_Click" />
                                                    </td>
                                                    <td style="border-style: hidden; empty-cells: hide;">
                                                        <asp:LinkButton ID="lnkCancelEditComment" runat="server" OnClick="lnkCancelEditComment_Click"
                                                            Text="Cancel" />
                                                    </td>
                                                    <td style="border-style: hidden; border-width: 0px; empty-cells: hide; outline-style: none;
                                                        border-color: transparent;">
                                                        <asp:Label ID="lblErrorEditComment" runat="server" ForeColor="Red"></asp:Label>
                                                    </td>
                                                </tr>
                                            </table>
                                        </telerik:RadToolTip>
                                    </td>
                                    <td style="border-style: hidden;">
                                        <asp:LinkButton ID="lnkDelete" Width="40px" Text="Delete" runat="server" OnClientClick="javascript:return confirm('Delete Comment?')"
                                            OnClick="lnkdelete_Click"></asp:LinkButton>
                                    </td>
                                    <td style="border-style: hidden;">
                                        <asp:Label ID="lblTimeStamp" runat="server" Text='<%# Eval("Timestamp") %>' Visible="True"></asp:Label>
                                        <asp:Label ID="lblPersonID" runat="server" Text='<%# Eval("PersonID") %>' Visible="false"></asp:Label>
                                        <asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>' Visible="false"></asp:Label>
                                        <asp:Label ID="lblLinkName" runat="server" Text='<%# Eval("LinkName") %>' Visible="false"></asp:Label>
                                        <asp:Label ID="lblLinkUrl" runat="server" Text='<%# Eval("LinkUrl") %>' Visible="false"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            </td> </tr> </table>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
    <ClientSettings EnableRowHoverStyle="true" AllowKeyboardNavigation="true">
        <ClientEvents OnGridCreated="GridCreated" />
        <Selecting AllowRowSelect="True"></Selecting>
        <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
    </ClientSettings>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>

Paul
Top achievements
Rank 1
 answered on 16 Sep 2013
2 answers
99 views
Hi Guys,

I have the following RadGrid

<telerik:RadGrid ID="grdIncidents" Height="890px" runat="server" OnItemCreated="grdIncidents_ItemCreated"
                    AllowAutomaticInserts="True" AutoGenerateColumns="False" OnNeedDataSource="grdIncidents_NeedDataSource"
                    meta:resourcekey="grdIncidentsResource1" AllowPaging="True" PageSize="15" AllowSorting="True" OnDeleteCommand="grdIncidents_DeleteCommand"
                    CellSpacing="0" GridLines="None" onprerender="grdIncidents_PreRender">
 
                    <ClientSettings Scrolling-AllowScroll="false">
                        <Selecting CellSelectionMode="None"></Selecting>
                    </ClientSettings>
 
                    <MasterTableView DataKeyNames="IncidentID" ClientDataKeyNames="IncidentID" CommandItemDisplay="Top">
                     
                    <Columns>
                        <telerik:GridBoundColumn DataField="Status" HeaderText="Status" ItemStyle-Font-Names="Calibri" meta:resourcekey="GridBoundColumnResource1"
                                                 Resizable="False" UniqueName="Status" ReadOnly="True" Reorderable="False" ShowSortIcon="False">
 
                            <FooterStyle HorizontalAlign="Center" Width="20px" Wrap="True" />
                            <HeaderStyle HorizontalAlign="Center" Width="20px" Wrap="True" />
                            <ItemStyle Font-Names="Calibri" HorizontalAlign="Center" Width="20px" Wrap="True" />
                        </telerik:GridBoundColumn>
 
                           <telerik:GridBoundColumn DataField="AccountDetails"
                                HeaderText="Account<br/>Site<br/>Location"
                                meta:resourcekey="GridBoundColumnResource4" UniqueName="AccountDetails" Resizable="False"/>
                             
                            <telerik:GridBoundColumn DataField="ProductDetails"
                                HeaderText="Product<br/>Component"
                                meta:resourcekey="GridBoundColumnResource5" UniqueName="ProductDetails" Resizable="False"/>
 
                            <telerik:GridHyperLinkColumn FooterText="HyperLinkColumn footer" UniqueName="IncidentType" HeaderText="Title</br>Reference" DataTextField="IncidentType" NavigateUrl="#">
                            </telerik:GridHyperLinkColumn>
                             
                            <telerik:GridBoundColumn DataField="DepartmentDetails"
                                HeaderText="Department<br/>Category"
                                meta:resourcekey="GridBoundColumnResource6" UniqueName="DepartmentDetails" Resizable="False"/>
                             
                            <telerik:GridBoundColumn DataField="CurrentAssignedPerson.FullName"
                                HeaderText="Assigned User" meta:resourcekey="GridBoundColumnResource8" UniqueName="Assigned" Resizable="False"/>
                             
                            <telerik:GridBoundColumn DataField="LoggedDate" HeaderText="Incident Log Date"
                                meta:resourcekey="GridBoundColumnResource9" UniqueName="LoggedDate" />
 
                            <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                            <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="EditLink" runat="server" Text="Edit"><img src="../Images/icons/pencil.png" class="editPics"></asp:HyperLink>
                                    <br>Edit
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
 
                            <telerik:GridTemplateColumn UniqueName="ActionColumn">
                            <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="ActionLink" Text="Action" runat="server"><img src="../Images/icons/action.png" class="editPics"></asp:HyperLink>
                                    <br>Action
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
 
                            <telerik:GridButtonColumn UniqueName="GridDeleteButton" ConfirmText="Are you sure that you would like \nto delete this incident?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
 
                        </Columns>
 
                        <CommandItemTemplate>
                            <div id="AddIncidentDiv" runat="server" style="padding: 4px 7px 4px; text-align:right;">
                                <asp:ImageButton ID="btnAdd" runat="server" ToolTip="Add New Incident" ImageUrl="../Images/icons/add.png" OnClientClick="return ShowInsertForm();"/>
                            </div>
                        </CommandItemTemplate>
                    </MasterTableView>
                </telerik:RadGrid>

The GridHyperLinks are being populated with reference numbers, each Item in the Grid has a different reference number, what i need is when a client clicks on the reference number it opens a RadWindow and passes the IncidentID to the window aswel.

The following Grid ItemTemplate 'TemplateEditColumn' does exactly what i want, our client has asked us to remove this ItemTemplate and wants the RadWindow Opened when he clicks on the Reference number(Gridhyperlink)
.

How would i move the following functionality to the GridHyperLinkColumn?

<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
          <ItemStyle HorizontalAlign="Center" />
                   <ItemTemplate>
                    <asp:HyperLink ID="EditLink" runat="server" Text="Edit"><img src="../Images/icons/pencil.png" class="editPics"></asp:HyperLink>
           <br>Edit
         </ItemTemplate>
</telerik:GridTemplateColumn>

C# code behind
protected void grdIncidents_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
                editLink.Attributes["href"] = "#";
                editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IncidentID"], e.Item.ItemIndex);
            }
        }
newguy
Top achievements
Rank 1
 answered on 16 Sep 2013
3 answers
163 views
Hi, I just started learning your great controls. I have created a simple grid asp web site, and it works fine on my developmnet computer.

But then i've tried to deploy it. I have a discountasp account, uploaded all the files, but when i've checked the page from explorer, the controls are missing, it looks like a simple HTML page with standard controls!!!

Yo can check it here:
http://www.mallorcaaldia.com/test/Default.aspx

I've read the documentation, and it seems that i have to create a Telerik folder, and upload some files, but i can not find this file...

I'm using the trial yet...

Thanks a lot!!
David
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 16 Sep 2013
1 answer
97 views
<asp:UpdatePanel ID="uplstAddress" runat="server">
                                   <ContentTemplate>
                                       <ITG:ITG_ListView ID="lsvMainAddress" runat="server" OnItemCommand="lsvMainAddress_ItemCommand" OnPreRender="lsvMainAddress_PreRender"
                                            ItemPlaceholderID   ="ContactAddressContainer" DataKeyNames="ADDRESS_ID,ISPRIMARY" AllowPaging="True" OnPageIndexChanged="lsvMainAddress_PageIndexChanged" OnPageSizeChanged="lsvMainAddress_PageSizeChanged" OnItemDataBound="lsvMainAddress_ItemDataBound"
                                           PageSize="1" meta:resourcekey="lsvMainAddress1">
 
                                           <LayoutTemplate>
                                               <fieldset>
                                                   <legend>
                                                       <asp:Label ID="lblContactAddTitle" runat="server" Text="Contact Addresses" meta:resourcekey="TitleAddress"></asp:Label>
                                                   </legend>
                                                   <asp:PlaceHolder ID="ContactAddressContainer" runat="server" EnableViewState="false"></asp:PlaceHolder>
                                                   <div style="clear: both"></div>
 
                                                   <uc3:ucCustomPaging runat="server" ID="oucCustomPagingAddress" />
                                               </fieldset>
                                           </LayoutTemplate>
 
                                           <ItemTemplate>
                                               <fieldset ondblclick='row_doubleclick("<%#Container.DisplayIndex %>")'>
                                                   <legend>
                                                   </legend>
                                                   <table>
                                                        <tr>
                                                           <td colspan="2">
                                                               <asp:CheckBox ID="chkDetailsAddressEdit" runat="server" />
                                                           </td>
                                                            <asp:HiddenField ID="hfAddressEdit" runat="server" Value='<%# Eval("ADDRESS_ID")%>' />
                                                       </tr>
                                                       <tr>
                                                           <td style="width: 100px;">
                                                               <asp:Label ID="lblISPrimaryAddress" runat="server" Text="Primary Address" meta:resourcekey="lblPrimaryDResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
                                                           <td>                   
                                                               <asp:RadioButton ID="rdPrimaryAddressEdit" runat="server" OnCheckedChanged="rdPrimaryAddressEdit_CheckedChanged" CausesValidation="false" AutoPostBack="true"/>
                                                               <asp:HiddenField ID="hfEditPrimary" runat="server" Value='<%# Eval("ISPRIMARY")%>' />
                                                           </td>
                                                       </tr>
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblCountryView" runat="server" Text="Country" meta:resourcekey="lblCOUNTRY_IDResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("LangCountryDesc")%>
                                                           </td>
                                                       </tr>
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblCityView" runat="server" Text="City" meta:resourcekey="lblCITYResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("CITY")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblStreetView" runat="server" Text="Street" meta:resourcekey="lblSTREETResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("STREET")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblStatusView" runat="server" Text="Status" meta:resourcekey="lblSTATUS_IDResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("LangStatusDesc")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblStateView" runat="server" Text="State" meta:resourcekey="lblSTATEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("STATE")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblZipCodeView" runat="server" Text="Zip Code" meta:resourcekey="lblZIPCODEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("ZIPCODE")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblPhoneView" runat="server" Text="Phone No." meta:resourcekey="lblPHONEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("PHONE")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblMobileView" runat="server" Text="Mobile No." meta:resourcekey="lblMOBILEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("MOBILE")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblFaxView" runat="server" Text="Fax No." meta:resourcekey="lblFAXResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("FAX")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblMailView" runat="server" Text="E-Mail" meta:resourcekey="lblEMAILResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("EMAIL")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblWebSiteView" runat="server" Text="Web Site" meta:resourcekey="lblWEBSITEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <%#Eval("WEBSITE")%>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblCreationDateView" runat="server" Text="Creation Date" meta:resourcekey="lblCreationdateVeiwResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
                                                           <td>
                                                               <%#Eval("CREATIONDATE", "{0:dd/MM/yyyy}")%>
                                                           </td>
                                                       </tr>
 
                                                   </table>
 
                                               </fieldset>
                                           </ItemTemplate>
 
                                           <EditItemTemplate>
 
                                               <fieldset>
                                                   <legend>
                                                       <asp:Label ID="lbltest" runat="server" Text="Edittable Template"></asp:Label>
                                                   </legend>
 
                                                   <table>
 
                                                       <tr>
                                                           <td style="width: 100px;">
                                                               <asp:Label ID="lblCountryViewEditTemplate" runat="server" Text="Country" meta:resourcekey="lblCOUNTRY_IDResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbCountryEditTemplate" Text='<%#Bind("LangCountryDesc")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblCityViewEditTemplate" runat="server" Text="City" meta:resourcekey="lblCITYResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbCityEditTemplate" Text='<%#Bind("CITY")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblStreetViewEditTemplate" runat="server" Text="Street" meta:resourcekey="lblSTREETResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbStreetEditTemplate" Text='<%#Bind("STREET")%>' runat="server"></ITG:ITG_TextBox>
 
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblStatusViewEditTemplate" runat="server" Text="Status" meta:resourcekey="lblSTATUS_IDResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbStatusEditTemplate" Text='<%#Bind("LangStatusDesc")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblStateViewEditTemplate" runat="server" Text="State" meta:resourcekey="lblSTATEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbStateEditTemplate" Text='<%#Bind("STATE")%>' runat="server"></ITG:ITG_TextBox>
 
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblZipCodeViewEditTemplate" runat="server" Text="Zip Code" meta:resourcekey="lblZIPCODEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbZIPCODEditTemplateEdit" Text='<%#Bind("ZIPCODE")%>' runat="server"></ITG:ITG_TextBox>
 
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblPhoneViewEditTemplate" runat="server" Text="Phone No." meta:resourcekey="lblPHONEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbPhoneEditTemplateEdit" Text='<%#Bind("PHONE")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblMobileViewEditTemplate" runat="server" Text="Mobile No." meta:resourcekey="lblMOBILEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbMobileEditTemplateEdit" Text='<%#Bind("MOBILE")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblFaxViewEditTemplate" runat="server" Text="Fax No." meta:resourcekey="lblFAXResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbFaxEditTemplateEdit" Text='<%#Bind("FAX")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblMailViewEditTemplate" runat="server" Text="E-Mail" meta:resourcekey="lblEMAILResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbEmailEditTemplateEdit" Text='<%#Bind("EMAIL")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                       <tr>
                                                           <td>
                                                               <asp:Label ID="lblWebSiteViewEditTemplate" runat="server" Text="Web Site" meta:resourcekey="lblWEBSITEResource1"></asp:Label>
                                                           </td>
                                                           <td class="DoubleDot">:
                                                           </td>
 
                                                           <td>
                                                               <ITG:ITG_TextBox ID="tbWebSiteEditTemplateEdit" Text='<%#Bind("WEBSITE")%>' runat="server"></ITG:ITG_TextBox>
                                                           </td>
                                                       </tr>
 
                                                   </table>
 
                                               </fieldset>
 
                                           </EditItemTemplate>
 
                                       </ITG:ITG_ListView>
                                   </ContentTemplate>
                               </asp:UpdatePanel>

Java Script Function
   <telerik:RadCodeBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function row_doubleclick(index) {
                //set item into edit mode
                $find("<%=lsvMainAddress.ClientID %>").editItem(index);
                 
            }
            </script>
    </telerik:RadCodeBlock>
Dears, Telerik Team

When i Clicked On ListView Item ; Javascript  function "row_doubleclick" fired.

but cannot Awitch To EditMode , and if doucleclick again the Message "Inner Excpetion" Show as:

"Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request."

Please, Help ........!

Konstantin Dikov
Telerik team
 answered on 16 Sep 2013
3 answers
262 views

Hi

I am using Rad scheuler for setting appointments for doctors in a hospital.That means its a part of a big hospital management project.

My problem is

When I drag an appointment under one doctor(yes one resource)  to another doctor it shows the following error.
And it is happening sometimes only.I  mean for some particular resources only , the problem occuring.But the data in the database for all the resources are the same.
 

Server Error in '/HMSWeb' Application.

Insertion index was out of range. Must be non-negative and less than or equal to size.
Parameter name: index

 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Insertion index was out of range. Must be non-negative and less than or equal to size.
Parameter name: index

Source Error:

 

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 

Please help me ASAp.Its very very urgent :(

Regards
Chinnu

Simon
Top achievements
Rank 1
 answered on 16 Sep 2013
0 answers
133 views
I have 2 radiobuttons on my grid that are mutually exclussive and i also have on checkbox. This 2 radiobuttons are enabled/disabled when i click on the checkbox using javascript function. I have in the code behind the method manageSelected which are call while clicking on the button save. Initially the 2 radiobuttons are enabled.  Without the javascript function all thing work fine(i can check one of the radiobutton and save his value). My issue is that when i apply the javascript it work only in one way(I can change my object property value from value of radiobutton1 to the one of radiobutton2 and not mutual).
 

My file.aspx
<tr>
                    <td>
                        <asp:CheckBox ID="rbDiscountGoodCalcTypeSet" runat="server" BackColor="red" onchange="onChangeDiscountGoodCalcType()"/>
                        <asp:Label ID="lbDiscountGoodCalcType" runat="server" Text="<%$ Resources: Common, DiscountGoodCalcType %>"></asp:Label>
                    </td>
                    <td colspan="3">                      
                        <asp:RadioButton ID="rbDiscountGoodCalcType1" GroupName="DiscountGoodCalcType" runat="server"
                            Text="<%$ Resources: Common, ByQuantity %>" Checked='<%# Eval("DiscountGoodCalcType").ToString() == "0" %>' Enabled="false"/>
                        <asp:RadioButton ID="rbDiscountGoodCalcType2" GroupName="DiscountGoodCalcType" runat="server"
                            Text="<%$ Resources: Common, ByValue %>" Checked='<%# Eval("DiscountGoodCalcType").ToString() == "1" %>' Enabled="false"/>
                    </td>
                </tr>

My javascript function
function onChangeDiscountGoodCalcType() {
            var sourceName = window.event.srcElement.id;
            var targetName1 = sourceName.substring(0, (sourceName.length - 3)) + "1";
            var targetName2 = sourceName.substring(0, (sourceName.length - 3)) + "2";
 
            var cmdObj = $("#" + sourceName)[0];
            var targetObj1 = $("#" + targetName1)[0];
            var targetObj2 = $("#" + targetName2)[0];
 
            targetObj1.disabled = !cmdObj.checked;
            targetObj2.disabled = !cmdObj.checked;
        }

My savebutton call this method for the control
private void Manage4Line()
        {
            if (rbDiscountGoodCalcTypeSet.Checked)
                DiscountGoodCalcType = (rbDiscountGoodCalcType1.Checked) ? 0 : 1;
        }

Thanks
Colince
Top achievements
Rank 1
 asked on 16 Sep 2013
4 answers
162 views
I have a page with a relatively conventional RadTabStrip/RadMultipage/RadPageView set up.   I also have a RadAjaxManager setup so that for certain values of a RadComboBox in the first RadPageView (the first tab), a second tab becomes visible.  So far, so good.

Up till now I've had three ASCXs in the second RadPageView and I've manipulated them through Ajax so that they're visible when needed.

What I would like to do (given that the number of ASCXs may increase) is dynamically load them instead.

For my load I'm doing the following:

Control1 = (ControlType1)this.LoadControl("Control1.ascx");
Then I do a
Panel1.Controls.Add(Control1);

I've tried a number of variations including putting the control in an ASP:Panel in the 2nd RadPageView.  Display is not a problem but when it comes time to save, the Find for the control always returns null.   

What would be the best approach for a situation like this?
Boris
Top achievements
Rank 1
 answered on 16 Sep 2013
5 answers
153 views
Hi,

I have a RadGrid with a EditCommandColumn. In the headercontextmenu this column can be hidden when I choose Columns (see screenshot). How can I hide this column from the headercontextmenu?

Paul
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Sep 2013
5 answers
148 views
 I am trying to export RadGrid data to CSV format but the button is not working
 i added onRequestStart also but nothing is happening. Then i find
 the issue from firebug it firstly finding my grid and experotCSV function and
 then returning to false.

if(!$find('gvLoginDetail_ctl00').exportToCsv()) return false;__doPostBack('gvLoginDetail$ctl00$ctl02$ctl00$ExportToCsvButton','')
It is a default function of RADGRID tell me
how to remove the below line.

if(!$find('gvLoginDetail_ctl00').exportToCsv()) return false;
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?