Telerik Forums
UI for WinForms Forum
3 answers
187 views
Hello,
in a grid, I want to show a generic list of objects (type: Cars). No problem. One of the columns should be a ComboBox. In the combobox  the selection should be based on a different class (type: Country). The name of country should be displayed in the grid. In both classes, there is a property ID of type GUID. The ID will be created automatically and have no setter.

using System;
using Telerik.WinControls.UI;
using System.Linq;
 
namespace Grid_Test
{
    public partial class frmMitarbeiterlister : Telerik.WinControls.UI.RadRibbonForm
    {
        private TestData.Task taskNewBefore = null;
        private TestData.Task taskNewAfter = null;
 
        public frmMitarbeiterlister()
        {
            InitializeComponent();
            
        }
 
 
        private void GetTestData()
        {
            TestData.TestDataGenerator.GenerateTestData(1000);
            gridMitarbeiterListe.DataSource = TestData.DataAccessLayer.EmployeeList;
            gridMitarbeiterListe.BestFitColumns();
        }
        private void btnTestdatenErstellen_Click(object sender, EventArgs e)
        {
            GetTestData();
        }
 
        private void frmMitarbeiterlister_Load(object sender, EventArgs e)
        {  
            GetTestData();
            GetComboBox();
             
            
        }
 
        private void GetComboBox()
        {
            GridViewComboBoxColumn cbTask = new GridViewComboBoxColumn();
            cbTask.UniqueName = "TaskNew";
            cbTask.HeaderText = "New Task";
            cbTask.DataSource = TestData.DataAccessLayer.TaskCatalog;
            cbTask.ValueMember = "ID";
            cbTask.DisplayMember = "Description";
            cbTask.FieldName = "TaskNew.ID"; // Name in the employee-class
             
            gridMitarbeiterListe.MasterTemplate.Columns.Add(cbTask);
 
            // problem: After leaving the row the new value disapear.
        }
    }
}

Here is my class model
using System;
using System.Collections.Generic;
using System.Linq;
 
 
namespace Grid_Test.TestData
{
    internal static class DataAccessLayer
    {
        internal static  List<Employee> employeeList = new List<Employee>();
        internal static List<Task> taskCatalog = new List<Task>();
 
        public static List<Employee> EmployeeList
        {
            get {
                if (employeeList == null) { employeeList = new List<Employee>(); }
                return employeeList;
            }
        }
 
        public static List<Task> TaskCatalog
        {
            get
            {
                if (taskCatalog == null)
                { taskCatalog = new List<Task>(); }
                return taskCatalog;
            }
        }
    }
}


internal class Employee
    {
        internal Employee() { }
 
        private Guid id = Guid.NewGuid();
        private string firstname;
        private string lastname;
        private DateTime birthDay;
        private Task taskOld;
        private Task taskNew;
 
        public Guid ID { get { return id; } }
        public string Firstname { get { return firstname; } set { firstname = value; } }
        public string Lastname { get { return lastname; } set { lastname = value; } }
        public DateTime BirthDay { get { return birthDay; } set { birthDay = value; } }
        public Task TaskOld { get { return taskOld; } set { taskOld = value; } }
        public Task TaskNew { get { return taskNew; } set { taskNew = value; } }
 
 
 
    }

internal class Task
    {
        internal Task() { }
 
        private Guid id = Guid.NewGuid();
        private string description;
 
        public Guid ID { get { return id; } }
        public string Description { get { return description; } set { description = value; } }
 
        public override string ToString()
        {
            return Description;
        }
 
    }


I have found
no example for this purpose. For help, I would be grateful.
Christian Rudat
Peter
Telerik team
 answered on 20 Mar 2013
1 answer
177 views
Hi all,

how to set the encoding for the csv file which will be created when exporting the RadGridView?
I found no property or option in the exporter class.

Regards
Hardy
Ivan Petrov
Telerik team
 answered on 20 Mar 2013
