Telerik Forums
UI for WinForms Forum
1 answer
134 views
Hi everyone,

I would like to add a shortcut to my RadButtonItem without any Keys modifiers.
And the problem is I have no idea how I could make it without displaying the Delimiter - "+" (RadShortcut.Delimiter).

Code:
radButtonItem.Shortcuts.Add(new RadShortcut(0,Keys.F5)); 


Result:
Menu item look:
"text        +F5"
http://img195.imageshack.us/img195/7698/menushortcuts.jpg or attachments

Any ideas how I could remove this Delimiter?

Thanks in advance,
Adam




Stefan
Telerik team
 answered on 01 Jul 2010
2 answers
268 views
I am trying to inherit RadMenuItem (sample bellow), in order to add more properties required by our application.

Public Class TestMenuItem 
    Inherits RadMenuItem 
 
    Public Sub New() 
        Me.New(""Nothing
    End Sub 
 
    Public Sub New(ByVal text As String
        Me.New(text, Nothing
    End Sub 
 
    Public Sub New(ByVal text As StringByVal tag As Object
        MyBase.New(text, tag) 
    End Sub 
End Class 

When I try to add this new RadMenuItem in a RadMenu object, the visual display of the item is different from the actual RadMenuItem. I guess it is a ThemeEngine glitch. Do you have any advice on how to correctly inherit RadMenuItem?

This is a sample form where two menu items are added, one standard RadMenuItem (test1) and one from the inherited TestMenuItem (test2). Form1 has a RadMenu control added and it is a standard Windows.Form form.
Public Class Form1 
 
    Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load 
        Dim mi1 As New RadMenuItem("test1"
        Dim mi2 As New testMenuItem("test2"
        Me.RadMenuItem1.Items.Add(mi1) 
        Me.RadMenuItem1.Items.Add(mi2) 
    End Sub 
End Class 

In the attached image you can see the resulting runtime form with the difference in visual display of the two menu items.

We are currently evaluating your WinForms controls and we have little to no experience with your libraries :).
Constantinos Petridis
Top achievements
Rank 2
Iron
Iron
 answered on 01 Jul 2010
1 answer
188 views
Ok. I'm not 100% sure how to explain this: so here goes.
I have a user control that I made (see attachment control.jpg).

on loading the application I use the following code to dynamically create tabs. (Page is the usercontrol).

for (int i = 0; i < dtTabs.Rows.Count; i++) 
           
                Page cp = new Page(dtTabs.Rows[i].ItemArray[1].ToString(), sCon, at, isPrimary,this); 
                cp.Dock = DockStyle.Fill; 
                RadPanel rp = new RadPanel(); 
                rp.Controls.Add(cp); 
                rp.Dock = DockStyle.Fill; 
 
                TabItem tab = new TabItem(); 
                tab.Alignment = System.Drawing.ContentAlignment.BottomLeft; 
        tab.Name = dtTabs.Rows[i].ItemArray[1].ToString(); 
                tab.Text = dtTabs.Rows[i].ItemArray[1].ToString(); 
                tab.DisplayStyle = DisplayStyle.ImageAndText; 
                tab.TextImageRelation = TextImageRelation.ImageBeforeText; 
                 
 
                tab.ContentPanel.Controls.Add(rp); 
                cp.StartRefresh(); 
 
                tabMain.Items.Add(tab); 
 
 
            } 
 



however when I use the dock.Fill property, or the anchor properties... the control does not display properly... it cuts off the bottom of the control and the right of the control.. See attachment (main.jpg); 



Stefan
Telerik team
 answered on 01 Jul 2010
4 answers
1.4K+ views
Hi
i'm using radGridView and it seems that i cant set the grid header font at design time.
i've tried Element Hierarchy Editor and i've set my font in GridHeaderElement, but it seems it does not work.

i'm using 2010 Q2 and my grid is in ( RightToLeft = True) mode.

is there any other way to modify grid header at runtime?

ps: i also cant set header height in Element Hierarchy Editor  :(

tanx in advance
Alexander
Telerik team
 answered on 01 Jul 2010
1 answer
152 views
here is the idea of the code used to demo this bug.

create a new class


public partial class MainForm : Applications.UI.ShadowForm
{
   //in here create another class
   ChildClass cClass = new ChildClass()
 
   //link the parent object to the child class
   cClass._parent = this.

   //in the InitializeComponent tell it to hide the max button
   ....
    this.MaximizeBox = false;
   ....

  //tell the application to show you child class
   cClass.Show()


}


in the  cClass modifiy the parent MaximizeBox  to true

Result the box does not display untill you resize the parent. forcing it to re-draw.


Deyan
Telerik team
 answered on 01 Jul 2010
3 answers
221 views
Hi,

When i try to re-bind the datasource in RadGridView  Selection Changed event  throws  the below exception :  System.NullReferenceException: Object reference not set to an instance of an object. Pls any solution for this.


SampleCode :

using

 

System;

 

using

 

System.Collections.Generic;

 

using

 

System.ComponentModel;

 

using

 

System.Data;

 

using

 

System.Drawing;

 

using

 

System.Text;

 

using

 

System.Windows.Forms;

 

using

 

Telerik.WinControls;

 

using

 

Telerik.WinControls.UI;

 

namespace

 

RadGrid

 

{

 

public partial class RadForm1 : Telerik.WinControls.UI.RadForm

 

{

 

DataTable dtUserDetails = new DataTable();

 

 

public RadForm1()

 

{

InitializeComponent();

radGridView1.GridBehavior =

new GridBehavior();

 

}

 

private void RadForm1_Load(object sender, EventArgs e)

 

{

 

dtUserDetails.Columns.Add(

"ID");

 

dtUserDetails.Columns.Add(

"Name");

 

 

DataRow newRow;

 

 

for (int rowIndex = 0; rowIndex < 4; rowIndex++)

 

{

newRow = dtUserDetails.NewRow();

newRow[

"ID"] = rowIndex;

 

 

if (rowIndex == 0)

 

{

newRow[

"Name"] = "A";

 

}

 

else if (rowIndex == 1)

 

{

newRow[

"Name"] = "B";

 

}

 

else if (rowIndex == 2)

 

{

newRow[

"Name"] = "C";

 

}

 

else if (rowIndex == 3)

 

{

newRow[

"Name"] = "D";

 

}

 

else if (rowIndex == 4)

 

{

newRow[

"Name"] = "E";

 

}

 

else if (rowIndex == 5)

 

{

newRow[

"Name"] = "E";

 

}

dtUserDetails.Rows.Add(newRow);

}

dtUserDetails.AcceptChanges();

radGridView1.DataSource = dtUserDetails;

radTextBox1.DataBindings.Add(

"Text", dtUserDetails, "ID" );

 

radTextBox2.DataBindings.Add(

"Text", dtUserDetails, "Name");

 

 

}

 

 

private void radGridView1_SelectionChanged(object sender, EventArgs e)

 

{

 

//radGridView1.EndEdit();

 

 

if (dtUserDetails.GetChanges() != null)

 

{

 

if (MessageBox.Show("Do you want to save the changes", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)

 

{

 

this.radGridView1.GridElement.BeginUpdate();

 

radGridView1.Relations.Clear();

dtUserDetails.AcceptChanges();

 

this.radGridView1.GridElement.EndUpdate();

 

 

//radGridView1.DataSource = null;

 

 

//radGridView1.DataSource = dtUserDetails;

 

}

}

}

 

private void radGridView1_ValueChanged(object sender, EventArgs e)

 

{

 

//radGridView1.EndEdit();

 

 

}

 

private void radGridView1_CurrentColumnChanged(object sender, CurrentColumnChangedEventArgs e)

 

{

 

}

 

private void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)

 

{

 

if (dtUserDetails.GetChanges() != null)

 

{

 

if (MessageBox.Show("Do you want to save the changes", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)

 

{

 

this.radGridView1.GridElement.BeginUpdate();

 

dtUserDetails.AcceptChanges();

 

//this.suppliersTableAdapter.Fill(this.nwindDataSet.Suppliers);

 

 

this.radGridView1.GridElement.EndUpdate();

 

 

 

//radGridView1.DataSource = null;

 

 

//radGridView1.DataSource = dtUserDetails;

 

}

}

}

 

}

 

 

public class GridBehavior : Telerik.WinControls.UI.BaseGridBehavior

 

{

 

protected override bool OnMouseDownLeft(MouseEventArgs e)

 

{

 

GridDataCellElement cell = this.GridControl.ElementTree.GetElementAtPoint(e.Location) as GridDataCellElement;

 

 

if (cell != null

 

&& !cell.Equals(

this.GridControl.CurrentCell)

 

&& cell.RowInfo.Equals(

this.GridControl.CurrentRow)

 

&& cell.ColumnInfo.ReadOnly)

{

 

this.GridControl.EndEdit();

 

}

 

try

 

{

 

return base.OnMouseDownLeft(e);

 

}

 

catch (Exception ex)

 

{

 

MessageBox.Show(ex.Message);

 

 

return true;

 

}

}

}

}

Boryana
Telerik team
 answered on 01 Jul 2010
1 answer
253 views
Hello!

      I have read the following two posts



     And I am wondering, are the collapsing side panels in the Telerik examples project in WPF and thus not available in WinForms?  I need something exactly like that for my WinForms app, but I'm not sure if it exists (at least due to the second post I included above, where using the XP Collapsible Pane will not work for what I'm after...as I'm trying to find something similar to Visual Studio's Solution Explorer and Properties side bars without the pinning)  Are there any WinForms controls like that or is the XP Collapsible Pane the only option?

      Thanks for your time!
Nikolay
Telerik team
 answered on 30 Jun 2010
7 answers
247 views
Hi,

I am using "Edit UI elements" to style a RadGrid.
As soon as i change anything to do with Header part it breaks my application.

Error details
--------------------------
Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index

On following lines (pageName.Designer.cs) (As soon as i remove these lines, my code works fine.)
-----------------------------------------------------------------------------------------------------------------------------------
((Telerik.WinControls.UI.GridGroupHeaderItem)(this.radGridClinics.GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0))).BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(168)))), ((int)(((byte)(101)))));
            ((Telerik.WinControls.UI.GridGroupHeaderItem)(this.radGridClinics.GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0))).HorizontalLineWidth = 0;
            ((Telerik.WinControls.UI.GridGroupHeaderItem)(this.radGridClinics.GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(247)))), ((int)(((byte)(240)))));
            ((Telerik.WinControls.UI.GridGroupHeaderItem)(this.radGridClinics.GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(1).GetChildAt(0))).BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(168)))), ((int)(((byte)(101)))));
            ((Telerik.WinControls.UI.GridGroupHeaderItem)(this.radGridClinics.GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(0).GetChildAt(1).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(247)))), ((int)(((byte)(240)))));

Does anyone suggest what i am doing wrong here?

Thanks,
Narayan
Nikolay
Telerik team
 answered on 30 Jun 2010
2 answers
281 views
Hello,

Is it possible to add a image for a item of the RadDropDownList ?
 
Kind Regards,

Ramius
Ramius
Top achievements
Rank 1
 answered on 30 Jun 2010
0 answers
192 views
Hi,

I want to add a button or linklabel in radMultiColumnComboBox at specified column of specified row. Basicaly i want to achieve the following functionalities (PFA also):

  •  Replace the second col of fourth row in this dropdown "(Choose)" with a control and open a date selector control on that control's click.
  • Remove only horizontal lines of radMultiColumnComboBox2.EditorControl.
  • Remove space between the EditorControl's (grid inside multicolumn combo) border and combo's border. 

 

I am using telerik controls for windows application.


Thanks in advance,
Ravi
Ravi Kumar
Top achievements
Rank 1
 asked on 30 Jun 2010
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?