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

 Hello,

I am trying to export telerik radgrid into excel 2007 i.e. .xlsx format.  I am using VS 2013.Though its exported, but column formats are not coming correctly. Its working perfectly in .xls format.

Code for .xls is working correctly :

        if (gvAttendanceDetails.Items.Count > 0)
        {
            isExport = true;
            gvAttendanceDetails.ExportSettings.ExportOnlyData = true;
            gvAttendanceDetails.ExportSettings.IgnorePaging = true;
            gvAttendanceDetails.ExportSettings.OpenInNewWindow = true;
            gvAttendanceDetails.ExportSettings.FileName = Guid.NewGuid().ToString();
            gvAttendanceDetails.MasterTableView.Caption = lblSummary.Text + "<br/>" + lbllDepartment.Text + ":" + lblDepartemnt.Text + "<br/>" + lbllManager.Text + ":" + lblManager.Text + "<br/>" +
                 lbllNoOfWrk.Text + ":" + lblNoOfWrk.Text + "<br/>" + lbllDaysPrsnt.Text + ":" + lblDaysPrsnt.Text + "<br/>" +
                    lbllDaysAbsent.Text + ":" + lblDaysAbsent.Text + "<br/>" + lbllLeaveDuty.Text + ":" + lbllLeaveDuty.Text + "<br/>" +
                    lbllSelfService.Text + ":" + lblSelfService.Text + "<br/>" + lbllWeekend.Text + ":" + lblWeekend.Text + "<br/>";
            gvAttendanceDetails.MasterTableView.ExportToExcel();
        }
        else
        {
            RadWindowManager1.RadAlert("There are no Details available", null, null, "Error", "");
        }

 -------------------------------------------------------

The only line highlighted below i have added to export into .xlsx

             if(gvAttendanceDetails.Items.Count > 0)
             {
isExport = true;
gvAttendanceDetails.ExportSettings.ExportOnlyData = true;
gvAttendanceDetails.ExportSettings.IgnorePaging = true;
gvAttendanceDetails.ExportSettings.OpenInNewWindow = true;
gvAttendanceDetails.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.Xlsx;

gvAttendanceDetails.ExportSettings.FileName = DateTime.Now.ToString().Replace(":", "");
gvAttendanceDetails.MasterTableView.Caption = lblSummary.Text + "<br/>" + lbllDepartment.Text + ":" + lblDepartemnt.Text + "<br/>" + lbllManager.Text + ":" + lblManager.Text + "<br/>" +
lbllNoOfWrk.Text + ":" + lblNoOfWrk.Text + "<br/>" + lbllDaysPrsnt.Text + ":" + lblDaysPrsnt.Text + "<br/>" +
lbllDaysAbsent.Text + ":" + lblDaysAbsent.Text + "<br/>" + lbllLeaveDuty.Text + ":" + lbllLeaveDuty.Text + "<br/>" +
lbllSelfService.Text + ":" + lblSelfService.Text + "<br/>" + lbllWeekend.Text + ":" + lblWeekend.Text + "<br/>";

gvAttendanceDetails.MasterTableView.ExportToExcel();
}else

{

}

 

In the attached file i have highlighted in yellow color. Head format is coming correctly, its coming in a single line. And in time column is coming incorrectly.

Can anyone help on this.

Thanks in advance.

Kostadin
Telerik team
 answered on 05 Jun 2015
5 answers
275 views

Hi,

Using the RadGrid in Batch Editing mode and the EditType is set to row. The following (miss-) behaviour may also be reproduced on the demo page (http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx):

  • change some values in an existing row
  • click on "Add new record" to insert a new row
  • click on "Delete" on the newly inserted row (without inserting any data)
  • now try to save the changes => the "Save changes" button doesn't work anymore

May be it has something to do with the combo box in the grid. In another grid without a combobox I have a slightly different behaviour. The "Save changes" is working but it also tries to save the deleted (empty) row.

I also tried to save from the client side with javascript. In the first scenario the hasChanges() function gets an error:

var hasChanges = grid.get_batchEditingManager().hasChanges(grid.get_masterTableView());

Regards
Roni

 

