0 Replies - 433 Views - Last Post: 13 August 2013 - 04:26 PM Rate Topic: -----

#1 ebatkopat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 05-July 13

Problem: I can't save a datagridview+dataset created dynamically.

Posted 13 August 2013 - 04:26 PM

Public Class Form6
    Dim asdf As New DataTable

    Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DataGridView1.Size = New Point(DataGridView1.Columns.GetColumnsWidth(0) + 43, DataGridView1.Rows.GetRowsHeight(0) + 23)
        asdf.ReadXml("data/dict_replace.xml")
        DataGridView1.DataSource = asdf
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        DataGridView1.Size = New Point(DataGridView1.Columns.GetColumnsWidth(0) + 43, DataGridView1.Rows.GetRowsHeight(0) + 23)
        If DataGridView1.Rows.Count > 16 Then
            Panel1.Width = DataGridView1.Columns.GetColumnsWidth(0) + 62
        Else
            Panel1.Width = DataGridView1.Columns.GetColumnsWidth(0) + 45
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        asdf.TableName = "abto"
        asdf.WriteXml("data/dict_replace.xml")
        Me.Close()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        DataGridView1.DataSource = Nothing
        Me.Close()
    End Sub

End Class

When I click button 1; nothing happens.
Thanks in advance :)

Is This A Good Question/Topic? 0
  • +

Page 1 of 1