Telerik Forums
UI for WinForms Forum
1 answer
224 views

I have a listview with custom listitems that include a radButtonElement. How do I change the backcolor of the button? I've tried

    Me.MatchButtonElement.ButtonFillElement.BackColor = Color.LightGreen
    Me.MatchButtonElement.ButtonFillElement.BackColor2 = Color.LightGreen
    Me.MatchButtonElement.ButtonFillElement.BackColor3 = Color.FromArgb(122, 223, 136)
    Me.MatchButtonElement.ButtonFillElement.BackColor4 = Color.FromArgb(142, 237, 143)

and various other approaches but nothing has worked so far.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Nov 2016
5 answers
298 views

Please let me know where I am going wrong!

I've tried many ways, but for some reason when I test my maskedit field, I can't type anything in. No values are displayed as I type and the IFrame cursor doesn't move as I type. I can only Tab off the field.

Input:  1 - 999

-----------------------------

Mask:  nnn

Type: Numeric

Prompt Char: 0

---------------------------

On line 7 below, the field doesn't get set to "001"

01.Private Sub mtxtDaysElapsed_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles mtxtDaysElapsed.Validating
02.    'between 1 and 999 exclusive
03.    Dim nDaysElapsed = 0
04. 
05.    Try
06.        If mtxtDaysElapsed.Value = "" Or mtxtDaysElapsed.Value = "0" Then
07.            mtxtDaysElapsed.Value = "001"
08.        End If
09.        If Integer.TryParse(mtxtDaysElapsed.Value, nDaysElapsed) Then
10.            recPoVenmst.LateCutoffDays = nDaysElapsed.ToString
11.        Else
12.            e.Cancel = True
13.        End If
14.    Catch ex As Exception
15.        'error
16.    End Try
17.End Sub
Dimitar
Telerik team
 answered on 03 Nov 2016
1 answer
70 views

Hi,

Looks like I can't use Week, Hour, Minute and Second as a step for QueryableDateTimeGroupDescription, it is not implemented yet?

Alex

 

Hristo
Telerik team
 answered on 02 Nov 2016
8 answers
578 views
How do I access the selected value of a GridViewComboBoxColumn when the selected value changes? What gridview event should I be handling? Thanks!
Gone2TheDogs
Top achievements
Rank 2
Iron
Veteran
 answered on 02 Nov 2016
1 answer
98 views

Hi

I have a column with multiple data types. I'm using the EditorRequired event to set the editor as a RadDateTimeEditor or RadDropDownListEditor using the code below. This mostly works but I have two problems. 

1. With the country dropdown, I set dropDownStyle to DropDown. The editor allows me to type in any value but if the value is not one of the items in the list, as soon as I exit the cell the value disappears.

2. With the RadDateTimeEditor, I set the customFormat to "d" but when I select a value and exit the cell, it's showing the time as well as the date. How do I get it to show date only?

 

Private maritalStatuses() As String = {"Married", "In a De Facto Relationship", "Interdependent Relationship", "Engaged", "Separated", "Divorced", "Widowed", "Never Married"}