2 answers
473 views
Dear all, Telerik members.
I have question for telerik radgirdview.
I has a combobox column in radgirdview. How I can set background image for this button foreach record.
See attached file below:
http://img849.imageshack.us/img849/550/equipment.gif
Mr.Het
Stefan
Telerik team
 answered on 20 Mar 2013
2 answers
300 views
Hi
I have just upgraded from 2011.2.11.0712 to Q1 2013.  Then my application breaks.  When one of the form loads, an error message popped up saying "Arrange with infinity or NaN size (parent: Telerik.WinControls.UI.RadPageViewStackElement, this: Telerik.WinControls.UI.RadPageViewStackItem)"

In designer view inside Visual Studio, I got the same error with call stack

at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
at Telerik.WinControls.UI.RadPageViewStackElement.ArrangeItems(RectangleF clientRect)
at Telerik.WinControls.UI.RadPageViewElement.PerformArrange(RectangleF clientRect)
at Telerik.WinControls.UI.RadPageViewElement.ArrangeOverride(SizeF finalSize)
at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
at Telerik.WinControls.RootRadElement.ArrangeOverride(SizeF finalSize)
at Telerik.WinControls.RootRadElement.ArrangeCore(RectangleF finalRect)
at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
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.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()
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at System.Windows.Forms.Design.ControlDesigner.DesignerControlCollection.Add(Control c)

Error list showed the error in designer.cs
Following the line number, the error came from this line

            this.Controls.Add(this.tableLayoutPanel1);

tableLayoutPanel1 is of type System.Windows.Forms.TableLayoutPanel


What does that mean and how to fix?

Regards
Edwin
Peter
Telerik team
 answered on 19 Mar 2013
4 answers
217 views
When I set the ruler background color using the UI Editor, it shows properly in design time but in run time the color is set back the default. I have attached an image showing where I set the color.
Stefan
Telerik team
 answered on 19 Mar 2013
3 answers
182 views
Dears,

Despite my investigations on the forums and in my debugger, I didn't find the right way to do what I need.

What I need to do is to change the text present in a GridGroupContentCellElement according to some information present in the column which was selected to create this grouping. Basically cells contain numerical codes as values, but the visual needs to display corresponding labels. This works great with the CellFormatting event but in the ViewCellFormatting, I catch the GridGroupContentCellElement element and then I really wonder how to get back the corresponding column header (at least its Name property).

Do you have any solution for this?
Stefan
Telerik team
 answered on 19 Mar 2013
1 answer
171 views
Hello,

Can somebody point out how I might set a custom sort order on a column with following data:-

A/101
B/100
C/102
D/103
E/99
F/75
F/70
F/35

I want to be able to sort on just the numeric part and ignore the first two characters ie "A/"

Anybody got any ideas?

Many thanks

Terry

Stefan
Telerik team
 answered on 19 Mar 2013
1 answer
248 views
How can I change font of radgroupboxheader programmatically?
Stefan
Telerik team
 answered on 19 Mar 2013
1 answer
257 views
How can I enable AutoEllipsis of grid element, grid text and help area, I tried below (set in my form New() event) but I must be missing a flag somewhere.

grd.PropertyGridElement.AutoEllipsis = true;
grd.PropertyGridElement.AutoToolTip = true;
Stefan
Telerik team
 answered on 18 Mar 2013
2 answers
202 views
Hi Forum,
I've been searching the web and forums for solutions and yet to have found any therefor resulting here, asking you for help.
My Project is on Winforms, C#, DataSetBount RadGridView.
1. I'm looking for a way to change the Text Color of Columns. (Through the code)
2. Export To PDF settings - How do i enable support for Right-To-Left Fonts? (Through the code)
I've managed to find how to change the Font of the GridView, but not the ForeColor nor did i find how to set the RightTOLEFT EXPORTING settings(When On Display - the Font is fine, but when Exported it becomes backward).

Appreciate all the help you care  to provide, 

Zeev
Top achievements
Rank 1
 answered on 18 Mar 2013
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?