Telerik Forums
UI for WinForms Forum
3 answers
482 views
Hi Telerik Team,

We are having some problems with context menus in a radtreeview. I'll try to explain myself. We want to have two different context menus: one in the tree nodes and another different one in the tree view. That's because we want to have actions performed on a tree node (copy, paste, rename...), and different actions performed on the tree (add new nodes to tree.Nodes).

We don't want to have a root node at tree.Nodes where the rest of nodes hang, so that's what we've done so far:

We have a treeview. With a ContextMenuManager we add a context menu to the treeview ('treeviewContextMenu').
   this.radContextMenuManager1.SetRadContextMenu(this.treeView1,this.radContextMenuTree); 

Programmaticaly we add nodes to the tree, and we add a different contextmenu to the nodes:
RadTreeNode node = new RadTreeNode(); 
// fill more node properties 
node.ContextMenu = radContextMenuNodes.DropDown; 

At first we thought it worked but now we want to use this on a different tree where the nodes context menu has only one option while the tree one has many. And now we realized that both context menu are showing! Nodes context menu above tree context menu.

http://img129.imageshack.us/img129/2296/80110580.jpg

What are we doing wrong? Is there a way to do what we need? Could you help us, please?

We are using Q3 2008 version.

Thanks in advance.

Teba.


Julian Benkov
Telerik team
 answered on 18 Jan 2011
4 answers
181 views
I have some question about Rotator control.
1. How to using Rotator control.
2. How to using Rotator with Carousel.
3. The Rotator ContainerItem can contain other aplication(i can dislay other aplication in containerItem????)????

Can you attack some example about using Rotator control???

Thank and best regard!!!
Ivan Petrov
Telerik team
 answered on 18 Jan 2011
6 answers
149 views
Hello. I have used a RadRibbonForm and dropped a Windows7Theme on it. I explicitly specified the theme name on the controls (RibbonBar, StatusStrip). The Visual Studio IDE shows me the correct Office 2010-like ribbon interface. How ever, upon running on my Windows 7 x64 machine, The rendered form look somewhat different.

Please see attached image.

Also, I'm tired of specifying the theme on every element. I'm using Visual Inheritance and my Base form has an instance of Windows7Theme element dropped on it with it's modifiers being Private. All forms inheriting the Base Form are rendering with Windows7 theme but all elements on the form(s) are not. I have asked this question here as well.

Please help me out, kindly.
Peter
Telerik team
 answered on 18 Jan 2011
2 answers
259 views
I'm attempting to bind a Grid (programmatic-approach) through LINQ. Here is the scenario: I have a table of clients. Every client has branches and coordinators. They have more collections but I don't want to expose them. I want to show the clients in a grid with different filtering criteria. For every client, the row expands to two tabs: Branches and Coordinators

The sub rows in the Branches View and Coordinator View must NOT be further expandable.

I want to select the columns to be shown in the Branches and Coordinators Details View.

I have tried these two approached with no success:

RadGridViewSearch.DataSource = from pharms in DbContext.Pharmacies
                 where pharms.IsActive && pharms.Branches.Count > 0
                 orderby pharms.Name
                 select new {
                   pharms.OID,
                   pharms.Name,
                   pharms.PhoneNumber,
                   AddressInfo = String.Format("{0} {1} {2} {3}",
                         pharms.Contact.Addresses.FirstOrDefault().HouseNumber ??
                         String.Empty,
                         pharms.Contact.Addresses.FirstOrDefault().Street ??
                         String.Empty,
                         pharms.Contact.Addresses.FirstOrDefault().Area ??
                         String.Empty,
                         pharms.Contact.Addresses.FirstOrDefault().PostCode ??
                         String.Empty),
                   CityName = pharms.Contact.Addresses.FirstOrDefault().City.Name,
                   pharms.Branches,
                   pharms.PharmacyCoordinators
                 };
 
RadGridViewSearch.DataSource = from pharms in DbContext.Pharmacies
                 from branches in pharms.Branches.DefaultIfEmpty()
                 from coords in pharms.PharmacyCoordinators.DefaultIfEmpty()
                 where pharms.IsActive && pharms.Branches.Count > 0 && pharms.PharmacyCoordinators.Count > 0
                 orderby pharms.Name
                 select new {
                   ClientOID = pharms.OID,
                   ClientName = pharms.Name,
                   ClientPhoneNumber = pharms.PhoneNumber,
                   ClientAddressInfo = string.Format("{0} {1} {2} {3}",
                         pharms.Contact.Addresses.FirstOrDefault().HouseNumber ??
                         string.Empty,
                         pharms.Contact.Addresses.FirstOrDefault().Street ??
                         string.Empty,
                         pharms.Contact.Addresses.FirstOrDefault().Area ??
                         string.Empty,
                         pharms.Contact.Addresses.FirstOrDefault().PostCode ??
                         string.Empty),
                   ClientCityName = pharms.Contact.Addresses.FirstOrDefault().City.Name,
                   BranchOID = branches.OID,
                   BranchName = branches.BranchNumber,
                   BranchPhoneNumber = branches.PhoneNumber,
                   BranchAddressInfo = String.Format("{0} {1} {2} {3}",
                          branches.Contact.Addresses.FirstOrDefault().HouseNumber ??
                          String.Empty,
                          branches.Contact.Addresses.FirstOrDefault().Street ??
                          String.Empty,
                          branches.Contact.Addresses.FirstOrDefault().Area ??
                          String.Empty,
                          branches.Contact.Addresses.FirstOrDefault().PostCode ??
                          String.Empty),
                   BranchCityName = branches.Contact.Addresses.FirstOrDefault().City.Name,
                   CoordinatorOID = coords.OID,
                   CoordinatorName = coords.FirstName + " " + coords.LastName,
                   CoordinatorCell = coords.MobileNumber,
                   CoordinatorEmail = coords.Email
                 };

The first one produces the desired result in short time but the results are uncontrolled. I cant prevent deep-drilling, Tabs names, and Columns. The second one produces liners results and hence that fails as well. And the second one takes massive time...

Can anyone guide on this?

Objective: Create Master details grid with full control of all Column Headers (Master + Detail), All details Tabs Names
Julian Benkov
Telerik team
 answered on 18 Jan 2011
9 answers
611 views
Are there any examples for doing an auto-complete with the WinForms GridView?  If not, is this something that can easily be done with the WinForm GridView?
Svett
Telerik team
 answered on 18 Jan 2011
2 answers
338 views
Hello my friends,

Is there a nice way for letting the user to set default values for some of the columns for new row? (when adding new row it will contains the default values (template row or something like this))

Another little question: can you tell me where i can find winforms grid view advanced demos? most of the demos i saw in the telerik tv are in high level.

Thank you very much!
Tomer
Richard Slade
Top achievements
Rank 2
 answered on 18 Jan 2011
3 answers
225 views
Hi:
I need to put a code with which the color of my button is the same that appears when you put your mouse over it.
Thanks.
Richard Slade
Top achievements
Rank 2
 answered on 18 Jan 2011
1 answer
174 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
258 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
158 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
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)
Form
Chart (obsolete as of Q1 2013)
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?