Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
833 views

When my RadGrid is exported to Excel, if one of the cell's data begins with a dash (-), I get the error message "Excel cannot open the file because the file format or file extension is not valid..." see in the attached Error.png.  If I remove leading dashes from the data by updating the database, or remove leading dashes in code before binding it to the grid, the grid exports as expected.  However this is not an sustainable or ideal solution.

- I have tried setting the excel export to Xlsx, Html, Biff and ExcelIML in both cs code and in the designer (also tried each independent of each other):

            AuthGrid.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
            AuthGrid.MasterTableView.ExportToExcel();

            <ExportSettings>
                <Excel FileExtension="xlsx" Format="Xlsx" />
            </ExportSettings>

- I have tried notes.DataFormatString = "{0}"; and notes.DataFormatString = "&nbsp;{0}";

I started with a slightly older version of these dlls, but also tried upgrading to newer versions:

- Telerik.Web.Spreadsheet version 2016.3.913.40 (upgraded to 2018.3.620.40)

- Telerik.Web.UI version 2016.3.914.45 (upgraded to 2018.2.710.45)

- Telerik.Web.UI.Skins version 2016.3.914.45 (upgraded to 2018.2.710.45)

- Telerik.Windows.Documents.Core version 2016.3.913.40 (upgraded to 2018.2.619.40)

- Telerik.Windows.Documents.Fixed version 2016.3.913.40 (upgraded to 2018.2.619.40)

- Telerik.Windows.Documents.Flow version 2016.3.913.40 (upgraded to 2018.2.619.40)

- Telerik.Windows.Documents.Spreadsheet version 2016.3.913.40 (upgraded to 2018.2.619.40)

- Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXML version 2016.3.913.40 (upgraded to 2018.2.619.40)

- Telerik.Windows.Zip  version 2016.3.913.40 (upgraded to 2018.2.619.40)

Edward
Top achievements
Rank 1
Veteran
Iron
Iron
 answered on 06 May 2021
1 answer
273 views

Dear all,

 

I have the below radgrid defininition in my aspx page in which the selectionColumn is a checkbox. When I click on row, the postback is fired and I can calculate the sum of all selected rows and then display the results in the footer.

However when I click on the header checkbox, then all the lines are selected but the postback event is not fired.

Which property should be enable? Or maybe should it be managed differently?

My goal is to display in the footer, the sum of selected rows whatever it is by selection some specific rows or by using the select/unselect all checkbox.

Thanks

 

                                    <MasterTableView ShowFooter="true" DataKeyNames="ID" PageSize="50">
                                        <Columns>
                                            <telerik:GridClientSelectColumn HeaderStyle-Width="50px"></telerik:GridClientSelectColumn>
                                            <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter on Chunk Key" HeaderText="Chunk Key" UniqueName="ID" HeaderStyle-Width="100px">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="PurchaseContract" FilterControlAltText="Filter on Purchase Ctr" HeaderText="Purchase Ctr" UniqueName="PurchaseContract" HeaderStyle-Width="150px">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Supplier" FilterControlAltText="Filter on Supplier" HeaderText="Supplier" UniqueName="Supplier">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="ShipmentStatus" FilterControlAltText="Filter on Ship. Status" HeaderText="Ship.Status" UniqueName="ShipmentStatus">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="ShipmentDate" FilterControlAltText="Filter on Ship. Date" HeaderText="Ship. Date" UniqueName="ShipmentDate" DataFormatString="{0:dd/MM/yyyy}">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="ShipmentRef" FilterControlAltText="Filter on Ship. Ref" HeaderText="Ship. Ref" UniqueName="ShipmentRef" HeaderStyle-Width="250px">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="FinancingBank" FilterControlAltText="Filter on Financing Bank" HeaderText="Financing Bank" UniqueName="FinancingBank">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="FinancingRef" FilterControlAltText="Filter on Financing Ref." HeaderText="Financing Ref." UniqueName="FinancingRef">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="NetWeight" FilterControlAltText="Filter on NetWeight" HeaderText="Net Weight" UniqueName="NetWeight" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Warehouse" FilterControlAltText="Filter on Warehouse" HeaderText="Warehouse" UniqueName="Warehouse">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="CustomsStatus" FilterControlAltText="Filter on CustomsStatus" HeaderText="Customs Status" UniqueName="CustomsStatus">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Customer" FilterControlAltText="Filter on Customer" HeaderText="Customer" UniqueName="Customer">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="SaleContract" FilterControlAltText="Filter on SaleContract" HeaderText="Sale Ctr" UniqueName="SaleContract">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="SaleInvoiceNb" FilterControlAltText="Filter on SaleInvoiceNb" HeaderText="Sale Invoice Nb" UniqueName="SaleInvoiceNb">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Vessel" FilterControlAltText="Filter on Vessel" HeaderText="Vessel" UniqueName="Vessel">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                    </MasterTableView>
                                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="0"></Scrolling>
                                        <Selecting AllowRowSelect="true"></Selecting>
                                    </ClientSettings>
                                    <PagerStyle AlwaysVisible="true" Mode="NumericPages" Position="Bottom" />
                                </telerik:RadGrid>

 