Konstantin Dikov
Telerik team
 answered on 05 Jun 2015
4 answers
241 views

Hi,

Does the form decorator work (apply themes) with the asp:Literal control?

Danail Vasilev
Telerik team
 answered on 05 Jun 2015
1 answer
573 views

var results = from t in context
      where t.Name == userName
      select t;
 
RadGrid1.DataSource = results;
RadGrid1.DataBind();

I have a RadGRid which is populated via code behind with data from an Odata endpoint, as above.

Some of the fields returned contain dates.

I need to create a calculated column which subtracts the current from the date in one of the bound field and returns a value in days.

How can that be performed from code behind and in what event?

 

 I can create the column as below but not sure how to setup the Expression attribute.

GridCalculatedColumn gcc = new GridCalculatedColumn();
gcc.DataFields = new string[] { "CreatedDate" };
gcc.Expression = ???
RadGrid1.MasterTableView.Columns.AddAt(1, gcc);
Viktor Tachev
Telerik team
 answered on 05 Jun 2015
3 answers
539 views

Does anybody have an example on how to databind a RadioButtonList inside of a RadListView? I have been trying for hours so any help will be much appreciated.

Here is a small code snippet:

<telerik:RadListView ID="rlvQuestions" DataSourceID="EntityDataSource1" runat="server"
    ItemPlaceholderID="QuestionsContainer" DataKeyNames="EMPLID,Q_ORDER,FISCAL_YEAR">
    <LayoutTemplate
            <fieldset id="FiledSet1"
                    <legend>Questions</legend
                        <div class="RadListView RadListView_<%# Container.Skin %>">
                        <asp:PlaceHolder ID="QuestionsContainer" runat="server"></asp:PlaceHolder
                        </div
                </fieldset
        </LayoutTemplate
                                  
        <ItemTemplate
            <fieldset>
                <table style="width:100%; border:none;">
                <tr>
                <td style="width:60%; vertical-align:top; padding-top:2px; text-align:left">
                    <div style="width:520px; margin:0 0;">
                        <div style="width:20px; height:auto; text-align:left; float:left; display:inline;">
                            <asp:Label ID="lblQNum" CssClass="SectionLabel" runat="server" Text='<%# Bind("Q_ORDER")%>'></asp:Label>.
                        </div>
                        <div style="width:500px; height:auto; text-align:left; float:left; display:inline;">
                            <asp:Label ID="Label2" CssClass="PopupTeal" runat="server" Text='<%# Bind("QUESTION")%>' /><br />
                        </div>
                    </div>
                </td>
                <td style="width:40%; text-align:left">
                    <asp:Label ID="lblbAssessment" CssClass="DisplayTextBold"
                        runat="server" Text="" />
                    <asp:RadioButtonList ID="rbAssessment" CssClass="DisplayTextBold"
                        RepeatColumns="2" RepeatDirection="Vertical"
                        RepeatLayout="Table" runat="server">
                        <asp:ListItem Value="Exceeded Goals"  />
                        <asp:ListItem Value="Achieved Goals" />
                        <asp:listitem Value="Did Not Meet Goals" />
                        <asp:ListItem Value="N/A" />
                    </asp:RadioButtonList>
                </td>
                </tr>
Konstantin Dikov
Telerik team
 answered on 05 Jun 2015
4 answers
150 views

When attempting to use a youtube playlist, it is returning 410 gone. 

The media player demo page on the telerik site also seems to be gone. 

It seems this tool uses an API that has been depricated.

Any ideas?

Eyup
Telerik team
 answered on 05 Jun 2015
6 answers
184 views
We have a button in our application that is having issues in chrome only. It works fine in Firefox. Sometimes you click on the button to save the information on the screen and it changes to the 'saving...' state but never postsback to the server. It is consistently happening in Chrome but consistently working fine in Firefox. Any ideas of things to check?
Danail Vasilev
Telerik team
 answered on 05 Jun 2015
1 answer
115 views

My skins had worked what seemed like forever. Then one day I opened my project and none work. Here are the console errors I am getting. Please advise. I have included screenshots

 

​

