Telerik Forums
UI for ASP.NET AJAX Forum
15 answers
188 views
Hi ,

I am using Telerik RadGrid in my application having multilevel hierachy i.e the Master table has a detail table which again has one more detail table.Export to excel with same grid is working fine but I am facing the following two issues with export to word.
1.  When I try to export the grid details to word only the first row of the grid is expanded and completely exported and the other rows are not not expanded only the Master Table rows are displayed.
2. When I again click the export to word only the parent i.e master table rows are exported to the doc file.

I have used the disable ajax for export and set the following properties to the grid

 
grid.MasterTableView.HierarchyDefaultExpanded = true;
            if (grid.MasterTableView.HasDetailTables)
            {
                foreach (GridTableView gridTableView in grid.MasterTableView.DetailTables)
                {
                    // Added by partner CB to Fix defect 15597
                    gridTableView.AllowPaging = false;
                    gridTableView.HierarchyDefaultExpanded = true;
                }
            }
           
grid.ItemCreated += new GridItemEventHandler(RadGrid_ItemCreated);
            grid.ExportSettings.ExportOnlyData = true;
            grid.ExportSettings.IgnorePaging = true;
            grid.ExportSettings.OpenInNewWindow = true;

  grid.MasterTableView.ExpandCollapseColumn.Display = false;
        grid.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
        grid.MasterTableView.DetailTables[0].ExpandCollapseColumn.Display = false;
        grid.MasterTableView.DetailTables[0].DetailTables[0].ExpandCollapseColumn.Display = false;


Please help me in this.

Thanks,
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
4 answers
166 views

Hi,

I have a user control inside a sliding pane.  The user control is a container for 5 other child user controls.  Each of the 5 user controls is a search criteria that I will have it expanded as default.  The problem I'm having is when they all expanded, the vertical scroll bar only has effect on the PanelBars but the content of each child user controls does not scroll.  I've been searching on the forum but couldn't find one that's similar to mine (I guess no one made the same mistake like I have).  Could you please tell me if I'm setting up something incorrectly with RadPanel? I have also attached a screen shot to show you the problem.

This is the code of my page that has main search container:

<telerik:RadPane ID="LeftPane" runat="server" Width="22px"  >
    <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" Scrolling="None">
        <!-- Search Pane -->
        <telerik:RadSlidingPane ID="LeadSearchSlidePane" Title="Search Criteria" runat="server">
             <uc1:LeadSearchCriteria runat="server" ID="LeadSearchCriteria" />
        </telerik:RadSlidingPane>
         <!-- Grid Pane -->
        <telerik:RadSlidingPane ID="GridListSlidePane" Title="Grid View" runat="server" Scrolling="None" OnClientExpanding="ExpandGridPane" OnClientDocked="ExpandGridPane" >
             <uc2:LeadSearchGridView runat="server" ID="LeadSearchGridView" />
        </telerik:RadSlidingPane>
    </telerik:RadSlidingZone>
</telerik:RadPane>

ascx for Search container user control :
<style type="text/css">
    .searchpane {
        width:inherit;
        height:inherit;
        overflow:auto !important; /* with this line, the control will not adjust in the RadPane correctly */
    }
 
</style>
 
 
<div class="searchpane">
     
    <div>
        <telerik:RadButton ID="RadSearchButton" runat="server" Text="Search" OnClick="RadSearchButton_Click" />
        <telerik:RadButton ID="RadSaveSearchButton" runat="server" Text="Save"  />
    </div>
 
    <telerik:RadPanelBar ID="RadSearchPanelBar" runat="server" Width="100%"  Height="90%" ExpandMode="MultipleExpandedItems" >
        <Items>
            <telerik:RadPanelItem runat="server" Text="Date" Expanded="true"   >
                <ContentTemplate>
                    <div style="position:inherit">
                    <uc1:CriteriaDate runat="server" ID="CriteriaDate"  />
                    </div>
                </ContentTemplate>
            </telerik:RadPanelItem>   
            <telerik:RadPanelItem runat="server" Text="Company" Expanded="true" >
                <ContentTemplate>
                    <uc2:CriteriaCompany runat="server" ID="CriteriaCompany" />
                </ContentTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Status" Expanded="true" >
                <ContentTemplate>
                    <uc3:CriteriaStatus runat="server" ID="CriteriaStatus" />
                </ContentTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Activity Status" Expanded="true" >
                <ContentTemplate>
                    <uc4:CriteriaActivityStatus runat="server" ID="CriteriaActivityStatus" />
                </ContentTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Saved Search" Expanded="true" >
                <ContentTemplate>
                    <uc5:CriteriaSavedSearch runat="server" ID="CriteriaSavedSearch" />
                </ContentTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Dummy test panel" Expanded="true" >
                <ContentTemplate>
                    <uc2:CriteriaCompany runat="server" ID="CriteriaCompany1" />
                </ContentTemplate>
            </telerik:RadPanelItem>
        </Items>
 
    </telerik:RadPanelBar>  
         
