Telerik Forums
UI for WinForms Forum
3 answers
164 views
Win 7 - 64bit,
Telerik WinForms Controls 2012.2.912.40
Using VB.net

Hello:

I placed a RadContextMenu on a Form
I then attempted to associate the RCM to a RadGridView in the ContextMenuOpening Event...

 

 


Private
Sub RGV_ContextMenuOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs)

 

    e.ContextMenu =

 

Me.RadContextMenuForGrids

 

End

 

 

Sub

 

Why is the compiler seeing the 2 objects as being different.  Here is the error?

RadContextMenu cannot be converted to RadDropDownMenu?

Thanks,
Mark

Stefan
Telerik team
 answered on 02 Nov 2012
1 answer
95 views
Helo,

I have severals radgrid superposed (like picture ) and 
I want to remove border of cell (highlited) in a radgrid if the cell is not selected  to keep only one cell highlited (selected cell)
I use a CellSelect mode

I tried this code but the result is ugly, Because of original cell border (blue) is deleted Also

RadGridView_ViewCellFormatting(object sender, CellFormattingEventArgs e)
    {
     GridDataCellElement dataCell = e.CellElement as GridDataCellElement;
      if (dataCell != null)
      {
          Color borderColor = Color.Transparent;
        if (!dataCell.IsSelected)
          borderColor = Color.Red;
         
         dataCell.BorderColor = borderColor;
      }
        
  }

Thank you for your help,
Ivan Petrov
Telerik team
 answered on 02 Nov 2012
1 answer
128 views
Hi I need to call the SelectedIndex event after loading the form.
The reason for this is that the dropdownlist determines if other controls are displayed on the form

here is a example of the idea
Partial Class Example
     Public Function LoadData() As Boolean
      
       Me.DropDownList1.DataSource = Types.ConfirmationType
 
        If Not CustomerName Is Nothing Then
 
            ' Where the DropDownlist ID is DropDownList1
            Me.DropDownList1.SelectedText = "Driver"
             
            ' Calls the method directly passing the appropriate sender
            Me.DropDownList1_SelectedIndexChanged(Me.DropDownList1, Nothing)
        End If
     End Function
 
    Protected Sub DropDownList1_SelectedIndexChanged(sender As System.Object, e As Telerik.WinControls.UI.Data.PositionChangedEventArgs) Handles DropDownList1.SelectedIndexChanged
          
        Dim options As String = Me.DropDownList1.SelectedText
 
        Select Case options
            Case "Driver"
                'Display the Driver mobile fields
                Me.lblDriverMobile.Visible = True
                Me.txtDriverMobile.Visible = True
                Me.ddlDriverMobileCode.Visible = True
                Me.pbDriverMobile.Visible = True
            Case Else
                'Hide the Driver mobile fields
                Me.lblDriverMobile.Visible = False
                Me.txtDriverMobile.Visible = False
                Me.ddlDriverMobileCode.Visible = False
                Me.pbDriverMobile.Visible = False
 
        End Select
     End Sub
End Class

The issue is that the call does not happen and the line 

Me.DropDownList1_SelectedIndexChanged(Me.DropDownList1, Nothing)

Does not seem to work ?
What I get in the options value is a empty string ?

Any ideas
Peter
Telerik team
 answered on 02 Nov 2012
1 answer
126 views
I have the following RowSourceNeeded handler :

void gvEmployes_RowSourceNeeded(object sender, GridViewRowSourceNeededEventArgs e)
{
    if (e.Template == gvtEmployeLogiciels)
    {
        using ( var repo = new EmployesRepository())
        {
            foreach (LogicielDTO l in repo.GetLogicielsOfEmploye((EmployeDTO)e.ParentRow.DataBoundItem))
            {
                GridViewRowInfo gridRow = e.Template.Rows.NewRow();
                gridRow.Cells["nom"].Value = l.nom;
                gridRow.Cells["nbLicense"].Value = l.nbLicense;
                e.SourceCollection.Add(gridRow);
            }
        }
    }
}

However, I want the objects to be bound instead of just filling in cells so that something like this would work :

void gvEmployes_UserDeletingRow(object sender, GridViewRowCancelEventArgs e)
{
    foreach (var row in e.Rows)
    {
        switch (row.DataBoundItem.GetType().Name) // This will error if you are deleting a LogicielDTO row.
        {
            case "EmployeDTO":
                MessageBox.Show("Deleteing " + ((EmployeDTO)row.DataBoundItem).nom);
                break;
            case "LogicielDTO":
                MessageBox.Show("Deleteing " + ((LogicielDTO)row.DataBoundItem).nom);
                break;
        }
    }
}

How can I acheive this?
Julian Benkov
Telerik team
 answered on 02 Nov 2012
1 answer
93 views
Hi,

I want to add 8 radio buttons , in tabular fashion in radribbon bar(Please check in attached image).
I have added a  RadRibbonbarGroup=>2 horizontal RadRibbonbarButtons(with vertical orientation).

As these buttons are placed in two separate ribbonBarbuttons,therefore I can select two radio buttons simultaneously , one from each ribbonbarButton.

Please let me know how to keep the group of radiobuttons same, although are placed in different radribbonbarButton group.

Thanks in Advance!
Anjali
Anton
Telerik team
 answered on 02 Nov 2012
1 answer
92 views
Upgraded to the latest version of telerik.  From v.2012.1.301 to v2012.3.1017.  We now get the following exception when UI adds a UserControl, which has a RadTreeView to a RadPageViewTabPage:



