export to excel broken after upgrade to to April build

7 posts, 0 answers
  1. Jonathan Hylton
    Jonathan Hylton avatar
    20 posts
    Member since:
    Sep 2009

    Posted 10 May 2011 Link to this post

    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
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 12 May 2011 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jonathan Hylton
    Jonathan Hylton avatar
    20 posts
    Member since:
    Sep 2009

    Posted 12 May 2011 Link to this post

    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!
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 17 May 2011 Link to this post

    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.
  6. Jonathan Hylton
    Jonathan Hylton avatar
    20 posts
    Member since:
    Sep 2009

    Posted 18 May 2011 Link to this post

    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
  7. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 20 May 2011 Link to this post

    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.
  8. Jonathan Hylton
    Jonathan Hylton avatar
    20 posts
    Member since:
    Sep 2009

    Posted 20 May 2011 Link to this post

    Thanks alot Martin,

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

    thanks again!

    Jonathan
Back to Top
UI for WinForms is Visual Studio 2017 Ready