Telerik Forums
UI for WinForms Forum
8 answers
196 views
How can I ensure that a Form that has been docked to an MDIForm doesn't get docked a 2nd time?  That is, I need a Form to only be visible once.  I tried making it a singleton class, but calling the DockControl of the RadDock still added a same form , though one was an empty shell.
Julian Benkov
Telerik team
 answered on 27 Jun 2011
2 answers
103 views
Hi,
I have an unbound radgridview and i am trying to add some on-demand (unbound) hierarchical child/grid to it. It seems i have to "load data in the grid" twice to see data. The first time around, i get to see the columns in the master grid but no data. When i "load data in grid" again, i then get the data.

It seems that when the Master Gird is bound and then i create the on-demand child grid, i can see the data. I must be missing some step in the unbound mode and cannot figure out what. Please could you help?

My code (VS2008) is shown below. The issue is i have to click the Button1 twice to get data .
Thanks
Don

Imports Telerik.WinControls.UI
 
Public Class Form1
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 
        'clear all data (since we have to click twice to see the data)
        gridReview.Columns.Clear()
        gridReview.Rows.Clear()
 
        'set up columns
        gridReview.Columns.Add(New GridViewTextBoxColumn("ID"))
        gridReview.Columns.Add(New GridViewTextBoxColumn("Employee"))
        gridReview.Columns.Add(New GridViewTextBoxColumn("Code"))
        gridReview.Columns.Add(New GridViewTextBoxColumn("Total Hours"))
        gridReview.Columns.Add(New GridViewCheckBoxColumn("Review"))
 
 
        'setup some grid proerties
        gridReview.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
        gridReview.AllowAddNewRow = False
        gridReview.AllowDeleteRow = False
        gridReview.ShowGroupPanel = False
        gridReview.Columns(0).ReadOnly = True
        gridReview.Columns(1).ReadOnly = True
        gridReview.Columns(2).ReadOnly = True
 
        'load sample data
        gridReview.Rows.Add(1111, "John Smith", 423, 40.2, False)
        gridReview.Rows.Add(2222, "Jane Doe", 421, 10.2, False)
        gridReview.Rows.Add(3333, "Larry Smith", 423, 23.5, False)
        gridReview.Rows.Add(4444, "Lori Smith", 425, 26.1, False)
 
 
 
 
        'create the hierarchical grid
 
        Dim template As New GridViewTemplate()
        'setup hierarchical grid columns
        Dim id As New GridViewTextBoxColumn("ID")
        Dim shiftdate As New GridViewTextBoxColumn("DisplayDate")
        Dim in1 As New GridViewTextBoxColumn("In1")
        Dim out1 As New GridViewTextBoxColumn("Out1")
        Dim hours As New GridViewTextBoxColumn("Hours")
 
        'setup some hierarchical grid properties
        template.Columns.AddRange(id, shiftdate, in1, out1, hours)
        template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
        template.AllowAddNewRow = False
        template.AllowDeleteRow = False
        template.AllowEditRow = False
 
        gridReview.Templates.Add(template)
        template.HierarchyDataProvider = New GridViewEventDataProvider(template)
        'not specified relation as its on-demand.
        'code will be put in gridReview_RowSourceNeeded
 
 
 
    End Sub
 
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        AddHandler gridReview.RowSourceNeeded, AddressOf gridReview_RowSourceNeeded
 
    End Sub
 
    Private Sub gridReview_RowSourceNeeded(ByVal sender As Object, ByVal e As GridViewRowSourceNeededEventArgs)
        MessageBox.Show("Show some data")
 
 
    End Sub
 
 
End Class
Alexander
Telerik team
 answered on 27 Jun 2011
1 answer
182 views
Hey at Telerik

I subscibe to the event below and would like to show in the GridExpanderItem next to the plussign/minussign the number of child elements that exists in child GridViewTemplate.

All i can do is change the SignStyle, but there is no option for adding text.
I have tried to change the Text property, the size property and setting DrawTet to true, but with no luck.

