Telerik Forums
UI for WinForms Forum
3 answers
481 views

I want to apply the acrylic effect using the fluent theme of Telerik but i Diont Know how to do the blur background or square in a windows forms project.

Need help please

Dimitar
Telerik team
 answered on 17 Jul 2019
3 answers
374 views

Visual Studio 2017
VB.Net
Telerik UI for WinForms R2 2019 SP1

I need to enforce a root folder for users and only give them access files and folders within this root folder and I have my own dialog box for this. Can I use my dialog box when the user clicks Open or Save or Save As?

Nadya | Tech Support Engineer
Telerik team
 answered on 17 Jul 2019
2 answers
172 views

 

Hi everyone!

I'm trying to reproduce the example for ListView shown in

https://docs.telerik.com/devtools/winforms/controls/listview/getting-started

But instead of using a fixed DataTable, I'm connecting to a database. As I return a DataTable, everything was going ok until I found the word "MusicCollectionDataSet.SongsDataTableRow" and for example the line MusicCollectionDataSet.SongsDataTableRow songRow = row.Row as MusicCollectionDataSet.SongsDataTableRow; but as I have changed the DataSource to a DataTable from the Database, I don't know what is the script to replace those lines.

I attached an image. Please Help. Thanks in advance.

 

Regards,

Walter

Walter
Top achievements
Rank 1
 answered on 16 Jul 2019
2 answers
138 views

Hi,

I've managed to work out most property types but I'm struggling how to have a property in Time format.

I.e. is there a time editor like RadTimePicker within the propertygrid to enter a specified time?

Thanks.

Matt
Top achievements
Rank 2
 answered on 16 Jul 2019
1 answer
136 views

Hi there,

 

For Example I have the following class structures.

List<ParentA> which I populate and bind it to a radGridView.

This ParentA object contains a List of child objects that I want to display as Child rows per ParentA.  

I have AutogenerateHierarchy set to true, but the children aren't now appearing.  Is there something else I need to do to get them to display?

Thanks,

Brad

Dimitar
Telerik team
 answered on 15 Jul 2019
7 answers
86 views
I need a graph where a ScatterSeries is drawn and also some arbitrary area is drawn (see figure). How to do it?
Nadya | Tech Support Engineer
Telerik team
 answered on 10 Jul 2019
1 answer
59 views

hi

how can i remove shape on controler_TextNeede ?

asghar
Top achievements
Rank 1
 answered on 09 Jul 2019
6 answers
1.8K+ views

Is it possible to rotate a text box to display it vertically as per the attached mockup ?

Thanks in advance

PJ Pralong

Dimitar
Telerik team
 answered on 09 Jul 2019
2 answers
189 views

Hi, 

Please help me to hide the settings button near to the search textbox.

Image attached.

Thanks in advance

Arun
Top achievements
Rank 2
Iron
 answered on 08 Jul 2019
4 answers
78 views

Hello

I contact you because I have been a problem for several days and I can not find the solution

I have a bound radgridview control in readonly. I allow to search row.

When I write something in the search row, my application is crashing.

You can download my simple example HERE

Thank you for your help

Good job, the telerik team  ;-)

Fabrizio

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using Telerik.WinControls.UI;
 
namespace test
{
 
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        #region School class
 
        public class School
        {
            public Guid Id { get; set; }
            public string Name { get; set; }
            public short SchoolYear { get; set; }
            public string Locality { get; set; }
            public string Titulaire { get; set; }
            public short Degre { get; set; }
 
            public List<Student> Students = new List<Student>();
 
            public void AddStudent(Student student)
            {
                Students.Add(student);
            }
 
            public void RemoveStudent(Student student)
            {
                Students.Remove(student);
            }
 
            public int NombreEleve => Students.Count;
        }
 
        #endregion
 
        #region Student class
        public class Student
        {
            public Guid Id { get; set; }
            public string FirstName { get; set; }
            public string LastName { get; set; }
            public Guid IdSchool { get; set; }
 
            public List<Cote> Cotes = new List<Cote>();
            public School School = new School();
 
            public string FullName => $"{LastName} {FirstName}";
            public string SchoolName => School.Name;
            public int NombreCote => Cotes.Count;
 
            public void AddCote(Cote cote)
            {
                Cotes.Add(cote);
            }
 
            public void RemoveCote(Cote cote)
            {
                Cotes.Remove(cote);
            }
        }
        #endregion
 
        #region Discipline class
 
        public class Discipline
        {
            public Guid Id { get; set; }
            public string Name { get; set; }
            public List<Control> Controls = new List<Control>();
 
            public int NombreControle => Controls.Count;
 
            public void AddControl(Control control)
            {
                Controls.Add(control);
            }
 