Private Countries() as String = {"", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola"}

 

Private Sub dgv_EditorRequired(sender As Object, e As EditorRequiredEventArgs) Handles dgv.EditorRequired
        If dgv.CurrentColumn.Name = "ImportValue" Then
            Select Case dgv.CurrentRow.Cells("EditorType").Value
                Case radEditorType.DatePicker
                    Dim editor As RadDateTimeEditor = New RadDateTimeEditor
                    editor.CustomFormat = "d"
                    e.Editor = editor
                Case radEditorType.CountryDropDown
                    Dim editor As New RadDropDownListEditor
                    editor.DropDownStyle = RadDropDownStyle.DropDown
                    DirectCast(editor.EditorElement, RadDropDownListEditorElement).DataSource = Countries
                    DirectCast(editor.EditorElement, RadDropDownListEditorElement).AutoCompleteMode = AutoCompleteMode.SuggestAppend
                    e.Editor = editor
                Case radEditorType.MaritalStatusDropDown
                    Dim editor As New RadDropDownListEditor
                    DirectCast(editor.EditorElement, RadDropDownListEditorElement).DataSource = maritalStatuses
                    editor.DropDownStyle = RadDropDownStyle.DropDownList
                    e.Editor = editor
            End Select
        End If
    End Sub

Dimitar
Telerik team
 answered on 02 Nov 2016
4 answers
116 views

I want a neat display of "cards" as shown in the attached image. I will say how many cards per row and how many rows.

how would i do this with radgrid for winforms?

 

(this image is taken from a competitive product)

Dimitar
Telerik team
 answered on 02 Nov 2016
5 answers
305 views

hi everyone

 i use Scheduler in  project and i have problem in shamsi Scheduler?

everyting in ok but month is not shamsi 

i use this code

 

private readonly Calendar cal;
private readonly Calendar[] optionals;
 
 
public PersianCulture()
    : this("fa-IR", true)
{
}
 
public PersianCulture(string cultureName, bool useUserOverride)
    : base(cultureName, useUserOverride)
{
    //Temporary Value for cal.
    cal = base.OptionalCalendars[0];
 
    //populating new list of optional calendars.
    var optionalCalendars = new List<Calendar>();
    optionalCalendars.AddRange(base.OptionalCalendars);
    optionalCalendars.Insert(0, new PersianCalendar());
 
 
    Type formatType = typeof(DateTimeFormatInfo);
    Type calendarType = typeof(Calendar);
 
 
    PropertyInfo idProperty = calendarType.GetProperty("ID", BindingFlags.Instance | BindingFlags.NonPublic);
    FieldInfo optionalCalendarfield = formatType.GetField("optionalCalendars",
                                                          BindingFlags.Instance | BindingFlags.NonPublic);
 
    //populating new list of optional calendar ids
    var newOptionalCalendarIDs = new Int32[optionalCalendars.Count];
    for (int i = 0; i < newOptionalCalendarIDs.Length; i++)
        newOptionalCalendarIDs[i] = (Int32)idProperty.GetValue(optionalCalendars[i], null);
 
    optionalCalendarfield.SetValue(DateTimeFormat, newOptionalCalendarIDs);
 
    optionals = optionalCalendars.ToArray();
    cal = optionals[0];
    DateTimeFormat.Calendar = optionals[0];
 
    DateTimeFormat.MonthNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
    DateTimeFormat.MonthGenitiveNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
    DateTimeFormat.AbbreviatedMonthNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
    DateTimeFormat.AbbreviatedMonthGenitiveNames = new[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
 
 
    DateTimeFormat.AbbreviatedDayNames = new string[] { "یکشنبه", "دوشنبه", "ﺳﻪشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };//{ "ی", "د", "س", "چ", "پ", "ج", "ش" };
    DateTimeFormat.ShortestDayNames = new string[] { "یکشنبه", "دوشنبه", "ﺳﻪشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };//{ "ی", "د", "س", "چ", "پ", "ج", "ش" };
    DateTimeFormat.DayNames = new string[] { "یکشنبه", "دوشنبه", "ﺳﻪشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };
 
    DateTimeFormat.AMDesignator = "ق.ظ";
    DateTimeFormat.PMDesignator = "ب.ظ";
 
    /*
    DateTimeFormat.ShortDatePattern = "yyyy/MM/dd";
    DateTimeFormat.LongDatePattern = "yyyy/MM/dd";
          
    DateTimeFormat.SetAllDateTimePatterns(new[] {"yyyy/MM/dd"}, 'd');
    DateTimeFormat.SetAllDateTimePatterns(new[] {"dddd, dd MMMM yyyy"}, 'D');
    DateTimeFormat.SetAllDateTimePatterns(new[] {"yyyy MMMM"}, 'y');
    DateTimeFormat.SetAllDateTimePatterns(new[] {"yyyy MMMM"}, 'Y');
     */
 
}
 
public override Calendar Calendar
{
    get { return cal; }
}
 
public override Calendar[] OptionalCalendars
{
    get { return optionals; }
}

how i fix this problem .

thanks.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Nov 2016
2 answers
1.0K+ views

Hello All, I'm kind a newbie in the WinForms and what I'm trying to do is the following:
I have a RadGridView with a GridViewCheckBoxColumn named "chk" and another GridViewTextBoxColumn named "Serial" and I want to press a button and print the value of “Serial” of the ones from "chk" are checked.
I attached an example of a small GridView with only three values, let’s say I check the first and third, I print “ABCDF” and then print “SerialTest”
Hope anyone can help me or point me with some ideas
Regards!!


Aristofanes
Top achievements
Rank 1
 answered on 01 Nov 2016
1 answer
176 views

I need to set Column(0) foreground color programmatically. I can't find any examples specifically for this. Would someone please share an example or where I can find how its done?

Thanks!

 

 

 

 

Dimitar
Telerik team
 answered on 01 Nov 2016
1 answer
142 views

The original grid was a standard item grid.  After the item number was entered, I did a dgvItems.RefreshEdit() to commit the change and make the new row accessible.

The telerick datagrid does not have the RefreshEdit() function and I have not been able to find an equivalent function.  When I access e.RowIndex or dgvItems.CurrentRow.Index, it returns -1.  In addition, if I try to access the new row, I get an index out of range error.

What is the proper method for the row index so that it does not return -1.

 

 

 

Dimitar
Telerik team
 answered on 01 Nov 2016
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)
Chart (obsolete as of Q1 2013)
Form
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
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?