Telerik Forums
UI for WinForms Forum
1 answer
147 views
Hello,

I was wondering how I can go about interacting with the a radgridview on an active documentwindow. Here is my scenario:

1. Using a RadRibon form
2. Using RadDock with Autodetect MDI form
3 toolwindow with TreeView.
4. TreeView is filled from a dataset / datatable which is filled from SQL database

each node of the tree view has a unique SQL statement associated with it. This is my code when doubleclicking the node:

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

the public variable SqlreportStr is set so the Report form can read it and run the query

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


The problem that I have is that this form could be open several times at once displaying different data as the SQL queries are differnet. Also looking at the name of the form it comes accorss as Form_Report1, Form_report2 etc depending on what instance of the form that it is.

I am looking to be able to do the following with the girds:
1. export to excel
2. process each row of the grids in order to make other database changes.

if some one could point me to how I could exactly about interacting with the gridview i would greatly appreciate it.

thanks!

Jonathan
Martin Vasilev
Telerik team
 answered on 17 Jan 2011
3 answers
252 views
Hi,

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 ? 


Any help would be appreciated!

Regards!
Pavel
Top achievements
Rank 1
 answered on 17 Jan 2011
1 answer
144 views
Hi,
I am working on a radcontrols win forms application. In some cases I got an arithmetic overflow error.
The problem is not consistant. Last time the problem occured when I was trying to open the login form by clicking the radbutton menu item.
I have used the roundrectangle shape in all the forms to shape the controls.Is that the problem?
Can anyone tell me what is the problem ?

Regards
Ajith
Richard Slade
Top achievements
Rank 2
 answered on 17 Jan 2011
2 answers
894 views
I have a DateTimePicker Control.  I have set the ShowCheckBox Property to True.  I would like this checkbox to enable/disable the datetimepicker based on weather it is checked or not.  I'm surprised it doesn't do this by default.  Nor is there any other property to set to allow this behavior.  I also can't find any event to hook into that would allow me to achieve the desired results.

I did find through the smart tags how I could disable the two "parts" of the DateTimePicker (RadDateTimePickerArrowButtonElement, and RadMaskEditBoxElement) during design time.

Another approach, I guess that works is to attached to the value changed event.  This way as soon as a user sets the value from null to something, the checkbox could be checked for them.  This allows them to have the correct checkbox state, without manually checking it themselves.

Any help would be appreciated.


Thanks, 
Richard Slade
Top achievements
Rank 2
 answered on 17 Jan 2011
4 answers
174 views
Hi ,
    We want to set record navigator to the grid which shows us total rows in the grid and it shows like "Record 5 of 2000" ..
Richard Slade
Top achievements
Rank 2
 answered on 17 Jan 2011
7 answers
416 views
Hi all,
I am using radpanel's and not rad panel bars on my windows forms.  Problem is that there is a lot of flickering going on when the page loads. Its very annoying to the user atleast. I can see the controls being loaded and stuff on page load. I am using Q3 SP 2010. Do we have any fix to this?? I googled and found out that there might be problems wiht double buffering and stuff. ? Are we supposed to do anything like that. Any help on this would be great. 
Thanks
Nikolay
Telerik team
 answered on 17 Jan 2011
1 answer
145 views
Hi.
Is there any way to implement Paging in GridView,It becomes Useful for large data .
Nikolay
Telerik team
 answered on 17 Jan 2011
1 answer
168 views
Hi,
    We want to SetValue of a perticular cell ..
Like    grid.SetValue (ColumnName , Value)
          grid.GetValue(ColumnName)
,is this available in Radgrid, if not what is the alternative...
we want this in the button click event but not in the radgrid events..
Richard Slade
Top achievements
Rank 2
 answered on 16 Jan 2011
1 answer
180 views
Hi.
Is there any way to implement Paging in GridView,It becomes Useful for large data .
Richard Slade
Top achievements
Rank 2
 answered on 16 Jan 2011
2 answers
101 views
Hi Guys !!
              I am new here.I tried searching this question related material on this forum but cant able to find it out.... My Question is How to Load the Selected Value of Cell into the Text boxes. In Normal I know how to do via DataGridView. But cant able to figure out this thing in Telerik Controls.. Please Any Buddy know about this thing ???
Richard Slade
Top achievements
Rank 2
 answered on 15 Jan 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
NavigationView
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?