            public void RemoveControl(Control control)
            {
                Controls.Remove(control);
            }
        }
        #endregion
 
        #region Control class
        public class Control
        {
            public Guid Id { get; set; }
            public string Title { get; set; }
            public DateTime Date { get; set; }
            public decimal Quotation { get; set; }
            public short Period { get; set; }
            public Guid IdDiscipline { get; set; }
            public Discipline Discipline { get; set; }
            public List<Cote> Cotes = new List<Cote>();
 
            public void AddCote(Cote cote)
            {
                Cotes.Add(cote);
            }
 
            public void RemoveCote(Cote cote)
            {
                Cotes.Remove(cote);
            }
 
            public string DisciplineName => Discipline.Name;
            public int NombreCote => Cotes.Count;
        }
 
        #endregion
 
        #region Cote class
        public class Cote
        {
            public enum eQuotationState
            {
                Top = 0,
                Defeat,
                Average,
                Good,
                Absent
            }
 
            public Guid IdStudent { get; set; }
            public Guid IdControl { get; set; }
            public DateTime Date { get; set; }
            public decimal? Quotation { get; set; }
            public Guid Id { get; set; }
            public Control Control { get; set; }
            public Student Student { get; set; }
 
            public string FullNameStudent => Student?.FullName;
            public Guid? IdSchool => Student?.IdSchool;
            public string SchoolName => Student?.SchoolName;
            public string ControlTitle => Control?.Title;
            public Int16? ControlPeriod => Control?.Period;
            public Guid? IdDiscipline => Control?.IdDiscipline;
            public string DisciplineName => Control?.DisciplineName;
            public decimal ControlQuotation => Control?.Quotation ?? 0M;
            public bool IsAbsent => (Quotation == null);
            public eQuotationState QuotationState =>
            (
                IsAbsent ?
                eQuotationState.Absent :
                (Quotation < (Control.Quotation / 2)) ?
                eQuotationState.Defeat :
                (Quotation == (Control.Quotation / 2)) ?
                eQuotationState.Average :
                (Quotation == Control.Quotation) ?
                eQuotationState.Top :
                eQuotationState.Good
            );
        }
 
        #endregion
 
         
        private BindingList<School> _schools = new BindingList<School>();
        private BindingList<Student> _students = new BindingList<Student>();
        private BindingList<Discipline> _disciplines = new BindingList<Discipline>();
        private BindingList<Control> _controls = new BindingList<Control>();
        private BindingList<Cote> _cotes = new BindingList<Cote>();
         