Is there any way to add the text for instance "17" next to the plussign in GridExpanderItem ?

Perhaps it should be a setting that the number of child elements is shown near the expander.

I hope you can help me it's very important that the number is shown here to help people save time from expanding the element.

The tooltip just doesn't get the job done.

Sincerly Jan


private

 

void rgvEjendomme_ViewCellFormatting(object sender, CellFormattingEventArgs e)

 

{

 

GridGroupExpanderCellElement cell = e.CellElement as GridGroupExpanderCellElement;

 

 

if (cell != null && e.CellElement.RowElement is GridDataRowElement)

 

{

 

cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Visible;

cell.Expander.ToolTipText =
"Matrikler: " + ((Ejendom)e.Row.DataBoundItem).Matrikler.Count.ToString();

 

}

 

if (e.CellElement is GridDetailViewCellElement && e.CellElement.Children.Count != 0)

 

{

 

var pageView = e.CellElement.Children[0] as RadPageViewStripElement;

 

 

if (pageView == null)

 

{

 

return;

 

}

}

}

Svett
Telerik team
 answered on 27 Jun 2011
2 answers
248 views
Hi,

I'm using Winform Q1 2011 SP1 and VS2008.
While trying RadTreeView.SaveXML(@"TreeView.xml") , I noticed that information such as forecolor, strikeout fontstyle ...for each individual node is not saved in the XML document.
When using RadTreeView.LoadXML(@"TreeView.xml")), and while information such as CheckState="On" is in the XML document next to some nodes, the RadTreeView is loaded without any of the node's checkboxes being 'checked (they're all left unchecked).
Also and if I add manually Forecolor="Green" in the TreeView.xml document next to some nodes, the LoadXML method will assign correctly the color green to some nodes.

As I plan to let the user decide of the data to be added in the RadTreeView, it sounded like a promising feature, so is there anyway to correct the above (get checkboxes checked or unchecked, forecolor...)? 
SaveXML allows for some extra types to be saved. What are they? Any documentation on this?

The help file mentions also that 'For direct access to the tree view XML as text use the TreeViewXML property.'. How is this implemented concretely?

Best regards,
Alain Cavenaile

Alain
Top achievements
Rank 1
 answered on 25 Jun 2011
1 answer
142 views
Hi,
I have a gridview populated from a List<> and i want to be able to modify, delete or to add a new row (by clicking on "Add new row " at the bottom of the grid) directly on grid . After the user fills out all columns, he will click on a save button outside the grid. Now, i want to know how to iterate between gridview rows to know wich rows were added an wich were modified, deleted....
And depeding on the row state, i'll do an insert, update or delete on the Database.

Thank u very much!
Svett
Telerik team
 answered on 24 Jun 2011
4 answers
145 views

Hello I have created this simple bit of code that displays a hierarchial orders grid (see screen1.jpg)

Now I want to hide the +/- buttons if there are no rows (ie Order Ref 2 & 4) - Having searched the threads and copied the functions from those threads (RadGridView1_ViewCellFormatting,IsExpandable & RadGridView1_ChildViewExpanding)

It just hides them all because rowInfo.ChildRows.Count =0! (as per screen2.jpg)

Can anybody spot where I'm going wrong?


Many thanks

Terry

 

 


Public
Class Form1
  
      
  
      
    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Dim myOrders = New BindingList(Of Order)()
        Dim myOrderLines = New BindingList(Of OrderLines)()
  
        myOrders.Add(New Order(1, "01/01/2011", "Order for Warehouse"))
        myOrders.Add(New Order(2, "03/05/2011", "Order for home"))
        myOrders.Add(New Order(3, "12/05/2011", "Order ref xyz"))
        myOrders.Add(New Order(4, "16/05/2011", "Order ref abc"))
  
        myOrderLines.Add(New OrderLines(1, "Power Supply"))
        myOrderLines.Add(New OrderLines(1, "Hard Disk"))
        myOrderLines.Add(New OrderLines(3, "Keyboard"))
        myOrderLines.Add(New OrderLines(3, "Mouse"))
  
        RadGridView1.AutoGenerateHierarchy = False
        RadGridView1.AutoGenerateColumns = True
  
        Dim OrderLinesTemplate As New GridViewTemplate
        OrderLinesTemplate.AllowAddNewRow = False
         
  
        OrderLinesTemplate.DataSource = myOrderLines
        'RadGridView1.MasterTemplate.Templates.Add(RolesAndPositionTemplate)
        Me.RadGridView1.MasterTemplate.Templates.Add(OrderLinesTemplate)
  
        'create the relation
        Dim relation As New GridViewRelation(RadGridView1.MasterTemplate)
        relation.RelationName = "Order Lines"
        relation.ParentColumnNames.Add("OrderId")
        relation.ChildColumnNames.Add("OrderLineId")
        relation.ChildTemplate = OrderLinesTemplate
        Me.RadGridView1.Relations.Add(relation)
  
        Me.RadGridView1.DataSource = myOrders
  
  
  
    End Sub
    Private Sub RadGridView1_ViewCellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.ViewCellFormatting
  
        Dim cellX As GridGroupExpanderCellElement = TryCast(e.CellElement, GridGroupExpanderCellElement)
        If cellX IsNot Nothing AndAlso TypeOf e.CellElement.RowElement Is GridDataRowElement Then
  
            If Not IsExpandable(cellX.RowInfo) Then
                cellX.Expander.Visibility = ElementVisibility.Hidden
            Else
                cellX.Expander.Visibility = ElementVisibility.Visible
            End If
        End If
  
  
    End Sub
  
    Private Function IsExpandable(rowInfo As GridViewRowInfo) As Boolean
  
        If rowInfo.ChildRows IsNot Nothing AndAlso rowInfo.ChildRows.Count > 0 Then
            Return True
        Else
            Return False
        End If
  
    End Function
  
    Private Sub RadGridView1_ChildViewExpanding(sender As Object, e As Telerik.WinControls.UI.ChildViewExpandingEventArgs) Handles RadGridView1.ChildViewExpanding
        e.Cancel = Not IsExpandable(e.ParentRow)
    End Sub



Martin Vasilev
Telerik team
 answered on 24 Jun 2011
1 answer
99 views
Hi Guys,
    We are working in the Q2 SP1 version. I got one Problem in the Auto suggest functionality in the GridViewComboBox Column in the GridView.

My Requirement is: If i enter the letters as "dab", the Resulting options with in the Combobox is starting with the "dab" options with in the ComboBox Column. But now m getting "dab" options is the Last options in the List, I mean before this option, starting options will starts with c Options. If u want more Clarity see the attachment for Normal dropdown, i need the exact requirement in the GridView Combobox Columns. If it is not possible in the Normal GridView Combobox Column, Pls provide the alternative solution to achieve this functionality.

Thanks,
Karthikeya.
Nikolay
Telerik team
 answered on 24 Jun 2011
1 answer
114 views
How can I change the background color of a new row that has just been added. I am currently using RowFormatting for other conditions. Basically, I want to show the user when a value in a cell in a row has changed, or when they add a row. Any suggestions?
Chris
Top achievements
Rank 1
 answered on 23 Jun 2011
2 answers
101 views
Hi

Does ExportToExcelML  can export grid even if it has ChildGrid?  
if Yes any sample code ?

Regards
Nathaniel
Top achievements
Rank 1
 answered on 23 Jun 2011
3 answers
87 views
Under the newest Telerik controls for Winforms (2011.1.11.419) -- Ungrouping seems to have changed. Instead of being able to drag from the group panel to ungroup - you must hit the "X". My users have a problem with this and would prefer the Drag and Drop Ungrouping feature.

Was this removed? And if so, is there a workaround I might employ?

Thanks
Jack
Telerik team
 answered on 23 Jun 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
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
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
Licensing
VirtualKeyboard
DataLayout
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?