</div>

One of the search criteria user control (child):

<style type="text/css">
    .companycriteria {
        width:inherit;
        height:inherit;
         
    }
</style>
 
<div class="companycriteria">
    <div style="float:right">
        <asp:CheckBox ID="IncludeDateInCriteriaCheckBox" Text="Include in search" runat="server" />
    </div>
    <div>
        <div><asp:Label ID="Label2" runat="server" Text="Company: " /><telerik:RadTextBox ID="RadCompanyTextBox" runat="server" /></div>
        <div><asp:Label ID="Label3" runat="server" Text="Provider: " /><asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList></div>
        <div><asp:Label ID="Label4" runat="server" Text="Contact: " /><telerik:RadTextBox ID="RadContactTextBox" runat="server" /></div>
        <div><asp:Label ID="Label5" runat="server" Text="Street: " /><telerik:RadTextBox ID="RadStreetTextBox" runat="server" /></div>
        <div><asp:Label ID="Label6" runat="server" Text="Zip: " /><telerik:RadTextBox ID="RadZipTextBox" runat="server" /></div>
        <div><asp:Label ID="Label7" runat="server" Text="Phone: " /><telerik:RadTextBox ID="RadPhoneTextBox" runat="server" /></div>
        <div><asp:Label ID="Label8" runat="server" Text="Agent: " /><telerik:RadTextBox ID="RadAgentTextBox" runat="server" /></div>
    </div>
</div>

Thank you in advance for taking the time to help me out.

Helen
Magdalena
Telerik team
 answered on 18 Jul 2014
3 answers
931 views
Good afternoon,
I have following RadGrid in my aspx page:

<telerik:RadGrid ID="EmplReqGrid" runat="server" Skin="Office2010Blue"
GridLines="None" AllowPaging="true" AllowSorting="true"
onexcelmlexportrowcreated="EmplReqGrid_ExcelMLExportRowCreated"
onexcelmlexportstylescreated="EmplReqGrid_ExcelMLExportStylesCreated"
onitemcommand="EmplReqGrid_ItemCommand" onitemcreated="EmplReqGrid_ItemCreated"
onitemdatabound="EmplReqGrid_ItemDataBound"
onneeddatasource="EmplReqGrid_NeedDataSource"
onpageindexchanged="EmplReqGrid_PageIndexChanged"
onpagesizechanged="EmplReqGrid_PageSizeChanged"
onpdfexporting="EmplReqGrid_PdfExporting"
onsortcommand="EmplReqGrid_SortCommand">
<ExportSettings FileName="EmplReqRpt" OpenInNewWindow="true" IgnorePaging="true" ExportOnlyData="true">
<Excel Format="ExcelML" FileExtension="xls"/>
<Pdf FontType="Subset" PaperSize="letter" />
</ExportSettings>
<MasterTableView AutoGenerateColumns="false" AllowMultiColumnSorting="true" >

<Columns>

<telerik:GridBoundColumn HeaderText="Eis-Id" DataField="PRI" UniqueName="PRI" ReadOnly="True" SortExpression="PRI" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="ReqNo" DataField="TRKNO" UniqueName="TRKNO" ReadOnly="True" SortExpression="TRKNO" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="Term-Id" DataField="TERMID" UniqueName="TERMID" ReadOnly="True" SortExpression="TERMID" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Start Date" DataField="TERMST" UniqueName="TERMST" ReadOnly="true" DataFormatString="{0:MM/dd/yyyy}" SortExpression="TERMST" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="End Date" DataField="TERMEND" UniqueName="TERMEND" ReadOnly="true" DataFormatString="{0:MM/dd/yyyy}" SortExpression="TERMEND" HeaderButtonType="TextButton">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="No of Periods" DataField="NUMP" UniqueName="NUMP" ReadOnly="True" SortExpression="NUMP" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>


<telerik:GridBoundColumn HeaderText="Req Status" DataField="APPRFLAG" UniqueName="APPRFLAG" ReadOnly="True" SortExpression="APPRFLAG" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>


