Telerik Forums
UI for ASP.NET AJAX Forum
25 answers
1.2K+ views
Hi there,

When trying to export to Excel from a hierarchical radgrid I am unable to have the details tables shown on the exported Excel spreadsheet. The appropriate lines are there, however they are blank.

Below is the code I am using to export:

ASPX:
<asp:LinkButton ID="ExportToExcel" ToolTip="Export to Excel"
runat="server" Text="Export To Excel" CommandName="Export"
OnClick="ExportToExcel_Click" />
CS:
protected void ExportToExcel_Click(object sender, EventArgs e)
       {
           RadGrid.ExportSettings.FileName = "filename";
           RadGrid.ExportSettings.IgnorePaging = true;
           RadGrid.ExportSettings.ExportOnlyData = true;
           RadGrid.ExportSettings.OpenInNewWindow = true;
           RadGrid.MasterTableView.UseAllDataFields = true;
           RadGrid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
 
           RadGrid.MasterTableView.HierarchyDefaultExpanded = true; // first level
           RadGrid.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true; // second level 
            
           RadGrid.MasterTableView.ExportToExcel();
       }

All three grids (master, two detail tables) are set to HierarchyMode = "Client". 

The resulting output is shown in the image below, the fully expanded radgrid is shown in the other image below. Note that the grid is not expanded when the button is clicked, but expanding the rows on the client beforehand doesnt make a difference.

Any idea why the rows would show up in the excel file but the data not be written?

Thank you,

Tom
Kostadin
Telerik team
 answered on 27 Feb 2015
1 answer
136 views
Hi,
Is the popup as ilustrated by the picture below created with Telerik controls?  If so can an example please be provided:
Marin Bratanov
Telerik team
 answered on 27 Feb 2015
4 answers
195 views
Hi, I have an HtmlChart tied to a SQLDataSource.  It's pretty simple, but I would like each of the bars colored differently.  The first bar RED, middle, YELLOW, then GREEN.  I'm even bringing the color from the query.

Can someone assist me with this.

<telerik:RadHtmlChart runat="server"  ID="RadHtmlChart2"
                      DataSourceID="SqlDataSourceActionColor" OnDataBound="RadHtmlChart2_DataBound">
    <PlotArea>
        <Series>
            <telerik:ColumnSeries DataFieldY="Value" Name="IncidentByMonth">
            </telerik:ColumnSeries>
        </Series>
        <XAxis DataLabelsField="COLOR">
            <LabelsAppearance RotationAngle="300">
            </LabelsAppearance>
        </XAxis>
        <YAxis>
            <TitleAppearance Text="">
            </TitleAppearance>
        </YAxis>
    </PlotArea>
    <Legend>
        <Appearance Visible="false">
        </Appearance>
    </Legend>
    <ChartTitle Text="Near Miss by Risk Category">
    </ChartTitle>
</telerik:RadHtmlChart>
<asp:SqlDataSource ID="SqlDataSourceActionColor" runat="server" ConnectionString="<%$ ConnectionStrings:OSHAConnectionString %>" SelectCommand="
                   select a.COLOR,
                   a.Action,
                   b.Value
                   from (
                   select 'RED' as COLOR, 'ACTION NECESSARY' as Action UNION ALL
                   select 'YELLOW' as COLOR, 'ACTION APPROPRIATE IF PRATICAL AND ECONOMIC' AS ACTION UNION ALL
                   select 'GREEN' as COLOR, 'NO ACTION REQUIRED' AS ACTION
                   ) a
                   LEFT OUTER JOIN (
                   select count(ID) as Value,
                   ActionColor,
                   Action
                   from [aaa_v_ReportingData]
                   where YEAR = @Year
                   and Location = @Location
                   group by ActionColor,
                   Action
                   ) B ON B.ACTIONCOLOR = A.COLOR">
    <SelectParameters>
        <asp:ControlParameter ControlID="RadComboBox2" Name="Year" PropertyName="SelectedValue" />
        <asp:ControlParameter ControlID="RadComboBox1" Name="Location" PropertyName="SelectedValue" />
    </SelectParameters>
</asp:SqlDataSource>
Skip
Top achievements
Rank 1
 answered on 27 Feb 2015
1 answer
131 views
I am trying to create a Telerik.Web.UI.InputPasswordStrengthSettings object to put some password settings on it  in a C# created password textbox. Creating this object takes a parameter of new InputPasswordStrengthSettings (System.Web.UI.StateBag OwnerStateBag).  The Telerik documentation is quite helpful as usual, it says OwnerStateBag is an owner state bag.

Searching the web for help I discover many Telerik controls take the OwnerStateBag as a parameter on construction.  I am programming in an ASP.NET environment is ASP.NET AJAX in a C# class far down below an aspx file.  Their is a ViewState in the aspx.