        public RadForm1()
        {
            CreateDatas();
 
            InitializeComponent();
            CreateBoundQuotationGrid();
        }
 
         
        private void CreateDatas()
        {
            var school1 = new School { Id = Guid.NewGuid(), Degre = 1, Name = "School 1", SchoolYear = 2019, Titulaire = "Name 1" };
            _schools.Add(school1);
 
            var student1 = new Student { Id = Guid.NewGuid(), FirstName = "Toto", LastName = "Toto", School = school1, IdSchool = school1.Id };
            var student2 = new Student { Id = Guid.NewGuid(), FirstName = "Tata", LastName = "Tata", School = school1, IdSchool = school1.Id };
            _students.Add(student1);
            _students.Add(student2);
            school1.Students.AddRange(_students.Where(x => x.IdSchool == school1.Id));
 
            var discipline1 = new Discipline { Id = Guid.NewGuid(), Name = "French" };
            var discipline2 = new Discipline { Id = Guid.NewGuid(), Name = "English" };
            _disciplines.Add(discipline1);
            _disciplines.Add(discipline2);
 
            var control1 = new Control { Id = Guid.NewGuid(), Discipline = discipline1, IdDiscipline = discipline1.Id, Date = DateTime.Now, Period = 1, Title = "French control 1", Quotation = 10M };
            var control2 = new Control { Id = Guid.NewGuid(), Discipline = discipline1, IdDiscipline = discipline1.Id, Date = DateTime.Now, Period = 1, Title = "French control 2", Quotation = 20M };
            var control3 = new Control { Id = Guid.NewGuid(), Discipline = discipline1, IdDiscipline = discipline1.Id, Date = DateTime.Now, Period = 2, Title = "French control 3", Quotation = 30M };
            var control4 = new Control { Id = Guid.NewGuid(), Discipline = discipline2, IdDiscipline = discipline2.Id, Date = DateTime.Now, Period = 2, Title = "Ensglish control 1", Quotation = 100M };
            var control5 = new Control { Id = Guid.NewGuid(), Discipline = discipline2, IdDiscipline = discipline2.Id, Date = DateTime.Now, Period = 2, Title = "Ensglish control 2", Quotation = 200M };
            var control6 = new Control { Id = Guid.NewGuid(), Discipline = discipline2, IdDiscipline = discipline2.Id, Date = DateTime.Now, Period = 1, Title = "Ensglish control 3", Quotation = 300M };
            _controls.Add(control1);
            _controls.Add(control2);
            _controls.Add(control3);
            _controls.Add(control4);
            _controls.Add(control5);
            _controls.Add(control6);
            discipline1.Controls.AddRange(_controls.Where(x => x.IdDiscipline == discipline1.Id));
            discipline2.Controls.AddRange(_controls.Where(x => x.IdDiscipline == discipline2.Id));
 
            var cote1 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control1, IdControl = control1.Id, Student = student1, IdStudent = student1.Id, Quotation = 10M };
            var cote2 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control1, IdControl = control1.Id, Student = student2, IdStudent = student2.Id, Quotation = 0M };
            var cote3 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control2, IdControl = control2.Id, Student = student1, IdStudent = student1.Id, Quotation = 10M };
            var cote4 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control3, IdControl = control3.Id, Student = student1, IdStudent = student1.Id, Quotation = 30M };
            var cote5 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control4, IdControl = control4.Id, Student = student2, IdStudent = student2.Id, Quotation = 100M };
            var cote6 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control5, IdControl = control5.Id, Student = student2, IdStudent = student2.Id, Quotation = default(decimal?) };
            var cote7 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control6, IdControl = control6.Id, Student = student1, IdStudent = student1.Id, Quotation = 200M };
            var cote8 = new Cote { Id = Guid.Empty, Date = DateTime.Now, Control = control6, IdControl = control6.Id, Student = student2, IdStudent = student2.Id, Quotation = 0M };
            _cotes.Add(cote1);
            _cotes.Add(cote2);
            _cotes.Add(cote3);
            _cotes.Add(cote4);
            _cotes.Add(cote5);
            _cotes.Add(cote6);
            _cotes.Add(cote7);
            _cotes.Add(cote8);
            student1.Cotes.AddRange(_cotes.Where(x => x.IdStudent == student1.Id));
            student2.Cotes.AddRange(_cotes.Where(x => x.IdStudent == student2.Id));
            control1.Cotes.AddRange(_cotes.Where(x => x.IdControl == control1.Id));
            control2.Cotes.AddRange(_cotes.Where(x => x.IdControl == control2.Id));
            control3.Cotes.AddRange(_cotes.Where(x => x.IdControl == control3.Id));
            control4.Cotes.AddRange(_cotes.Where(x => x.IdControl == control4.Id));
            control5.Cotes.AddRange(_cotes.Where(x => x.IdControl == control5.Id));
            control6.Cotes.AddRange(_cotes.Where(x => x.IdControl == control6.Id));
        }
         
 
        /// <summary>
        /// Création des DGV adéquats
        /// </summary>
        private void CreateBoundQuotationGrid()
        {
            using (this.radGridView1.DeferRefresh())
            {
                radGridView1.ShowFilteringRow = true;
                radGridView1.EnableFiltering = true;
 
 
                radGridView1.MasterTemplate.Reset();
                radGridView1.MasterTemplate.ShowTotals = true;
                radGridView1.MasterTemplate.AddNewBoundRowBeforeEdit = true;
 
                radGridView1.MasterView.TableAddNewRow.IsPinned = true;
                radGridView1.MasterView.TableAddNewRow.PinPosition = PinnedRowPosition.Top;
                radGridView1.MasterView.TableSearchRow.CloseOnEscape = false;
                radGridView1.MasterView.TableSearchRow.ShowCloseButton = false;
 
                radGridView1.TableElement.RowHeaderColumnWidth = 50;
 
                // Ajouter la ligne des totaux
                radGridView1.SummaryRowsBottom.Add(new GridViewSummaryRowItem(new GridViewSummaryItem[]
                {
                    new GridViewSummaryItem("CoteColumn", "Total {0:N2}", GridAggregateFunction.Sum),
                    new GridViewSummaryItem("NomEleveColumn", "{0} cotes", GridAggregateFunction.Count)
                }));
 
                radGridView1.MasterView.SummaryRows[0].IsPinned = true;
                radGridView1.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom;
                radGridView1.BottomPinnedRowsMode = GridViewBottomPinnedRowsMode.Fixed;
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewComboBoxColumn("PeriodeColumn", "ControlPeriod")
                {
                    HeaderText = "Period",
                    TextAlignment = ContentAlignment.MiddleCenter,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    MinWidth = 80,
                    DropDownStyle = RadDropDownStyle.DropDownList,
                    FilteringMode = GridViewFilteringMode.DisplayMember
                });
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewComboBoxColumn("DisciplineColumn", "IdDiscipline")
                {
                    HeaderText = "Discipline",
                    TextAlignment = ContentAlignment.MiddleLeft,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    MinWidth = 160,
                    DropDownStyle = RadDropDownStyle.DropDownList,
                    ValueMember = "Id",
                    DisplayMember = "Name",
                    FilteringMode = GridViewFilteringMode.DisplayMember,
                    Tag = false
                });
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewComboBoxColumn("LibelleControleColumn", "IdControl")
                {
                    HeaderText = "Control title",
                    TextAlignment = ContentAlignment.MiddleLeft,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    WrapText = true,
                    MinWidth = 160,
                    DropDownStyle = RadDropDownStyle.DropDownList,
                    ValueMember = "Id",
                    DisplayMember = "Title",
                    FilteringMode = GridViewFilteringMode.DisplayMember,
                    Tag = false
                });
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewComboBoxColumn("LibelleClasseColumn", "IdSchool")
                {
                    HeaderText = "School name",
                    TextAlignment = ContentAlignment.MiddleLeft,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    WrapText = true,
                    MinWidth = 160,
                    DropDownStyle = RadDropDownStyle.DropDownList,
                    ValueMember = "Id",
                    DisplayMember = "Name",
                    FilteringMode = GridViewFilteringMode.DisplayMember,
                    Tag = false
                });
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewComboBoxColumn("NomEleveColumn", "IdStudent")
                {
                    HeaderText = "Student fullname",
                    TextAlignment = ContentAlignment.MiddleLeft,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    MinWidth = 160,
                    DropDownStyle = RadDropDownStyle.DropDownList,
                    ValueMember = "Id",
                    DisplayMember = "FullName",
                    FilteringMode = GridViewFilteringMode.DisplayMember,
                    Tag = false
                });
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewDateTimeColumn("DateColumn", "Date")
                {
                    HeaderText = "Date",
                    TextAlignment = ContentAlignment.MiddleCenter,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    MinWidth = 100,
                    MaxWidth = 100,
                    Format = DateTimePickerFormat.Short,
                    FormatString = "{0:d}",
                    Tag = true
                });
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewDecimalColumn("CoteColumn", "Quotation")
                {
                    HeaderText = "Quotation",
                    TextAlignment = ContentAlignment.MiddleCenter,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    DecimalPlaces = 2,
                    ShowUpDownButtons = false,
                    AllowGroup = false,
                    Minimum = 0,
                    MinWidth = 130,
                    Tag = true
                });
 
                radGridView1.MasterTemplate.Columns.Add(new GridViewDecimalColumn("QuotationStateColumn", "QuotationState")
                {
                    HeaderText = "State",
                    TextAlignment = ContentAlignment.MiddleCenter,
                    HeaderTextAlignment = ContentAlignment.MiddleCenter,
                    AutoSizeMode = BestFitColumnMode.AllCells,
                    DecimalPlaces = 2,
                    ShowUpDownButtons = false,
                    ReadOnly = true
                });
            }
        }
 
        public void SetBindingColumnsQuotation()
        {
            var periodColumn = (this.radGridView1.MasterTemplate.Columns["PeriodeColumn"] as GridViewComboBoxColumn);
            periodColumn.DataSource = _controls.Select(x => x.Period).Distinct().OrderBy(x => x);
 
            var matiereColumn = (this.radGridView1.MasterTemplate.Columns["DisciplineColumn"] as GridViewComboBoxColumn);
            matiereColumn.DataSource = _controls.Select(x => x.Discipline).Distinct().OrderBy(x => x.Name);
 
            var controlColumn = (this.radGridView1.MasterTemplate.Columns["LibelleControleColumn"] as GridViewComboBoxColumn);
            controlColumn.DataSource = _controls.OrderBy(x => x.Title);
 
            var schoolColumn = (this.radGridView1.MasterTemplate.Columns["LibelleClasseColumn"] as GridViewComboBoxColumn);
            schoolColumn.DataSource = _students.Select(x => x.School).Distinct().OrderBy(x => x.Name);
 
            var studentColumn = (this.radGridView1.MasterTemplate.Columns["NomEleveColumn"] as GridViewComboBoxColumn);
            studentColumn.DataSource = _students.OrderBy(x => x.FullName);
        }
 
        private void RadForm1_Load(object sender, EventArgs e)
        {
            using (radGridView1.DeferRefresh())
                radGridView1.DataSource = _cotes;
 
            radGridView1.MasterTemplate.BestFitColumns(BestFitColumnMode.AllCells);
 
            SetBindingColumnsQuotation();
 
            WindowState = FormWindowState.Maximized;
        }
    }
 
}
Dimitar
Telerik team
 answered on 08 Jul 2019
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
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
DateOnlyPicker
TimeOnlyPicker
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?