or
Private
Sub
TV_Reports_MouseDoubleClick(
ByVal
sender
As
Object
,
ByVal
e
As
System.Windows.Forms.MouseEventArgs)
Handles
TV_Reports.MouseDoubleClick
Try
Dim
filter
As
String
=
"ID='"
& TV_Reports.SelectedNode.Tag.ToString &
"'"
For
Each
row
As
DataRow
In
ds.Tables(
"TreeView_Reports"
).
Select
(filter)
If
row(
"Menu_Type"
).ToString =
"Report"
Then
Me
.SqlReportStr = row(
"Sql_Query"
)
Me
.Parent_StatusStripLabel.Text =
"Running report: "
& row(
"Name"
)
Me
.Parent_StatusStrip.Update()
Me
.Parent_StatusStrip.Refresh()
Dim
frm
As
New
Form_Report
frm.Text =
"Report: "
& row(
"Name"
)
frm.MdiParent =
Me
frm.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
frm.Dock = DockStyle.Fill
frm.WindowState = FormWindowState.Maximized
frm.Show()
End
If
Next
Catch
ex
As
Exception
End
Try
End
Sub
Public
Class
Form_Report
Dim
ds
As
New
DataSet
Dim
DT_Report_Results
As
New
DataTable(
"ReportResults"
)
Dim
SqlReportStr
As
String
=
Nothing
Dim
jobcount
As
Integer
= 0
Private
Sub
Form_Report_FormClosed(
ByVal
sender
As
Object
,
ByVal
e
As
System.Windows.Forms.FormClosedEventArgs)
Handles
Me
.FormClosed
ds.Clear()
ds.Dispose()
Me
.Dispose()
Me
.Cursor = Cursors.
Default
GC.Collect()
GC.WaitForPendingFinalizers()
GC.WaitForFullGCComplete()
GC.WaitForFullGCApproach()
GC.Collect()
End
Sub
Private
Sub
Form_Report_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
ds.Tables.Add(DT_Report_Results)
SqlReportStr = Form_Parent.SqlReportStr
Me
.Cursor = Cursors.WaitCursor
Dim
Search_Worker
As
New
BackgroundWorker
jobcount += 1
AddHandler
Search_Worker.DoWork,
New
DoWorkEventHandler(
AddressOf
StartReportFill)
AddHandler
Search_Worker.RunWorkerCompleted, _
New
RunWorkerCompletedEventHandler(
AddressOf
Search_worker_RunWorkerCompleted)
Search_Worker.RunWorkerAsync()
Search_Worker.Dispose()
End
Sub
Private
Sub
StartReportFill(
ByVal
sender
As
Object
,
ByVal
e
As
System.ComponentModel.DoWorkEventArgs)
FillSqlDs(
"ReportResults"
, SqlReportStr)
End
Sub
Private
Sub
Search_worker_RunWorkerCompleted(
ByVal
sender
As
Object
,
ByVal
e
As
RunWorkerCompletedEventArgs)
jobcount -= 1
GridLayout()
Me
.Cursor = Cursors.
Default
End
Sub
Private
Sub
GridLayout()
Try
GV_Reports.DataSource = ds
GV_Reports.DataMember =
"ReportResults"
Catch
ex
As
Exception
MsgBox(ex.Message)
End
Try
GV_Reports.Columns(
"Sys_ID"
).IsVisible =
False
Form_Parent.Parent_StatusStripLabel.Text =
"Ready!"
Form_Parent.Parent_StatusStrip.Update()
Form_Parent.Parent_StatusStrip.Refresh()
End
Sub
Private
Sub
FillSqlDs(
ByVal
tbl
As
String
,
ByVal
qry
As
String
)
If
Form_Parent.MyConnection.State = ConnectionState.Closed
Then
Form_Parent.MyConnection.Open()
End
If
'Using Form_Parent.MyConnection
Dim
Dadapter
As
New
SqlDataAdapter
Using Dadapter
Try
Dadapter.SelectCommand =
New
SqlCommand(qry, Form_Parent.MyConnection)
Dadapter.Fill(ds, tbl)
Catch
ex
As
Exception
MsgBox(ex.Message)
End
Try
End
Using
End
Sub
End
Class
I have a problem with ColumnChooser in RadGridView.
Please tell me how can I monitor when column visible state changed (For example when I drag and drop column from ColumnChooser to RadGridView or double click on it) ?
There may be some event ?