Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
92 views
I am using the 2014.2.724.40 version of the Telerik controls for ASP.NET AJAX.  When I upgraded from a 2009 version the functionality in my export code in my web application appears to have changed creating problems. ( I did also upgrade the application from VS 2008 to VS 2010.)  I have a user who takes the Excel spreadsheet of exported data and imports it into a MS Access db.  The first thing she noticed was that the field names changed from having no spaces in the names to having spaces, which interrupted her import process.  Next she noticed that the field data types were not matching either.  Prior to the upgrade all this had worked satisfactorily.  I have been able to replicate this myself and identified that date and Boolean fields are now coming across as short text data types.

This is a summary of the process:  When the user selects "Export All Fields" and clicks the Export button (see attached screen print) the code calls a SP that retrieves about 80 fields of data from a SQL Server db. A hidden radgrid is then populated with these fields and data.  Next, this data is then exported to an Excel spreadsheet.  I think I have been able to determine that at least part of the 'problem' is in the population of the radgrid, as I have discovered in stepping through the code that the 'date fields' in the grid have a DataTypeName of System.String.  Under MasterTableView I have set AutoGenerateColumns to True with no apparent positive result. 

Below is my hidden radgrid first and then the export code.
    <telerik:RadGrid ID="RadGridExport" runat="server" Visible="False" >
        <ExportSettings ExportOnlyData="True" IgnorePaging="True" Excel-Format="Biff" HideStructureColumns="True">
            <Excel Format="Biff" />
        </ExportSettings>
        <MasterTableView ShowHeader="False" AutoGenerateColumns="True">
 
            <RowIndicatorColumn Visible="False">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Created="True">
            </ExpandCollapseColumn>
 
        </MasterTableView>
        <FilterMenu EnableTheming="True">
            <CollapseAnimation Type="OutQuint" Duration="200">
            </CollapseAnimation>
        </FilterMenu>
    </telerik:RadGrid>
 
--------------------------
Public Sub ExportRadGrid(ByRef radGrid As Telerik.Web.UI.RadGrid)
        '-- Export the specified grid to the specified format
        radGrid.Visible = True
        radGrid.Rebind()
        With radGrid.ExportSettings
            If radGrid.ID = "RadGrid1" Then
                .FileName = "DivisionTotals"
            ElseIf radGrid.ID = "RadGrid2" Then
                .FileName = "GrantorTotals"
            Else
                .FileName = "GrantList"
            End If
            .ExportOnlyData = True
            .IgnorePaging = True
            .OpenInNewWindow = True
        End With
 
        Select Case ddlExportFormat.SelectedValue
            Case "Microsoft Excel"
                If radGrid.ID = "RadGrid1" Then
                    For Each col As GridColumn In radGrid.MasterTableView.RenderColumns
                        col.HeaderStyle.Width = Unit.Pixel(175)
                    Next
                ElseIf radGrid.ID = "RadGrid2" Then
                    For Each col As GridColumn In radGrid.MasterTableView.RenderColumns
                        'For Each col1 As GridColumn In radGrid.
                        col.HeaderStyle.Width = Unit.Pixel(275)
                    Next
                ElseIf radGrid.ID = "RadGridExport" Then    'RadGridGrants on Grants.aspx
                    Debug.Print("START")
                    radGrid.ShowHeader = False
                    radGrid.ExportSettings.SuppressColumnDataFormatStrings = False
 
                    For Each col As GridColumn In radGrid.MasterTableView.RenderColumns
                        Debug.Print("DataTypeName: " + col.DataTypeName)
                        Debug.Print("ColumnType: " + col.ColumnType)
                        Debug.Print("HeaderText: " + col.HeaderText)
                        Debug.Print("UniqueName: " + col.UniqueName)
 
                        col.HeaderText = col.UniqueName
                        'For Each col1 As GridColumn In radGrid.
                        col.HeaderStyle.Width = Unit.Pixel(275)
                    Next
                    Debug.Print("END")
                End If
 
                radGrid.MasterTableView.ExportToExcel()
            Case "Microsoft Word"
                radGrid.MasterTableView.ExportToWord()
            Case "Adobe PDF"
                radGrid.MasterTableView.ExportToPdf()
            Case "CSV"
                radGrid.MasterTableView.ExportToCSV()
        End Select
    End Sub





 Is there some other setting that will synchronize the columns to the SQL data types or would anyone have some other suggestion?