What does OwnerStateBag as a parameter mean and where would I get it or how should I make it?   StateBag is an internal interface needing to be created as another object.

Help please,
George


Genady Sergeev
Telerik team
 answered on 27 Feb 2015
10 answers
153 views
I need to achieve the following scenario:

when the page is loaded, call a client side script, which does something (in this case gather the users location using google api for location) then send that location to the server using ajax manager and ultimately doing a ajax call right after page load.
This all works fine in IE, but its a hit and miss in firefox where the radajaxmanager (most of the time) returns null.

below is the basic setup which is tested in IE8 and firefox 3.6.13 (which where the problem occurs)
also using the trial version of telerik version 2010.3.1215.40


Master
--------
<%@ Master Language="VB" CodeFile="MainMaster.master.vb" Inherits="MainMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>


Content
----------------------
<%@ Page Title="" Language="VB" MasterPageFile="~/MainMaster.master" AutoEventWireup="false"
    CodeFile="Default.aspx.vb" Inherits="_Default" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

        
            function findAjaxManager() {
                var m = $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>");
                alert(m);
                m.ajaxRequest('Something');
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblTime" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <asp:Label runat="server" ID="lblTime"></asp:Label>
</asp:Content>


Content Code Behind
------------------------
Imports Telerik.Web.UI

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        AddHandler RadAjaxManager.GetCurrent(Page).AjaxRequest, AddressOf AjaxRequest

        If (Not Page.IsPostBack) Then


            RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("findAjaxManager();")


        End If
    End Sub

    Private Sub AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)
        If e.Argument = "Something" Then
            lblTime.Text = DateTime.Now.ToString
        End If
    End Sub

End Class

Konstantin Dikov
Telerik team
 answered on 27 Feb 2015
1 answer
430 views
Hello,

Can someone please explain me in a simple approach how to access values of text boxes, drop downs and other controls that appear in edit mode ? I feel like striking my head against the wall because it's been sometime since I last used Telerik and I can't find any solution to this.

My grid has a mix of GridBoundColumns and GridTemplateColumns, it is populated using a stored procedure that is called using ASP SQLDataSource but I want update to be manual on UpdateCommand Event unfortunately I can't figure out how to access all those controls that appear in edit mode.

   <telerik:RadGrid ID="OnGoingProjectsGrid" runat="server" CellSpacing="0" DataSourceID="OnGoingProjectsDS" GridLines="None" Skin="Metro" OnDataBound="OnGoingProjectsGrid_DataBound" OnItemDataBound="OnGoingProjectsGrid_ItemDataBound" OnUpdateCommand="OnGoingProjectsGrid_UpdateCommand">
        <MasterTableView DataSourceID="OnGoingProjectsDS" AutoGenerateColumns="false" DataKeyNames="SNO" AllowSorting="False">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="LinkButton">

                </telerik:GridEditCommandColumn>

                <telerik:GridBoundColumn DataField="SNO" HeaderText="SNO" UniqueName="SNO" Visible="false" ReadOnly="true" ForceExtractValue="Always" ConvertEmptyStringToNull="true">

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="JOBORDER" HeaderText="JOB ORDER" UniqueName="JOBORDER">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CLIENT" HeaderText="CLIENT" UniqueName="CLIENT">
                    <HeaderStyle Width="300px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                    <FilterTemplate>
                        <telerik:RadComboBox ID="ClientComboBox" DataValueField="CLIENT" AppendDataBoundItems="true" runat="server" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CLIENT").CurrentFilterValue %>'>
                            <Items>
                                <telerik:RadComboBoxItem Text="Select Client" />
                            </Items>
                        </telerik:RadComboBox>
                    </FilterTemplate>
                </telerik:GridBoundColumn>

                <telerik:GridTemplateColumn DataField="STATUS" HeaderText="STATUS" UniqueName="STATUS">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />
                    <ItemTemplate>
                        <asp:Label ID="lblStatusEdit" runat="server" Text=<%# Bind("STATUS") %>></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="StatusComboBox" runat="server" Skin="Metro" EnableLoadOnDemand="false" MarkFirstMatch="false" OnLoad="StatusComboBox_Load" AllowCustomText="false"></telerik:RadComboBox>
                    </EditItemTemplate>

                </telerik:GridTemplateColumn>

                <telerik:GridBoundColumn DataField="DATE" HeaderText="DATE" UniqueName="DATE" ReadOnly="true">
                    <HeaderStyle Width="150px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="DESIGNATEDPERSON" HeaderText="DESIGNATED PERSON" UniqueName="DESIGNATEDPERSON">
                    <HeaderStyle Width="100px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="AFFILIATE" HeaderText="AFFILIATE" UniqueName="AFFILIATE">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DESCRIPTION" HeaderText="DESCRIPTION" UniqueName="DESCRIPTION">
                    <HeaderStyle Width="200px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ACTIONWHO" HeaderText="ACTION WHO" UniqueName="ACTIONWHO">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DELIVERABLES" HeaderText="DELIVERABLES" UniqueName="DELIVERABLES">
                    <HeaderStyle Width="150px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                
                <telerik:GridTemplateColumn DataField="DEADLINE" HeaderText="DEADLINE" UniqueName="DEADLINE">
                    <HeaderStyle Width="150px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text=<%# Bind("DEADLINE") %>></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadCalendar ID="RadCalendar1" runat="server" Skin="Metro" EnableMultiSelect="false"></telerik:RadCalendar>
                    </EditItemTemplate>

                </telerik:GridTemplateColumn>

                <telerik:GridBoundColumn DataField="PERCENTAGE" HeaderText="PERCENTAGE" UniqueName="PERCENTAGE">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DAYSLEFT" HeaderText="DAYSLEFT" UniqueName="DAYSLEFT" ReadOnly="true">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn DataField="REMARKS" HeaderText="REMARKS" UniqueName="REMARKS">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />

                    <ItemStyle HorizontalAlign ="Center" />
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text=<%# Bind("REMARKS") %>></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text=<%# Bind("REMARKS") %>></asp:TextBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridBoundColumn DataField="COST" HeaderText="COST" UniqueName="COST">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn DataField="PROFITMARGIN" HeaderText="PROFIT MARGIN" UniqueName="PROFITMARGIN">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="NETPROFIT" HeaderText="NET PROFIT" UniqueName="NETPROFIT">
                    <HeaderStyle Width="80px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PAYMENTDURATION" HeaderText="PAYMENT DURATION" UniqueName="PAYMENTDURATION">
                    <HeaderStyle Width="100px" Font-Size="Smaller" Font-Bold="true" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign ="Center" />

                </telerik:GridBoundColumn>

            </Columns>
            <EditFormSettings>

            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>

    <asp:SqlDataSource ID="OnGoingProjectsDS" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" SelectCommand="Get_Projects" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="UserId" SessionField="LoggedInUserID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