Pavlina
Telerik team
 answered on 04 Jun 2015
2 answers
223 views
Hi,
We have built a reporting portal with bilingual support (Arabic & English) using kendoui DataViz charts.Everything works fine on chrome in both English & Arabic sites until we tested recently the Arabic site in IE to find that the charts are causing the page width to be bigger 3 times (see attached screenshot).This is happening with both RadHtmlChart and kendoui DataViz charts.My understanding is that there is a big similarities between RadHtmlChart and kendoui charts and that's why I am posting in this forum (I can not post in Kendo UI forums though I have purchased all the 3 kendoui packages), and hoping to get this fixed.

Below is the code for both RadHtmlChart & kendoui chart.I have added dir="ltr" to the charts since RTL support in charts is not working at all.All I want now is to have my layout render properly within the RTL site (RTL html body). 

 RadHtmlChart example:

<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body dir="rtl">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
    <telerik:RadHtmlChart runat="server" ID="LineChart" Width="800" Height="500" Transitions="true" dir="ltr">
    <PlotArea >
        <Series>
            <telerik:LineSeries Name="" MissingValues="Interpolate">
                <Appearance>
                    <FillStyle BackgroundColor="Blue" />
                </Appearance>
                <LabelsAppearance DataFormatString="{0}%" Position="Above" />
                <MarkersAppearance MarkersType="Square" BackgroundColor="Blue" />
                <Items>
                    <telerik:SeriesItem YValue="15" />
                    <telerik:SeriesItem YValue="23" />
                    <telerik:SeriesItem />
                    <telerik:SeriesItem YValue="71" />
                    <telerik:SeriesItem YValue="93" />
                    <telerik:SeriesItem YValue="43" />
                    <telerik:SeriesItem YValue="23" />
                </Items>
            </telerik:LineSeries>
            <telerik:LineSeries Name="" MissingValues="Gap">
                <Appearance>
                    <FillStyle BackgroundColor="Red" />
                </Appearance>
                <LabelsAppearance DataFormatString="{0}%" Position="Above" />
                <MarkersAppearance MarkersType="Square" BackgroundColor="Red" />
                <Items>
                    <telerik:SeriesItem YValue="35" />
                    <telerik:SeriesItem YValue="42" />
                    <telerik:SeriesItem YValue="18" />
                    <telerik:SeriesItem YValue="39" />
                    <telerik:SeriesItem YValue="64" />
                    <telerik:SeriesItem YValue="10" />
                    <telerik:SeriesItem YValue="6" />
                </Items>
            </telerik:LineSeries>
        </Series>
        <XAxis MajorTickType="Outside" MinorTickType="Outside">
            <Items>
                <telerik:AxisItem LabelText="Monday" />
                <telerik:AxisItem LabelText="Tuesday" />
                <telerik:AxisItem LabelText="Wednesday" />
                <telerik:AxisItem LabelText="Thursday" />
                <telerik:AxisItem LabelText="Friday" />
                <telerik:AxisItem LabelText="Saturday" />
                <telerik:AxisItem LabelText="Sunday" />
            </Items>
            <MajorGridLines Color="#EFEFEF" Width="1" />
            <MinorGridLines Color="#F7F7F7" Width="1" />
            <TitleAppearance Position="Center" RotationAngle="0" Text="Days" />
        </XAxis>
        <YAxis MajorTickSize="1" MajorTickType="Outside" MaxValue="100" MinorTickSize="1"
            MinorTickType="Outside" MinValue="0">
            <LabelsAppearance DataFormatString="{0}%" RotationAngle="0" />
            <MajorGridLines Color="#EFEFEF" Width="1" />
            <MinorGridLines Color="#F7F7F7" Width="1" />
            <TitleAppearance Position="Center" RotationAngle="0" Text="CPU Load" />
        </YAxis>
    </PlotArea>
    <ChartTitle Text="Server CPU Load By Days">
    </ChartTitle>
    <Legend>
        <Appearance Position="Bottom" />
    </Legend>
</telerik:RadHtmlChart>
 
 
    </div>
    </form>
</body>
</html>

Kendou UI chart example:

