Telerik Forums
UI for WinForms Forum
1 answer
258 views
I am trying to use the RadDataGrid view, with the autoGenerateColumn Property set to false, I added three columns as follows.          

radGridView1.Columns.Add(new
Telerik.WinControls.UI.GridViewDataColumn("ProductId"));
radGridView1.Columns.Add(new Telerik.WinControls.UI.GridViewDataColumn("ProductName"));
radGridView1.Columns.Add(new Telerik.WinControls.UI.GridViewDataColumn("UnitPrice"));

and then i bounded the data source to list<Products>

When I run the application and try to edit any of the fields or if I try to type in the filter box the application crashes with the following exception. While investigating the problem I found out that the default editor for the columns is never instantiated and is set to null

radGridView1.Columns["ProductId"].GetDefaultEditor()==null

Sample Code
-----------

  public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void Form1_Load(object sender, EventArgs e)

        {

            radGridView1.MasterGridViewTemplate.AutoGenerateColumns = false; //disable auto generate columns

            radGridView1.EnableFiltering = true; //enable filter           

            radGridView1.MasterGridViewTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;

            //Add columns

            radGridView1.Columns.Add(new Telerik.WinControls.UI.GridViewDataColumn("ProductId"));

            radGridView1.Columns.Add(new Telerik.WinControls.UI.GridViewDataColumn("ProductName"));

            radGridView1.Columns.Add(new Telerik.WinControls.UI.GridViewDataColumn("UnitPrice"));           

            //Bind data           

            radGridView1.DataSource = GetProductList();

        }

        public List<Product> GetProductList()

        {

            var products = new List<Product>();

            products.Add(new Product("PRD-001", "Betty Crocker® Angel Food Cake Mix", 8.65));

            products.Add(new Product("PRD-002", "Betty Crocker Complete Desserts®", 8));

            products.Add(new Product("PRD-003", "Betty Crocker® Cookie Mix", 1.25));

            products.Add(new Product("PRD-004", "Betty Crocker® Frosting", 4.00));

            products.Add(new Product("PRD-005", "Betty Crocker® Sunkist® Lemon Bars", 10.00));

            products.Add(new Product("PRD-006", "Betty Crocker® Supreme Brownie Mix", 2.00));

            products.Add(new Product("PRD-007", "Betty Crocker® Variety Dessert Mixes", 3.55));

            products.Add(new Product("PRD-008", "Betty Crocker® Warm Delights® Desserts", 4.49));

            return products;

        }

    }

    public class Product

    {

        public Product()

        {

        }

        public Product(string id, string name, double price)

        {

            this.ProductId = id;

            this.ProductName = name;

            this.UnitPrice = price;

        }

        public string ProductId { get; set; }

        public string ProductName { get; set; }

        public double UnitPrice { get; set; }

    }

EXception Detail
-----------------------
System.ArgumentNullException was unhandled
  Message="Value cannot be null.\r\nParameter name: key"
  Source="mscorlib"
  ParamName="key"
  StackTrace:
       at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
       at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
       at Telerik.WinControls.UI.GridViewEditManager.GetDefaultEditor(IEditorProvider provider)
       at Telerik.WinControls.UI.BaseGridBehavior.InitializeEditor(RadGridView grid, GridViewColumn column)
       at Telerik.WinControls.UI.GridDataCellElement.item_Click(Object sender, EventArgs e)
       at Telerik.WinControls.RadItem.OnClick(EventArgs e)
       at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
       at Telerik.WinControls.UI.RadMenuItemBase.OnClick(EventArgs e)
       at Telerik.WinControls.UI.RadMenuItem.OnClick(EventArgs e)
       at Telerik.WinControls.RadItem.DoClick(EventArgs e)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadElement.CallDoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at Telerik.WinControls.RadControl.WndProc(Message& m)
       at Telerik.WinControls.UI.RadPopupControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at RadGridViewTest.Program.Main() in C:\Documents and Settings\ddebela\My Documents\Visual Studio 2008\Projects\RadGridViewTest\RadGridViewTest\Program.cs:line 17
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Jordan
Telerik team
 answered on 30 Jul 2008
