This is a migrated thread and some comments may be shown as answers.

export to excel broken after upgrade to to April build

6 Answers 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jonathan Hylton
Top achievements
Rank 1
Jonathan Hylton asked on 10 May 2011, 04:33 PM
Hi there,

After upgrading my project to the latest telerik build, my ability to export to excel has broken. Here is the code i was using:

Dim Exporter As New Export.ExportToExcelML(activegrid)
        Try
            Exporter.RunExport(file)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
End Sub

Any idea how this should be written now?

thanks!

Jonathan

6 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 12 May 2011, 07:44 AM
Hello Jonathan,

Thank you for writing.

I have taken a look at your code and it should work with the latest release. Could you please ensure that your project includes reference to TelerikData.dll assembly?

Let me know if you still experience any issues with the exporting functionality.

Greetings,
Martin Vasilev
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
Jonathan Hylton
Top achievements
Rank 1
answered on 12 May 2011, 03:08 PM
Thanks Martin,

I have looked and I did have a refrerence to this, however i guess from the upgrade it no longer could see the .dll. I have deleted it from Project Properties --> references and readded it and now this is working as it expected.

unfortunately there were 2 other issues that I have now found as well that are no longer working in the upgraded project.

the first is me binding my treeview to a dataset. This worked fine in the last several versions as i used this sub in a previous project as well over a year ago, however now the Nodes are not being binded correctly. If i put in a try statement all nodes come with no hierarchy.

Public Sub BindTreeViewReports()
        Try
            Me.TV_Reports.DataSource = Nothing
        Catch ex As Exception
            Debug.WriteLine(ex.Message)
        End Try
  
        Me.TV_Reports.ValueMember = "ID"
        Me.TV_Reports.ParentIDMember = "ParentID"
        Me.TV_Reports.DisplayMember = "Name"
        Me.TV_Reports.DataSource = ds.Tables("TreeView_Reports")
  
        For Each node As RadTreeNode In Me.TV_Reports.Nodes
        Dim filter As String = "ID = '" & node.Tag.ToString & "'"
            For Each row As DataRow In ds.Tables("TreeView_Reports").Select(filter)
                If row("Menu_Type").ToString = "Folder" Then
                    node.ImageIndex = 0
                ElseIf row("Menu_Type").ToString = "Report" Then
                    node.ImageIndex = 2
                End If
                SetTreeViewImages(node)
            Next
        Next
    End Sub

the dataset would look like this:

ID ParentID Name Menu_Type
1 NULL Windows Server Team Folder
34 1 System Type Reports Folder
35 1 System Agent Reports Folder
36 1 Os Reports Folder
38 36 Server 2000 Report
40 34 Citirx Report
41 1 Servers By Office Folder
42 41 AMER Folder
43 41 EMEA Folder
44 41 APAC Folder

the second issue i have not found is in the designer dealing with my primary form. I have a ribbon bar, however I can no longer select or navigate within the ribbon bar tabs or groups.

Can you give me a recommendation on the best way to upgrade in future? as of now I am uninstalling the entire suite and then installing the latest version. From there I run the project upgrade wizzard.

any help you can give would be greatly appreciated.

thanks!
0
Martin Vasilev
Telerik team
answered on 17 May 2011, 03:23 PM
Hi Jonathan Hylton,

Thank you for getting back to me.

I have examined your code and noticed that the ChildMember property is not initialized properly. I suppose that this is the reason for the binding issue. You can find details on how to use this property in our product documentation.

As for the RibbonBar issues, we have noticed similar issues and addressed them in our latest internal build. I recommend that you download it from our site and give it a try.

Please let me know if you still experience any issues with that.

Regards,
Martin Vasilev
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
Jonathan Hylton
Top achievements
Rank 1
answered on 18 May 2011, 10:38 AM
Hi Martin,

Thanks for the link. Following the documentation found here: /treeview-data-binding-binding-to-self-referencing-data.html

this is what I have been doing in the past. I have changed my code to resemble this and able to have the treeview built, however I need to be able to programatically find the "ID" of each node or what the value was for the child member when creating the tree view. In the old version using ValueMember would keep this data and it was found under node.tag and it was easy for me to referece, however now I can not seem to locate this. Can you please let me know how I can go about finding the "ID" from the nodes in the treeview once it has been bound to the datatable?

thanks!

Jonathan
0
Martin Vasilev
Telerik team
answered on 20 May 2011, 05:01 PM
Hi Jonathan Hylton,

Thank you for getting back to me.

You can get the underling data item for every tree node through DataBoundItem property. Once you have it, you can access all required fields. For example:

DataRowView rowView = this.radTreeView1.Nodes[0].DataBoundItem as DataRowView;
int id = Convert.ToInt32(rowView["ID"]);

Hope this helps. Let me know if you have any additional questions.

Greetings,
Martin Vasilev
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
Jonathan Hylton
Top achievements
Rank 1
answered on 20 May 2011, 06:30 PM
Thanks alot Martin,

This helps tremendously and can see using this method in other locations of my code!

thanks again!

Jonathan
Tags
GridView
Asked by
Jonathan Hylton
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Jonathan Hylton
Top achievements
Rank 1
Share this question
or