Daniel
Telerik team
 answered on 14 Apr 2015
5 answers
113 views
I'm using the clean sample of a CookieStateStorageProvider from http://demos.telerik.com/aspnet-ajax/persistence-framework/examples/custom-storage-provider/defaultcs.aspx

When the CookieStateStorageProvider tries is called upon a key it does not know, returning null leads to an exception in the PersistenceManager. The thing is that I don't want my view to have to check if this key is already existing or not. It makes more sense that only the CookieStateStorageProvider knows about how to store the state. But what should its method return when the key is not valid/existing?

I tried returning null or String.Empty but none is appreciated my the PersistenceManager.
Daniel
Telerik team
 answered on 14 Apr 2015
3 answers
266 views
I have created a TableCell dynamically in the code behind, then add a RadButton (Toggle ButtonType - CheckBox). But after I installed the latest Telerik AJAX Version 2012 Q3, the vertical alignment of it inside a TableCell suddenly gone wrong.

Attached, please find:

1. Before.png: This is how RadButton is like in Telerik AJAX 2012 Q2
2. After.png    : This is how RadButton is like in Telerik AJAX 2012 Q3.

Thanks

Lamk.
Slav
Telerik team
 answered on 14 Apr 2015
3 answers
165 views
Hello,

I have a web application that we started trying out some of the controls on so they were using a trial version.  We went on to buy a license.  I updated the controls and I believe the project was updated as well.  However, we are continually being prompted that we need to buy a license.  Here is the message we receive:

Thank you for using the Trial Version of RadControls for ASP.NET AJAX to build slicker and better performing applications faster. Purchase the Commercial Version now to get access to the latest updates across the suite and Telerik’s legendary support

How do i get rid of this message? 

Thanks.
Pavlina
Telerik team
 answered on 14 Apr 2015
0 answers
74 views

Hi,

in my web application I use RichTextBox control to load docx template (created in Word 2013), which fill with data and then save this file to local destination.

Problem is, when I save file to local destination, Word 2013 open them in compatibility mode. 

whether richtextbox supports office 2013 files?

 

Thans

 

Dzenisan
Top achievements
Rank 1
 asked on 14 Apr 2015
1 answer
77 views

Hi,

Is there a way to make the value the displayed selected value and still have the drop down show the text when selecting. My objective is to show a short version of the full description (e.g. TBA = To be announced). So when you open the drop down you see "To be Announced" and but the selection shows TBA. The reason is that we have limited space on the form and we want to keep the fields fairly narrow.

 

Thanks!

Aneliya Petkova
Telerik team
 answered on 14 Apr 2015
11 answers
945 views
Hi Team,

I need to clear RadGrid at client - side.
I tried this: masterTableView.get_filterExpressions().clear(); which cleared array holding filterExpressions but my filter values were preserved in filter textbox!
Radoslav
Telerik team
 answered on 14 Apr 2015
1 answer
293 views

I have a radgrid I am using to create what is essentially a dynamic crosstab where I create date columns across the top, based on calculations at runtime.  I know many of the column names at design and have tried both autogenerating columns and not.  Some columns i do not know until runtime (week start dates).  I'm trying to sum the number in those dynamically created week columns and having no luck.  What would be my best option??

 

