Telerik Forums
UI for WinForms Forum
2 answers
181 views
Hi,

If I try to delete a row in the CellEndEdit event I get an "Object reference not set to an instance of an object." exception.

I tried using row.Delete() and removing the item from the underlying datasource but both generates the same error.

Using: 2010.3.10.1215

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.GridViewEditManager.EndEditCore(Boolean validate, Boolean cancel)
   at Telerik.WinControls.UI.GridViewEditManager.EndEdit()
   at Telerik.WinControls.UI.GridRowBehavior.ProcessEnterKey(KeyEventArgs keys)
   at Telerik.WinControls.UI.GridRowBehavior.ProcessKey(KeyEventArgs keys)
   at Telerik.WinControls.UI.BaseGridBehavior.ProcessKey(KeyEventArgs keys)
   at Telerik.WinControls.UI.BaseGridBehavior.ProcessKeyDown(KeyEventArgs keys)
   at Telerik.WinControls.UI.BaseGridEditor.OnKeyDown(KeyEventArgs keyEventArgs)
   at Telerik.WinControls.UI.RadTextBoxEditor.OnKeyDown(KeyEventArgs e)
   at Telerik.WinControls.UI.RadTextBoxEditor.TextBoxItem_KeyDown(Object sender, KeyEventArgs e)
   at Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
   at Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_KeyDown(Object sender, KeyEventArgs e)
   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

How do I solve this?

Regards,
Brian
Jack
Telerik team
 answered on 08 Dec 2011
5 answers
669 views
I recently updated from 2010 Q1 to 2011 Q3.  I have several DateTimePickers throughout my application, and the vast majority have these settings:  MinDate = 01/01/1900; NullDate = 01/01/1900; NullText = "Not Selected"; Text = ""; Value = 01/01/1900.

Users started reported some odd errors, and when I eventually tracked them down, I realized that the Value of the DateTimePicker controls was often being reset to whenever I opened the forms/user controls containing those DateTimePickers in the designer.  The TEXT, however, was NOT changing (making it difficult to spot without manually investigating the properties of each DateTimePicker).  When I would try to change the Value back to 1/1/1900, the change would not be accepted, instead reverting back to the Now time from before.  However, if I changed the time to some other value, then back to 1/1/1900, it would accept it.  Then, if I opened the form again, the Value would stay at 1/1/1900.

I have fixed this problem for my application through 2 methods:  1) In my base form and base user control, used by everything else, I loop through all the controls and set the Value to 1/1/1900 (prior to any other activity with those controls); 2) I opened every form in my application and reset the dates.  Though 1 should certainly be sufficient, I didn't like the idea that simply opening a form would change code, so I wanted to get that taken care of.

So, I have this first application working, but now I'm about to go through the laborious process of upgrading several others to this version of the controls, and I suspect I will have the same issue.  I'm hoping you guys have an idea what is going on.