ExceptionMessageBoxShown@Value of '-2147483648' is not valid for 'LargeChange'. 'LargeChange' must be greater than or equal to 0.
Parameter name: LargeChange
System.ArgumentOutOfRangeException: Value of '-2147483648' is not valid for 'LargeChange'. 'LargeChange' must be greater than or equal to 0.
Parameter name: LargeChange
   at Telerik.WinControls.UI.RadScrollBarElement.set_LargeChange(Int32 value)
   at Telerik.WinControls.UI.RadTreeViewElement.UpdateOnMeasure(SizeF availableSize)
   at Telerik.WinControls.UI.VirtualizedScrollPanel`2.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.RootRadElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RootRadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.RadElementTree.PerformInnerLayout(Boolean performMeasure, Int32 x, Int32 y, Int32 width, Int32 height)
   at Telerik.WinControls.RadControl.OnLoad(Size desiredSize)
   at Telerik.WinControls.UI.RadTreeView.OnLoad(Size desiredSize)
   at Telerik.WinControls.RadControl.LoadElementTree(Size desiredSize)
   at Telerik.WinControls.RadControl.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Control.set_Visible(Boolean value)
   at Telerik.WinControls.UI.RadPageViewPage.set_Visible(Boolean value)
   at Telerik.WinControls.UI.RadPageViewElement.SetSelectedContent(RadPageViewItem item)
   at Telerik.WinControls.UI.RadPageViewElement.SetSelectedItem(RadPageViewItem item)
   at Telerik.WinControls.UI.RadPageViewStripElement.SetSelectedItem(RadPageViewItem item)
   at Telerik.WinControls.UI.RadPageViewElement.OnSelectedPageChanged(RadPageViewEventArgs e)
   at Telerik.WinControls.UI.RadPageView.SetSelectedPage(RadPageViewEventArgs e)
   at Telerik.WinControls.UI.RadPageView.set_SelectedPage(RadPageViewPage value)
   at MainApp.MainShell.Display(IContent aContent) in C:\svn\dev\source\ui\MainApp\MainShell\MainShell.cs:line 1832
Peter
Telerik team
 answered on 01 Nov 2012
1 answer
76 views
I feel like this is something obvious that I am overlooking.  I want to insert a bulleted list into a richtextbox at design time.  I use the MarkupEditor to get the list in and it displays the text with the proper formatting in the Text property but nothing shows up in the richtextbox itself.  The help document states that design time text can be inserted and made read only.  What am I missing here?
Julian Benkov
Telerik team
 answered on 01 Nov 2012
1 answer
258 views
The documentation states:

If you want to set initial values, you should match the GridViewComboBoxColumn to a column which has appropriate values in it. To do this, you should set the FieldName of the GridViewComboBoxColumn to be the same as the name of the existing column.

Can I see a code sample of how this is done?

I have a text column that I am able to successfully bind to show the values, but I'm not able to replace that text column with a ComboBoxColumn and still have it set the initial values like the text column does. Here's a code sample of what I've tried:

uxgrdBindingsGrid.MasterTemplate.Columns.Clear();
uxgrdBindingsGrid.AutoGenerateColumns = false;
uxgrdBindingsGrid.DataSource = bindings.ToList<SymbolBinding>();
 
 // this textbox column displays fine
GridViewTextBoxColumn dataSourceTextColumn = new GridViewTextBoxColumn();
dataSourceTextColumn.Name = "dataSourceTextColumn";
dataSourceTextColumn.HeaderText = "Data Source";
dataSourceTextColumn.FieldName = "DataSourceProperty";
dataSourceTextColumn.TextAlignment = ContentAlignment.MiddleLeft;
dataSourceTextColumn.Width = 150;
dataSourceTextColumn.IsVisible = true;
uxgrdBindingsGrid.MasterTemplate.Columns.Add(dataSourceTextColumn);
 
// this combobox column displays the drop down list if double-clicked, but does not display any values initially
GridViewComboBoxColumn dataSourceComboColumn = new GridViewComboBoxColumn("DataSourceProperty");
dataSourceComboColumn.Name = "dataSourceComboColumn";
dataSourceComboColumn.HeaderText = "Data Source";
dataSourceComboColumn.DataSource = this.dataSources;
dataSourceComboColumn.DropDownStyle = RadDropDownStyle.DropDownList;
dataSourceComboColumn.ValueMember = "ID";
dataSourceComboColumn.DisplayMember = "Path";
dataSourceComboColumn.FieldName = "DataSourceProperty";
dataSourceComboColumn.TextAlignment = ContentAlignment.MiddleLeft;
dataSourceComboColumn.Width = 150;
uxgrdBindingsGrid.MasterTemplate.Columns.Add(dataSourceComboColumn);


Thanks,
--Jason
Stefan
Telerik team
 answered on 01 Nov 2012
1 answer
386 views
Hi,
I tried to create a commandbar with only CommandBarButton elements, each one displayed as image only.
How can I set by default the size to contains 32x32 images instead of 16x16?

Thank you
Anton
Telerik team
 answered on 01 Nov 2012
2 answers
201 views
Hi,

I'd like to conditionally format each token in a RadAutoCompleteBox control depending on the value of the each token. For example, I'd like to format all items that can be matched in the AutoComplete collection as green and all unmatched items in red.

There is an introduction on formatting tokens at:

http://www.telerik.com/help/winforms/editors-autocompletetextbox-formatting-blocks.html

however I can't find a property in the token variable that gives me access to the corresponding entry in the Items collection in the RadAutoCompleteBox control so that I can style the token conditionally. How can I get access to corresponding item being formatted?

Kind regards,
Dave.
David
Top achievements
Rank 2
 answered on 01 Nov 2012
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?