Attila Antal
Telerik team
 answered on 06 May 2021
1 answer
134 views

Hello,

I'm currently working on a project where I have a RadGrid displaying some data. The filter functionality is already implemented and I've created a custom skin from an existing embedded skin for the GridDateTimeColumn and implemented according to the documentation here. Everything works perfect except that upon adding the <FilterTemplate> and setting the custom skin for the <telerik:RadDatePicker> the filter button it's not generated anymore. I've inspected the page and indeed the button is not just hidden with CSS or missing it's icon, it's not present at all in the HTML and the result is in the pictures attached.

Here is the markup I'm using.

<telerik:GridDateTimeColumn DataField="foo" UniqueName="foo" HeaderText="foo" PickerType="DatePicker" DataFormatString="{0: MM/dd/yyyy}" FilterDateFormat="MM/dd/yyyy" ReadOnly="true">
     <HeaderStyle Width="130" Font-Bold="true" />
          <FilterTemplate>
               <telerik:RadDatePicker runat="server" Skin="MyCustomSkin" EnableEmbeddedSkins="false"></telerik:RadDatePicker>
          </FilterTemplate>
 </telerik:GridDateTimeColumn>

Once I remove the <FilterTemplate> and return the skin to default the Filter button is displayed. I've looked for solutions but I couldn't seem to find any. What's causing this behaviour? Is it something I'm missing? 

 

Attila Antal
Telerik team
 answered on 05 May 2021
1 answer
251 views

Hi.

I'm using TooltipsAppearance.ClientTemplate. It's working fine but it's inheriting the standard tooltip appearance and my template appears inside it.

Please refer to the attached image.

An example of what the tooltip should look like is also in the image. You will also notice the text in the bottom half of the tooltip is not showing. It is actually there but the text color is white so you can't see it. 

What am I doing wrong?

Thanks.

Peter Milchev
Telerik team
 answered on 04 May 2021
1 answer
134 views

On the grouping demo page, I'm wondering if there's a bug.

When looking at the contents of the grouped combobox list, the grouping label of Argentina is shown as a column header instead of the black text to the right side.

Peter Milchev
Telerik team
 answered on 04 May 2021
2 answers
878 views

My radmultiselect has many values along with the option "None". The user is allowed to select up to 5 values and currently can select None amongst those 5 values which doesn't make any sense. If the user selects None (88 in the code below), I would like to clear any other selections and reselect None (88). I currently have the following code, but I can't figure out how to actually select or deselect an item via javascript.

ASP.NET:

<telerik:RadMultiSelect ID="RadMultiSelect1" runat="server" DataValueField="value" DataTextField="text" RenderMode="Lightweight" Placeholder="Select..." AutoClose="false" Skin="Bootstrap" CssClass="radmultiselectstyle" TagMode="Single" Width="100%" AccessKey="B">
          <ClientEvents OnSelect="onSelect" />
</telerik:RadMultiSelect>


JS:

<script type="text/javascript" id="telerikClientEvents1">
    function onSelect(sender, args) {
        var data = args.get_dataItem();
        var multiSelectObject = $find("<%=RadMultiSelect1.ClientID %>");
        var kendoMultiSelect = multiSelectObject.get_kendoWidget();
        if (data.value == '88') {
            /*[I would like to clear all values, reselect just 88, and, I'm guessing set 
the MaxSelectedItems to one unless 88 is deselected]*/ } } </script>

 

Can anyone help?

Thanks!

Peter Milchev
Telerik team
 answered on 04 May 2021