My own thoughts were that maybe a) having MinDate and NullDate as the same value was somehow bad (see the wrongly posted small section in http://www.telerik.com/community/forums/winforms/calendar-and-datetimepicker/raddatetimepicker-does-not-work.aspx for an implication that this could be an issue) or b) RadDateTimePicker defaults to Now when added to a form/control, and it uses some value normally set in the more recent version to tell if this DateTimePicker was just added.  B seems more likely to me because that would explain how manually changing the time in the designer to another value, then changing it back to 1/1/1900, would work -- some value is being set then, and now the DateTimePicker realizes it is not newly added, so it "sticks."  Or ... maybe it is a combination or those, or something else entirely.

Thoughts?
Peter
Telerik team
 answered on 08 Dec 2011
3 answers
73 views
I am aware keytips can be used for the radribbonbar. Is there a way to use the directional arrows to navigate the radribbonbar.

Thanks
Peter
Telerik team
 answered on 08 Dec 2011
1 answer
147 views
Hi Telerik

I am building a multicolumn dropdown list in which I wish to use grouping. The grid has three columns, SecurityType, InstrumentGroup and Instrument. I want to group on SecurityType and within that grouping by InstrumentGroup so as to create a little hierarchy to act as a visual aid in selection.

If I allow manual grouping and drag the required columns to the group panel everything works fine but if I attempt to achieve the grouping programmaically the group header text for the InstrumentGroup header shows the same text as the SecurityType header.

I have attached the relevant snippet in the hope that you will have some insight into this one. Please note the commented out code was left in so you could see the other method I tried.

Regards
Ian Carson

Grid is setup like so..

private void GenerateMComboGrids()
{
    mcboInstrument.AutoSizeDropDownToBestFit = true;
    mcboInstrumentComboElement = mcboInstrument.MultiColumnComboBoxElement;
    mcboInstrumentComboElement.MultiColumnPopupForm.DropDownAnimationDirection = RadDirection.Left | RadDirection.Down;
    mcboInstrumentComboElement.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
    mcboInstrumentComboElement.DropDownHeight = 100;
    mcboInstrumentComboElement.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
    mcboInstrumentComboElement.EditorControl.MasterTemplate.AutoGenerateColumns = false;
    mcboInstrumentComboElement.EditorControl.ShowGroupedColumns = false;
    mcboInstrumentComboElement.EditorControl.ShowRowHeaderColumn = false;
    mcboInstrumentComboElement.EditorControl.EnableGrouping = true;
    mcboInstrumentComboElement.EditorControl.AutoExpandGroups = true;
    mcboInstrumentComboElement.EditorControl.ShowGroupPanel = false;
    mcboInstrumentComboElement.RightToLeft = true;
    
    GridViewTextBoxColumn column = new GridViewTextBoxColumn("SecurityType"); 
    column.HeaderText = "Security Type";
    mcboInstrumentComboElement.EditorControl.Columns.Add(column);
    GridViewTextBoxColumn column2 = new GridViewTextBoxColumn("InstrumentGroup"); 
    column2.HeaderText = "Instrument Group";
    mcboInstrumentComboElement.EditorControl.Columns.Add(column2);
    GridViewTextBoxColumn column3 = new GridViewTextBoxColumn("Instrument"); 
    column3.HeaderText = "Instrument";
    mcboInstrumentComboElement.EditorControl.Columns.Add(column3);
    mcboInstrumentComboElement.EditorControl.GroupDescriptors.Expression = "SecurityType ASC; InstrumentGroup ASC";
    //GroupDescriptor descriptor = new GroupDescriptor();
    //descriptor.GroupNames.Add("SecurityType", ListSortDirection.Ascending);
    //GroupDescriptor descriptor2 = new GroupDescriptor();
    //descriptor2.GroupNames.Add("InstrumentGroup", ListSortDirection.Ascending);
    //mcboInstrumentComboElement.EditorControl.GroupDescriptors.Add(descriptor);
    //mcboInstrumentComboElement.EditorControl.GroupDescriptors.Add(descriptor2);
    //mcboInstrumentComboElement.EditorControl.GroupSummaryEvaluate += new GroupSummaryEvaluateEventHandler(EditorControl_GroupSummaryEvaluate);
}


Data is entered using this method and for testing there is only a single row as follows:
SecurityType="Forex", InstrumentGroup="EUR", Instrument="EUR/USD"

private void PopulateInstrumentList()
{
    StrategyDistinctInstruments instruments = new StrategyDistinctInstruments(ThisVariation.StrategyVariation);
    Dictionary<string, BacktestInstrument> uniqueInstruments = instruments.UniqueInstruments;
    mcboInstrumentComboElement.EditorControl.TableElement.BeginUpdate();
    foreach (KeyValuePair<string, BacktestInstrument> kvp in uniqueInstruments)
    {
        GridViewRowInfo rowInfo = mcboInstrumentComboElement.EditorControl.Rows.AddNew();
        rowInfo.Tag = kvp.Value.Inst;
        rowInfo.Cells[0].Value = kvp.Value.SecurityType;
        rowInfo.Cells[1].Value = kvp.Value.InstrumentGroup;
        rowInfo.Cells[2].Value = kvp.Value.Inst.Name;
    }
    mcboInstrumentComboElement.EditorControl.TableElement.EndUpdate(true);
      
}




 
Julian Benkov
Telerik team
 answered on 08 Dec 2011
3 answers
126 views
How about letting the user select multiple document windows (tabs) for instance by pressing Shift and then have options in the Context Menü like Close Selected, Close all but these etc?

Regards
Erwin
Julian Benkov
Telerik team
 answered on 08 Dec 2011
3 answers
385 views
Hi everybody,

I would like to know if it is possible to complete a gridview  with empty rows?

For example, I have a grid view which can contain 9 rows but I only have 3 items to show.
The bottom of my grid is empty and I'd prefer having empty rows than nothing!

How can I do this?

Thanks

Lookoum
Julian Benkov
Telerik team
 answered on 08 Dec 2011
4 answers
495 views
I have a page view in my application.  Programmatically, I add 3 pages.  On each page I add a TableLayoutPanel.  Inside each panel I add about 15 rows with 2 columns each.  Each column has one label and one "other" control.  The "other" control is one of the following...

RadTextBox
RadCheckBox
RadDropDownList
RadSpinEditor

The pages with the drop down and spin editor takes several seconds to load and my processor is pegged!

I'm not hitting the database at this time, it is definitely in the control.
Sebastian
Top achievements
Rank 1
 answered on 07 Dec 2011
9 answers
589 views
See Article: http://www.telerik.com/support/kb/aspnet-ajax/window/adding-a-custom-button-to-radwindow-titlebar.aspx

I would like to know how to add a custom print button to RadWindow for WinForms.

For example how to implement a print button in my window titlebar. Some typical scenarios include implementing help or print button based on this functionality.

I would like to add buttons to the windows that I am using in a RadDock.  It it possible in WinForms?

Alexander
Telerik team
 answered on 07 Dec 2011
1 answer
150 views
Hello,

I would like that when I add some specific MDI child to the RadDock programatically it gets displayed int a new horizontal tab group instead of a new tab. Is this possible ? And how ?


Thank you.
Julian Benkov
Telerik team
 answered on 07 Dec 2011
3 answers
150 views
How do I focus control inside toolwindow on form load ?
Julian Benkov
Telerik team
 answered on 07 Dec 2011
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
ProgressBar
CheckedDropDownList
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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?