I appreciate any help.
Eyup
Telerik team
 answered on 27 Feb 2015
26 answers
2.4K+ views
Hi,

Working on a large application, and hit a problem with a RadAjaxLoadingPanel not showing.

The form in question follows a similar structure to a number of others on the site. In terms of logic, there are a number of panels (some with nested panels) that form a "wizard" type interface to allow users to make a credit card payment.

Due to the complexity of possible permutations of what controls could be updated by what, I've wrapped a AjaxPanel around it with a loading panel.

But the loading panel never shows.

If I remove the AjaxPanel and use an AjaxManager instead, the loading panel did initially show. However as I added more and more events to the AjaxManager, I got in to a number of problems which seem to relate to a cyclic relationship between some of the updated controls.

So I've gone back to the AjaxPanel, but with no loading panel. Any ideas?? :)

Matt
Avnish
Top achievements
Rank 1
 answered on 27 Feb 2015
1 answer
103 views
In my grid, i want to use editform when adding a new record and inform when edit a record.

I have tried it like this:



If TypeOf e.Item Is IGridInsertItem Then

  RadGrid1 .MasterTableView .EditMode = GridEditMode.EditForms

else 

  RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace

End If



If i try to add a new record it does not Work, a Little Wheel is just turning around and around

When i try to edit it Works ok, and show INplace edit.

Eyup
Telerik team
 answered on 27 Feb 2015
1 answer
264 views
RadScheduler.ExportSettings has access to change the PDF producer, I'm not seeing that property in the ClientExportManager, can you tell me how I can access that property?
Peter Filipov
Telerik team
 answered on 27 Feb 2015
1 answer
90 views
Hi,

I am currently having a problem with clientchanges from a RadTreeView appearing on the server.

This was working fine still recently and after rolling back to known working versions I am still have the problem. I am using trackchanges on the node click event and I check the changes log before calling the trackchanges again so I can maintain a collection of changes to allow users to create a hierarchy of nodes before having to postback i.e.  

var treeView = $find(treeViewClientId);
if (treeView._log._logEntries.length == 0) {
treeView.trackChanges();
}

As I mentioned this has worked perfectly previously. As I debug through the javascript I can see the entries and then when I choose commitchanges then I see the entries converted to JSON. However on postback I cannot see any changes coming through on the server.

Could you please give me some guidance on troubleshooting to check where these changes maybe getting lost?

Many thanks

Justin
Boyan Dimitrov
Telerik team
 answered on 27 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?