1 answer
226 views

I have two pages:

a.aspx
b.ascx

The goal is to get the RadToolBarButtons on b.ascx to fire the OnButtonClick() event as defined in the RadToolBar .

a.aspx is the host page for b.ascx and has this placeholder for different RadGrids:

<div id="divMiniGrid" runat="server" visible='<%# ActiveViewID != "viewFees" %>' class="rightPane">
         <sf:PaymentDetailsGrid ID="ctlMiniGrid" runat="server" class="rightPane" Visible="false" IsCondensed="true" />
</div>


b.ascx has the actual RadGrid that is loaded in a.aspx. The RadGrid has an ItemTemplated RadToolbar:

 <telerik:RadGrid ...>
    <MasterTableView ...>
        <CommandItemTemplate>
            <telerik:RadToolBar ... OnButtonClick="PaymentDetailsToolbar_ButtonClick" EnableViewState="true"  onClientButtonClicking="ClientButtonClicking" ...>
                <Items>
                    <telerik:RadToolBarButton runat="server" Text="Edit" ImageUrl="../images/icons/refresh.svg" CommandName="Edit" Enabled="False" />



The PaymentDetailsToolbar_ButtonClick() event lives on b.ascx, but it is never fired when the RadToolBarButton is clicked. Here's the signature:

protected void PaymentDetailsToolbar_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e){...}

The only event that is fired is a.aspx Page_Load() event when the RadToolBarButton is clicked. What's going on?

Attila Antal
Telerik team
 answered on 04 May 2021
1 answer
375 views

Hi there,

 

I want to change the color of the  Pin Makers in RadMap for example here is a table  that has consisted with three columns ( Latitude , Longitude and isCancelled )  now I need to change the Pin Marker color based the isCancelled column if the isCancelled is true the Pin Marker color would be in green and other false rows would be in red any idea ? thnaks

LatitudeLongitudeisCancelled
6.83249124.454363false
45.397714.77996true
41.35636182.63142true
50.342267813.9673223true
60.88934924.5208664true

 

Protected Sub RadMap1_ItemDataBound(sender As Object, e As Telerik.Web.UI.Map.MapItemDataBoundEventArgs) Handles RadMap1.ItemDataBound
       
    End Sub

 

Rebeen
Top achievements
Rank 1
Iron
 answered on 03 May 2021
1 answer
337 views

Hi,

I'm using RadClientDataSource to grab data from an api endpoint but I need to pass a variable inside the url but can't figure out how.

<script language="VB" runat="server"> Dim id As String = HttpContext.Current.Request.QueryString("id") </script> <WebServiceDataSourceSettings> <Select Url="http://localhost:5000/api/v1/test/<%=id%>/cars" RequestType="Get" /> </WebServiceDataSourceSettings>

 

Attila Antal
Telerik team
 answered on 03 May 2021
1 answer
790 views

Hello,

My ASP.NET Web forms application compiles fine in Visual Studio 2019 however when the project is built with MSBuild in Azure Pipelines to automate some processes we are getting errors that the telerik web ui namespace cannot be loaded in because we are building against .NET 4.0 for this project and despite the Telerik.Web.UI.dll being a 4.0 built DLL it is complaining about some .NET 4.5 dependencies internally. How can I resolve this issue? If I switch this project to build with .NET 4.5 then these issues go away however we need to get the project working while compiling with .NET 4.0 for other reasons I cannot specify here.

Warning causing the errors at the bottom:

##[warning]D:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5): Warning MSB3275: The primary reference "Telerik.Web.UI, Version=2020.1.219.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the assembly "AWSSDK.S3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".

##[error]Artoo.Telerik.Web\Extensions\NumericTextBox.cs(11,55): Error CS0246: The type or namespace name 'RadNumericTextBox' could not be found (are you missing a using directive or an assembly reference?)


EDIT:

Adding this setting below to my csproj for this project removed this error but now I am getting an error saying Telerik.Web.UI is depending on System.Net.Http despite the fact that my project is .NET 4 and this assembly is for .NET 4.5 and above only.

<ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>

New Error:

Warning MSB3268: The primary reference "Telerik.Web.UI, Version=2020.1.219.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Telerik.Web.UI, Version=2020.1.219.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

Thank you!

 

Attila Antal
Telerik team
 answered on 30 Apr 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?