Telerik Forums
UI for WinForms Forum
3 answers
434 views
Hi, I'm trying to build a custom theme to use over all my application.
I stardet from an existing theme, as suggested, and I've build my custom them as a tssp file.

I added the tssp to my project and I setted it as application theme:

ThemeResolutionService.LoadPackageResource("MyProject.MyCustomTheme.tssp")
ThemeResolutionService.ApplicationThemeName = "MyCustomTheme"

When I build and I run the application, all the forms and controls appears with my custom theme, and this is very good.
But at design time, using the visual studio form editor I don't see my theme.
How can I see my theme even in design time?

Do I have to load the same theme using a RadThemeManager (from the xml equivalent files) and set the ThemeName property for all controls?
If yes, which is the utility of using the ApplicationThemeName property?

Thank you.
Stefan
Telerik team
 answered on 02 Nov 2012
1 answer
140 views
   I have made my custom ribbon bar like this:
  
public class TMRibbonBar:RadRibbonBar
{
}

in similar fashion, I have made my custom buttons ie.RadButtonElement, RadCheckBoxElement.
What I want is how can I add a button of my own in the "Add an Item" option of "Right Click - Context Menu" of "RadRibbonBarGroup". I mean, my custom button should appear in the list to be selected.

I can add my custom button in the RadRibbonBarGroup dynamically, but how can I do it through the UI?
I hope am not raising a totally invalid requirement.
Stefan
Telerik team
 answered on 02 Nov 2012
3 answers
205 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
135 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
154 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
145 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
119 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
119 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
96 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
291 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
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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?