Telerik Forums
UI for WinForms Forum
4 answers
284 views

I created a support ticket and asked the following question:

I am binding a RadGridView to a SQL Server table.
The code below returns the following Data Exception Error:
Cannot set column 'SSAN'. The value violates the MaxLength limit of this column.

The SSAN field is a varchar(9). It should store 111223333 and not 111-22-3333. How can I set the column to save the text without the literals?

 

Dim col As GridViewMaskBoxColumn = New GridViewMaskBoxColumn
With col
.Name = "SSAN2"
.FieldName = "SSAN"
.HeaderText = "SSN"
.MaskType = MaskType.Standard
.Mask = "000-00-0000"
.TextAlignment = ContentAlignment.MiddleCenter
.DataType = GetType(String)
'.FormatString = "{0:000-00-0000}"
End With
RadGridView1.MasterTemplate.Columns.Add(col)


Svett from Telerik answered with the following:

You can achieve that by creating a custom editor:
Public Class CustomMaskedEditor
Inherits RadMaskedEditBoxEditor
Public Overrides Property Value() As Object
Get
Dim value__1 As Object = MyBase.Value
value__1 = Convert.ToString(value__1).Replace("-", String.Empty)
Return value__1
End Get
Set
MyBase.Value = value__1
End Set
End Property
End Class

Then you should use the EditorRequired event of RadGridView to replace the default one:
Private Sub radGridView1_EditorRequired(sender As Object, e As EditorRequiredEventArgs)
If e.EditorType = GetType(RadMaskedEditBoxEditor) Then
e.EditorType = GetType(CustomMaskedEditor)
End If
End Sub



I did not realize that my ticked had been closed because of my delayed response and I asked  Svett if the following would not also be a solution:
Imports Telerik.WinControls.UI
Public Class CustomMaskedEditor
Inherits RadMaskedEditBoxEditor
Public Overrides Sub BeginEdit()
MyBase.MaskTextBox.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals
MyBase.BeginEdit()
Me.EditorElement.Focus()
End Sub
End Class

Can anyone tell me if this is not an acceptable way to only have the numbers saved to the database? 
Peter
Telerik team
 answered on 05 Sep 2012
4 answers
217 views

Upgraded to Version 2012.2.726.40 today and have been struggling to get my project working again. 

One thing I noticed right away is that my command buttonelements in my grid no longer display their images.

here's how I am adding them in code:

private void radGridViewJobs_CellFormatting(object sender, CellFormattingEventArgs e)
{
    try
    {
        foreach (RadElement ele in e.CellElement.Children)
        {
            if (ele is RadProgressBarElement)
            {
                e.CellElement.Children.Remove(ele);
                break;
            }
 
        }
 
        if (e.CellElement is GridCommandCellElement && !(e.CellElement.RowElement is GridTableHeaderRowElement))
        {
 
            GridViewCommandColumn column = (GridViewCommandColumn)e.CellElement.ColumnInfo;
            String colname = column.FieldName.ToLower();
            if (colname == "stationview")
            {
                RadButtonElement element = (RadButtonElement)e.CellElement.Children[0];
                element.Image = global::PayerConnectClient.Properties.Resources.workstation;
                element.DisplayStyle = DisplayStyle.Image;
                element.ImageAlignment = ContentAlignment.MiddleCenter;
                 
 
                String myStation = e.CellElement.RowInfo.Cells["workstation"].Value.ToString().Trim();
 
                if (myStation.Length > 0)
                {
                    element.ToolTipText = @"View/Modify " + myStation + " Profile and Current Configuration";
                    element.Enabled = true;
                    element.DisplayStyle = DisplayStyle.Image;
                    element.ShowBorder = true;
                }
                else
                {
                    element.Enabled = false;
                    element.DisplayStyle = DisplayStyle.None;
                    element.ShowBorder = false;
                }
                if (element.ElementState == ElementState.Constructed)
                    element.Click += new EventHandler(Workstation_Click);
 
            }
         }
     }
    catch (Exception ex)
    {
        RadMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, RadMessageIcon.Error);
    }
}

Other than the Telerik update - nothing else has changed.

Any help you could provide would be greatly appreciated.  This is extremely urgent as I will be demoing this product early next week.

thanks!


Note:  I am using 4 different themes: Office2010Blue, Black and Silver and Windows7.  All themes show same behavior.

Stefan
Telerik team
 answered on 05 Sep 2012
3 answers
407 views
So here is our scenario:

We have a main executable (app) with docking enabled.  A Left Panel and a Right panel.  Each of them can be undocked and pulled out of the application.

The left panel is a no brainer it contains windows controls, etc. 

The right panel has a few windows controls, and a user control that we created and also has docking enabled?

So there are a couple questions:

1. Is this scenario able to be accomplished? 
2. Can we build a user control that contains docking?
3. If the user control, has a docked panel(s), can we pull those out not only from the user control but also from the main application?

I hope that makes sense.  Thank you in advance for any tips, gotchas, etc. 


Nikolay
Telerik team
 answered on 05 Sep 2012
1 answer
220 views

Hello,