my aspx: 

    <telerik:RadGrid ID="RadGrid1"  runat="server"  AllowSorting="True" AllowMultiRowSelection="false" AllowPaging="True" ShowGroupPanel="false" AutoGenerateColumns="false" GridLines="none" pagesize="500">
                     <MasterTableView ShowGroupFooter="true" UseAllDataFields="True">
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="Team" FieldName="Team"  HeaderValueSeparator=": "></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="Team" SortOrder="ascending"></telerik:GridGroupByField>
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="SkillRequired" FieldName="SkillRequired" HeaderValueSeparator=": "></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="SkillRequired"></telerik:GridGroupByField>
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                           
                </Columns>
            </MasterTableView>
            <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                <Selecting AllowRowSelect="True"></Selecting>
                <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                    ResizeGridOnColumnResize="False"></Resizing>
            </ClientSettings>
            <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
        </telerik:RadGrid>

 

 

 

My Code Behind:

 

   Protected Sub ProcessResources()
        'Add columns for the weeks between the to and from dates
        If IsDate([To].Text) And IsDate(From.Text) Then
            Dim MyRecords As DataSet = LoadResources([From].Text, [To].Text)
            Dim myWeeks As ArrayList = ReturnWeeks(From.Text, [To].Text)
            For i = 0 To myWeeks.Count - 1
                Dim myColumn As New DataColumn
                MyRecords.Tables("Resources").Columns.Add(myWeeks.Item(i))
                'changed columns to be autogenerated in order to attempt summation of hours 
                'Dim boundColumn As GridBoundColumn
                'boundColumn = New GridBoundColumn()
                'RadGrid1.MasterTableView.Columns.Add(boundColumn)
                'boundColumn.Aggregate = GridAggregateFunction.Sum
                'boundColumn.FooterText = "Sum of Hours:"
                'boundColumn.DataField = myWeeks.Item(i)
                'boundColumn.HeaderText = myWeeks.Item(i)
            Next
            'Iterate through myRecords and add hours where the task is in the range 
            Dim j As Integer
            For j = 0 To MyRecords.Tables("Resources").Rows.Count - 1
                Dim estimatedStart As Date = MyRecords.Tables("resources").Rows(j).Item("estimatedstartdate")
                Dim estimatedEnd As Date = MyRecords.Tables("resources").Rows(j).Item("estimatedenddate")
                Dim hours As Integer = MyRecords.Tables("resources").Rows(j).Item("esthours")
                Dim k As Integer
                For k = 0 To myWeeks.Count - 1
                    Dim weekstart As Date = myWeeks.Item(k)
                    Dim Weekend As Date = DateAdd(DateInterval.DayOfYear, 6, weekstart)
                    If estimatedStart <= Weekend And estimatedEnd >= weekstart Then
                        MyRecords.Tables("Resources").Rows(j).Item(weekstart) = hours
                    Else

                        MyRecords.Tables("Resources").Rows(j).Item(weekstart) = 0
                    End If

                Next
            Next
            MyRecords.Tables("Resources").Columns.Remove("EstimatedSTartDate")
            MyRecords.Tables("Resources").Columns.Remove("EstimatedEndDate")

            RadGrid1.DataSource = MyRecords.Tables("Resources")
            RadGrid1.DataBind()

End If
    End Sub

Eyup
Telerik team
 answered on 14 Apr 2015
5 answers
161 views
I’d like to create a list based on RadTreeList with different columns for nodes and their child nodes.  For example, I want to list all items that different shops have and therefore my parent node will be a shop with title, address, phone, url and child nodes are items it sells (title, price, quantity, rating, etc).

How can I do that or is there any workaround?

Ps. I wonder that in the “Pro Telerik ASP.NET and Silverlight Controls” book RadTreeList don’t even mentioned.

Regards,
Shamil
Konstantin Dikov
Telerik team
 answered on 14 Apr 2015
1 answer
84 views

Hi,

In Rad Editor when AutoResizeHeight="True", can not access content below big image.

It keeps flickering and shows top part of the content.

But in Google Chrome it is visible.

Best Regards,

Damodar

Dimitar
Telerik team
 answered on 13 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?