<!DOCTYPE html>
 
<head runat="server" id="PageHead">
    <title></title>  
      
    <link href='<%#ResolveUrl("~/styles/kendo.common.min.css")%>' rel="stylesheet" type="text/css" />
    <link href='<%#ResolveUrl("~/styles/kendo.default.min.css")%>' rel="stylesheet" type="text/css" />
    <script lang="javascript" src='<%#ResolveUrl("~/js/jquery.min.js")%>' type="text/javascript"></script>
    <script lang="javascript" src='<%#ResolveUrl("~/js/kendo.web.min.js")%>' type="text/javascript"></script>
    <link href='<%#ResolveUrl("~/styles/kendo.dataviz.min.css")%>' rel="stylesheet" type="text/css" />
    <link href='<%#ResolveUrl("~/styles/kendo.rtl.min.css")%>' rel="stylesheet" type="text/css" />
    <script lang="javascript" src='<%#ResolveUrl("~/js/kendo.dataviz.min.js")%>' type="text/javascript"></script>
    <script lang="javascript" src='<%#ResolveUrl("~/js/cultures/kendo.culture.ar-AE.min.js")%>' type="text/javascript"></script>
    
</head>
<body dir="rtl" >
 
    <form id="form1" runat="server" >
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
            </Scripts>
 
        </telerik:RadScriptManager>
        
        <div class="LineChart-wrapper" >
            <div>
                <div id="LineChart" style="" dir="ltr" ></div>
                <input id="LineChart-Series0" value="Violations" type="hidden">
                <input id="LineChart-values0" value="15,20,35" type="hidden">
                <input id="LineChart-Categories" value="Jul,Aug,Setp" type="hidden">
            </div>
            
            <style scoped="">
                .LineChart-wrapper {
                    margin: 0 0 0 0px;
                    padding: 0px;
                }
 
                    .LineChart-wrapper .k-chart {
                        height: 199px;
                        padding: 0px;
                        margin: 0 0 0 0px;
                        width: 222px;
                    }
            </style>
        </div>
        <script>
            function createLineChart() {
                //alert($("#LineChart"));
                $("#LineChart").kendoChart({
                    theme: $(document).data("kendoSkin") || "default",
                    title: {
                        text: ""
                    },
                    legend: {
                        position: "bottom"
                    },
                    chartArea: {
                        background: ""
 
                    },
                    seriesDefaults: {
                        type: "line",
                        labels: {
                            visible: true,
                            position: "center",
                            font: "8px Arial,Helvetica,sans-serif",
                            format: "{0}"
                        }
                    },
                    series: [{
                        name: $("#LineChart-Series0").val(), data: $("#LineChart-values0").val().split(",")
                    }],
                    valueAxis: {
                        labels: {
                            format: "{0}"
                        }
 
 
 
 
                    },
                    categoryAxis: {
                        categories: $("#LineChart-Categories").val().split(","),
                        labels: { rotation: 90 },
                        minorGridLines: {
                            visible: true
                        }
                    },
                    tooltip: {
                        visible: true,
                        format: "{0}"
                    }
                });
            }
            $(document).ready(function () {
                //alert('line chart ready');
                setTimeout(function () {
                    // Initialize the chart with a delay to make sure
                    // the initial animation is visible
                    createLineChart();
 
                    $("#LineChartexample").bind("kendo:skinChange", function (e) {
                        createLineChart();
                    });
                }, 300);
 
                
            });
        </script>
        
    </form>
 
 
</body>


Thanks

Madani
أشرف
Top achievements
Rank 1
 answered on 04 Jun 2015
1 answer
74 views

It's a bug that I also reproduced on your site



First enter this date in the date picker: May  31, 2015

- With the date picker calendar, click on header to display the 12 month

- Select February



The month that appears is March’s



The problem is, if the date display at first is a 31 and the
month you select have only 30 day, he display the next month.


Please note that I have used  Already used "RadControls_Q1_2007_SP2_dev"

 Please advice me how to fix it???? 

 

Kindly see the attached screen
shot, 

Konstantin Dikov
Telerik team
 answered on 04 Jun 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?