I have downloaded the below reffered test application and try to run in the latest Telerik version release(Q2 2012 SP1), I am finding attached error messages which I can't debug it. I tried lot to adding all refernces and didn't found the required reference dll. RadControlDesignTimeData and
ControlStyleBuilderInfoList.

Please make it ruinable below attached application ASAP otherwise give new collapsible panel test application whic works in Telerik version (Q2 2012 SP1) (C# code required)

Thanks in advance.

Ref:http://www.telerik.com/community/forums/winforms/panels-and-labels/collapsible-panels.aspx

Regards
Manoj

 

Nikolay
Telerik team
 answered on 04 Sep 2012
3 answers
356 views
Please help me for setting the theme for grid view.

Thanks for support.
Stefan
Telerik team
 answered on 04 Sep 2012
2 answers
511 views
how do I add a border to selected RadLabels?
I am skinning the entire Winforms app with Desert
the following routine only seems to expand the size of the label
Public Sub BorderStyleLabel(ByRef rdLabel As RadLabel)
    Dim labelBorder As BorderPrimitive
    labelBorder = DirectCast(rdLabel.LabelElement.Children(1), BorderPrimitive)
    labelBorder.BoxStyle = BorderBoxStyle.SingleBorder
    labelBorder.BackColor = Color.Chocolate
    labelBorder.Width = 1
End Sub
I am hoping to find kode to mimic BorderStyle=FixedSingle
Elliott
Top achievements
Rank 2
 answered on 04 Sep 2012
2 answers
125 views
I am replacing as many Microsoft controls with Telerik Winforms controls in order to prepare for a move to Windows 8
the app uses Microsoft Ink
the Telerik textbox doesn't seem to want to hook up with Ink
here's the kode
myInkCollector = New InkCollector(Me.txtSignature.Handle)
myInkCollector.DefaultDrawingAttributes.Width = ThinInkWidth
myInkCollector.Enabled = True
if txtSignature is a Microsoft textbox it works
if it is a RadTextBox it doesn't
Elliott
Top achievements
Rank 2
 answered on 04 Sep 2012
1 answer
119 views
I'm trying to get some standard Winforms code moved over to use the Telerik library. It's hard to figure out how to move over standard combobox code. In my standard combobox code, I could simply handle the "SelectedValueChanged" event. This event is only fired when the user actually selects a value (i.e. clicks or presses 'Enter'), even in auto-complete mode.

For the Telerik "RadDropDownList", the "SelectedValueChanged" event fires every time the user moves the cursor down a list of matching items. To me, this seems wrong. The selected value is not changed yet, not until the user presses 'Enter' or clicks the mouse on a particular item. Nevertheless, right or wrong, is there an optimal way to make a "RadDropDownList" work like a combobox? I really won't want to write hundreds of lines of code to handle every variation of key and mouse clicks to try and figure out what the user is doing.

More generally, is there any guide or cookbook that shows a person what is involved with changing each type of standard Windows control over to the corresponding Telerik control? This would be really useful. It took me an entire day to figure out that a Telerik "RadSplitButton" isn't really a true split button (i.e the same functionality as a button and a drop-down menu button), but is more simplistic, sort of a "menu item button". The best way to port code from Windows split buttons to Telerik without losing functionality is to use a separate RadButton and a separate RadDropDownButton. Some sort of guide book would be immensely helpful.

Thanks.
Peter
Telerik team
 answered on 04 Sep 2012
5 answers
129 views
Hi,

My grid has been grouped and ShowTotals is true.  I need not display totals for all columns.  I need to display show totals only for specific fields.  Request you to let me know if i need to set any properties or write any events to get this feature.

Thanks in advance.
RS
Top achievements
Rank 1
 answered on 04 Sep 2012
2 answers
96 views
And also a question how to create header for the chart?

I'm trying to add radchartview to my form but manually(without using toolbox).
But when I run my application and when I press button to call my form with radchartview I've got messagebox with 
telerik.wincontrols.radelement.backgroundshape.

What's the problem? My code in initializecomponent
this.radChartView1 = new RadChartView();
((System.ComponentModel.ISupportInitialize)(this.radChartView1)).BeginInit();
 
this.SuspendLayout();
 
this.radChartView1.Size = new System.Drawing.Size(592, 336);
this.radChartView1.TabIndex = 10;
this.radChartView1.Name = "radChartView1";
this.radChartView1.AutoScroll = true;
this.radChartView1.Location = new System.Drawing.Point(0, 0);
this.radChartView1.Anchor =
    ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    | System.Windows.Forms.AnchorStyles.Left)
    | System.Windows.Forms.AnchorStyles.Right)));
this.ClientSize = new Size(592, 373);
this.Controls.Add(this.radChartView1);
this.Name = "KLDChart";
this.Text = "KLDReport";
this.Load += new System.EventHandler(this.KLDChart_Load);
this.Controls.SetChildIndex(this.radChartView1, 0);
((System.ComponentModel.ISupportInitialize)(this.radChartView1)).EndInit();
this.ResumeLayout(false);
Stefan
Telerik team
 answered on 04 Sep 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?