<telerik:GridBoundColumn HeaderText="Rec Status" DataField="STATUS" UniqueName="STATUS" ReadOnly="True" SortExpression="STATUS" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Req Status Date" DataField="FORMDATE" UniqueName="FORMDATE" ReadOnly="True" DataFormatString="{0:MM/dd/yyyy}" SortExpression="FORMDATE" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Link to Form Button" UniqueName="ButtonColumn">
<ItemTemplate>
<asp:ImageButton ID="ReqFormBtn" ImageUrl="~/Image/update.jpg"
BackColor="transparent" ImageAlign ="Top"
ToolTip="update,re-submit or print the request" runat="server" CommandName="Redirect" />

</ItemTemplate>
</telerik:GridTemplateColumn>

</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick = "false">
<Selecting AllowRowSelect="false" />
</ClientSettings>
</telerik:RadGrid>

In code behind I press on Export to Excel button:

protected void ExporttoExcel_Click1(object sender, ImageClickEventArgs e)
{
try
{
if (!IsPostBack)
return;
RadGrid ReqInfoGrid = (RadGrid)EmpReqReport.FindItemByValue("EmployeeData").FindControl("EmplReqGrid");
ReqInfoGrid.DataSource = Session["dtGrid"];
ReqInfoGrid.DataBind();
ReqInfoGrid.MasterTableView.ExportToExcel();
}
catch (Exception ex)
{
throw;
}
}

For some reason excel spreadsheet not open instead I am getting error window:
'The file is corrupt and cannot be opened'.

Please help me to resolve this issue.
Thanks so much.
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
3 answers
100 views
Does the spell checker recognize plurals?
For Ex: forums. It is providing suggestion to change the text.
Any suggestions?
Marin Bratanov
Telerik team
 answered on 18 Jul 2014
3 answers
114 views
Hi

I have implemented rad grid with scrolling, and I have set grid width to 99% and height to 650px.
everything works fine till I resize any column in the grid.

once I resize the column grid looses its horizontal scroll bar and it expands the whole page with grid's width.

in turn scrollbar appears for web page.

Please help me to retain horizontal scroll for grid.

Thanks
Marin Bratanov
Telerik team
 answered on 18 Jul 2014
1 answer
97 views
Hi,

in my cause I have a RadCombobox with EnabledAutomaticLoadOnDemand = true and ItemsPerRequest = 10.
I can add a new RadComboBoxItem and have a postback on my page.

Now I have to set the new item after the postback as selected item.
The problem is, the new item is not in the first requested 10 items and combo.findItemByValue(value) will not find the item for me.
How can I find items not requested yet? I can see you guys have a solution for this because the filtering shows none requested items in the DropDown.

Maybe you can help me?

Thanks!

With kind regards
Michael
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2014
6 answers
172 views
Hi,
I have added some custom header menus (e.g Export to CSV) to my RadGrid. They work fine with the MasterTable.

But when I right click on Detail Table header, same menus are displayed as master table.

I want to hide my custom menu when user right clicks Detail Table header.

I tried to check in HeaderContextMenu.OnClientShowing client event, but I am not able to get any property to confirm if it is Master Table or Detail Table.

Is there a way to Identify if header menu is being displayed for Master Table or Detail Table?

Thanks!!
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
1 answer
199 views
I have a RadButton that looks like this

<telerik:RadButton ID="btnCancelRegistration" runat="server" Width="691px" Height="144px"
                     SingleClick="False" NavigateUrl="<%$Resources:, btnCancelRegistrationResource1.NavigateUrl %>" ButtonType="LinkButton" Target="_blank" Text="Moved On?" AutoPostBack="False">
                     <Icon PrimaryIconCssClass="<%$Resources:, btnCancelRegistrationResource1.PrimaryIconClass %>" PrimaryIconWidth="700px" PrimaryIconHeight="150px" PrimaryIconLeft="0" PrimaryIconTop="0" />
                 </telerik:RadButton>


The button does bring up the specified URL, but it does not bring up a new page (as the Target="_blank" would indicate). Tested on Opera 24 and Firefox 33. Using .NET 4.5 / Rad 2014.2.618.45
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
6 answers
201 views
Hi,

I’m trying to program the context menu (client side) to
display different  menus based upon the
node that is clicked on.

So far I have managed to get the system to work out which
node its on:
 

            
var NodeType = args._node.get_attributes().getAttribute("type1");
 
if (NodeType == "position") {
     
}
else if (NodeType == "serial") {
}

 

But I’m having no success is determining how to change the
context menu – Any suggestions (I’m very new to javascript)

Shinu
Top achievements
Rank 2
 answered on 18 Jul 2014
10 answers
2.2K+ views
Is they some RadGrid equivalent for ASP.Net GridView's OnRowDataBound event?
Please point me to some examples.


Thanks
Asad
Jeremy
Top achievements
Rank 1
 answered on 18 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?