1 answer
168 views
Hi,

I am attempting to apply the Office2007BlackTheme from the Q2 2008 toolbox with no luck.

I can't find any information in the documentation on how to set my RadForm to this theme. In Q1 the theme was available straight from the ThemeName property on the form.

Thanks

Charles
Peter
Telerik team
 answered on 30 Jul 2008
1 answer
175 views
We are evaluating rad controls.  In the examples I noticed a property on the grid called "EnableHotTracking".  I am looking around for an explanation of that property.  But I couldn't find in the documentation other than the MSDN style help documentation which doesn't say nothing about that property.

Is there any detailed documentation that helps to reduce the learning curve on using these controls?


Nikolay Dobrev
Telerik team
 answered on 30 Jul 2008
4 answers
227 views
Hi,
i have created a Custom control from RadControl.
It has items (following the magnify example) but when theming:
a) the control dissapears when opening themebuilder (very strange)
b) all the subitems (no matter what type they are) gets the same theme as the parent (if the parent is themed as a button, all subitems gets this theme, even if they are radimages or checkboxes)..
Is there any way to create a custom theme item for this elements (they don't have the themename property) so i can give them a diferent look as the father?
Thanks in advance!
Angel
Telerik team
 answered on 29 Jul 2008
1 answer
541 views
Hello,

Is there other way to change font size for all controls in application, then looping through all containers ?

Let say that Ive changed RadTextBox font size from 10 to 20, after this control will change its height and cover controls under it. How can i keep constant spaceing between controls ?
Angel
Telerik team
 answered on 29 Jul 2008
2 answers
156 views
Hi,
i'm creating a custom control (following the magnify demo), but even when the "autoscroll" property is set, it does nothing for RadItems inside the container, only for "external" controls i placed over the control.
Is there any way to activate the scroll for this items created by the control itself?
Thanks in advance..
Angel
Telerik team
 answered on 29 Jul 2008
3 answers
282 views
Hi

I am trying to set the FormatString for a column in GridView.

I have tried "{0:C}" and "{C}", but it does not seem to retain the value.

I have even tried entering the format string into the designer but with no success.

Is this a know problem ? Or am I doing something wrong ?

Kind Regards
Peter
Telerik team
 answered on 29 Jul 2008
1 answer
81 views
dose RadControls for WinForms Q2  2008 Right-to-Left Language Support
for all controls or the same Q1 not all controls
Georgi
Telerik team
 answered on 28 Jul 2008
1 answer
113 views
Hello,

I am designing an application for touchscreens.
I would like to set the height of the radpanelbargroupelement a bit bigger so that it is a bit easier to click on it.

CaptionHeight only has a getter, so i would like to know how i can set the height of the control at runtime (preferably).

thanks,

walter
Boyko Markov
Telerik team
 answered on 28 Jul 2008
1 answer
108 views
I have only had the WinForms product for 2 and a half days so this is probably a beginners issue.  However, I have been at this non-stop the whole time.  So this isn't a give up and ask too quick deal.  I have had issues with visibilty changing automatically between runs, images offset by 10 or 15 pixels and I can't change the setting, and a myriad of other issue.  So this morning I backed off a simplified things.  I opened a new project, added a toolstrip, an element, an item, and both a button and imagebutton element.  Sometimes I can add an image sometimes it dies there, but other times I'll try and set image alignment or image over text and the Visual studion crashes.  I usually get the image in, it seems the first edit (I didn't change names or settings on the first three pieces) and Visual studio asks me if I want to report the problem.

It's got to be something simple right?  I have begun to be daring with the product.  Thanks
Boyko Markov
Telerik team
 answered on 28 Jul 2008
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
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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?