Telerik Forums
UI for WinForms Forum
3 answers
247 views

I've tried to put this question in the forum but the page keeps disappearing after I click "submit", so here I am...

I have a 3 column GridView and the GridViewComboBoxColumn is not binding correctly.  I've set the following for the grid.

  1. DisplayMember = Color
  2. ValueMember = Id 
  3. DataType =  System.ComponentModel.BindingList`1[TelerikGridViewTests.Models.ColorViewModel]

When I run the application I see "System.ComponentModel.BindingList`1[TelerikGridViewTests.Models.ColorViewModel]" instead of the object within my model.  For my other 2 columns in the grid (a decimal and a string) those are displayed just fine. 

 

Here is my model code... 

using System.ComponentModel;

namespace TelerikGridViewTests.Models
{
    public class CarsViewModel : ViewModelBase
    {
        public CarsViewModel()
        {
            _cars = new BindingList<CarViewModel>();

            _cars.Add(new CarViewModel()
            {
                Id = 0m,
                Description = "Ford",
                Colors = new ColorsViewModel().Colors,
            });

            _cars.Add(new CarViewModel()
            {
                Id = 1m,
                Description = "Chevy",
                Colors = new ColorsViewModel().Colors,
            });

            _cars.Add(new CarViewModel()
            {
                Id = 2m,
                Description = "Dodge",
                Colors = new ColorsViewModel().Colors,
            });
        }

        BindingList<CarViewModel> _cars;
        public BindingList<CarViewModel> Cars { get { return _cars; } set { _cars = value; } }
    }

    public class CarViewModel : ViewModelBase
    {
        public decimal Id { get; set; }
        public string Description { get; set; }

        BindingList<ColorViewModel> _colors;
        public BindingList<ColorViewModel> Colors
        {
            get { return _colors; }
            set { _colors = value; }
        }
    }

    public class ColorsViewModel : ViewModelBase
    {
        public ColorsViewModel()
        {
            Colors = new BindingList<ColorViewModel>();

            Colors.Add(new ColorViewModel()
            {
                Id = 1,
                Color = "Blue",
            });
            Colors.Add(new ColorViewModel()
            {
                Id = 2,
                Color = "Red",
            });
            Colors.Add(new ColorViewModel()
            {
                Id = 3,
                Color = "Green",
            });
            Colors.Add(new ColorViewModel()
            {
                Id = 4,
                Color = "Yellow",
            });
        }

        public BindingList<ColorViewModel> Colors { get; set; }
    }

    public class ColorViewModel : ViewModelBase
    {
        public int Id { get; set; }
        public string Color { get; set; }
    }
}

 

and code which binds the model..

using System.ComponentModel;
using System.Windows.Forms;
using TelerikGridViewTests.Models;

namespace TelerikGridViewTests
{
    public partial class Form1 : Form
    {        
        public Form1()
        {
            InitializeComponent();

            BindingList<CarViewModel> _cars = new CarsViewModel().Cars;
            radGridView1.DataSource = _cars;
        }
    }
}

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Feb 2018
2 answers
155 views

Hello,
Is there a way to load a pdf file; located in Project's Resources, into pdfviewer?

Thanks a lot,

William

wiquezada
Top achievements
Rank 1
 answered on 01 Feb 2018
5 answers
937 views
I want to have a check box column, that if there is test/value in column1, I want to check box to be checked.  If there isn't any value, I don't want it to be checked. What's easiest way to implement this?
Dimitar
Telerik team
 answered on 01 Feb 2018
2 answers
127 views

Hi,

since some days, I got the title's related null reference exception when I click on item on RadListView control in DetailView mode. 

Have you any idea? If i use the same control with the same data inside it but set mode to ListView al works without any problem (but I can't do this, due to a complex series of routine formatting details view elements according to the type and the structure of the data inside of it). The exception was thrown inside Telerik.WinControl.UI, on the event indicated. I cannot intercept any event before the crash, so the application quit unexpectedly.

 

Routing causing the exception is:

 

private void lvRecords_CurrentItemChanged(object sender, ListViewItemEventArgs e)
        {
            if (e.Item != null)            
                CaricaDettaglio(e.Item.DataBoundItem as BaseEntity<int>);
            else
            {
                spDetails.Collapsed = true;
                spGestioneCustom.Collapsed = true;
            }
        }

where, by the call CaricaDettaglio, I made some changes on the form, loading some data into other controls based on the e.Item.DataboundItem, an entity of my application. I've also noticed that if I double click on form bar to resize it, if the mouse passes through the control during the form resize, the same event was fired, with the same result, without any further click on it, and this is really unattended.

 

DLL version is 2016.2.608.40 but I don't want updgrade project to latest Telerik Library if not necessary.

 

Have you any idea or suggestion?

 

Thanks in advance.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 31 Jan 2018
9 answers
620 views

I can change split panel collapse direction to left or right like this. But can I have both splitter buttons (left and right direction) on RadSplitContainer with only 2 SplitPanels?

I noticed that if the RadSplitContainer had more than 3 panels, the splitter button showed 2 buttons (left and right direction)

 

Hristo
Telerik team
 answered on 31 Jan 2018
4 answers
133 views
Hi

I'm using GridViewPdfExport to export a radGrid to pdf. I have a column that is set up to use a mixture of radTextBoxEditors, RadDropDownListEditors and RadDateTimeEditors depending on the data in the cell. The RadDropDownList editors each have different data sources but each uses an integer ID field as the valueMember and a text field as the displayMember. When I export to pdf, the cells that use a RadDropDownListEditor export the valueMember and not the displayMember. How do I get them to export the DisplayMember? 

I can see that I'd need to use the exportToPdfCellFormatting event but I don't know how to:
 - work out whether the cell uses a RadDropDownListEditor (I can use logic based on the values of other cells in the row but if I do that, I can see it leading to a bug at some point in the future when new logic is added to the form. It would be much safer if I can write the equivalent of "If the cell uses a RadDropDownListEditor")
 - get the DisplayMember value
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 31 Jan 2018
1 answer
561 views
I Have managed to display databound items in listview with checkbox, but it is been displayed as single column I would like that to displayed in 4 column. Basically I want to display listview items as multiple columns so if anyone can help me out please do help Thanks in Advance.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 31 Jan 2018
1 answer
380 views
I have a need for the contents of a dropdown list to be a treeview.  When an item in the treeview is selected I need to know that the user selected that specific item.
Dimitar
Telerik team
 answered on 31 Jan 2018
1 answer
457 views
I need to add a column to the GridView that would be a dropdown.  The contents of the drop down may potentially be a grid of its own.  Is this achievable?
Dimitar
Telerik team
 answered on 31 Jan 2018
2 answers
239 views

Hello guys! I have a small deal with DropDownList...



I need to create a path selector, and this is how I see it:
- when I'm writing "C:\" DropDown starts showing AutoComplete options
- Paths that were in usage  (it will be decided after some program runs) it will save it to its DataSource.

Standard Combox can do all of theese requirements, It will be like:
AutoCompleteSource = AutoCompleteSource.FileSystemDirectories
and after save the "good" paths to DataSource.

I find somthing same in the Telerik lib - a DropDownList but it hasn't property AutoCompleteSource where I can set AutoCompleteSource.FileSystemDirectories...

I continued to search for solutions and found RadMaskedEditBox that has AutoCompleteSource like I want, but has no DropDownMenu for saving used pathes.
If there other solutions that I didn't see? I don't want to write algorithm for DropDownList which will AutoComplete directories, I think there is a more beautiful solution.

Thanks!

Ivan
Top achievements
Rank 1
 answered on 30 Jan 2018
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
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?