Telerik Forums
UI for WinForms Forum
1 answer
76 views
I have opened a ticket up for the following issue. I am posting it here in the forum to see if others have experienced the same problem.

After upgrading to Q2 SP1, I found that I can no longer "click to add new row" in the child's template of a bound hierarchy data grid without the error message "an entry already exists with that key". The key column is the primary key with an auto-increment property. If there is no hierarchy and only a top level data grid then the click to add a new row it does seem to work okay. However in the children templates it gives that  error right away or after adding one row.


I attached the project that Stefan had sent me on the last ticket open.  you can try to add new rows to the products table. I used the Northwind database from the examples folder. The only change I made was to make the primary key not a read-only field so that I can try to manually enter a value to see if that would work, which it didn't. Please let me know if you experience the same thing. If so, is there some workarounds? Being able to add new rows to the data grid is obviously pretty basic stuff and my application relies on it heavily.

Thanks,

Eyal
Julian Benkov
Telerik team
 answered on 17 Aug 2010
2 answers
203 views
I am curently working on a winforms promotions module and i am using the scheduler control to display all the promotions that are occuring on certain dates for all our locations. The appointments are added to the control when the form that the control belongs to loads.

my code for creating the appointments is as follows

private void getAppointments()
       {
           radScheduler1.Appointments.Clear();
           try
           {
               DataTable getPromoDates = getPromoTab.Tables["PROMOTION_ADVICE_HEADERS"].Copy();
               DataTable getPromoColours = getPromoTab.Tables["PROMOTION_TYPES"].Copy();
               for (int i = 0; i < getPromoDates.Rows.Count; i++)
               {
                   Appointment myAppoint = new Appointment((DateTime)getPromoDates.Rows[i]["START_DATE"], (DateTime)getPromoDates.Rows[i]["END_DATE"]);
//the summary of the appointment is the promo tables primary key
                   myAppoint.Summary = getPromoDates.Rows[i]["PA_ID"].ToString();
                                      try
                   {
                       //lookup the promo type and set the background of the appointment (custom backgrounds are defined elsewhere)
                       int getColour = int.Parse(getPromoDates.Rows[i]["PROMO_TYPE"].ToString());
                       var getBackCol = from o in getPromoColours.AsEnumerable() where int.Parse(o.Field<decimal>("PT_ID").ToString()) == getColour select new { colourNum = o.Field<decimal>("COLOR_ID") };
                       myAppoint.BackgroundId = int.Parse(getBackCol.ElementAt(0).colourNum.ToString());
                   }
                   catch (FormatException ex)
                   {
                       myAppoint.BackgroundId = 99;
                   }
                   string isprocessed = "Finalised";
                   if (getPromoDates.Rows[i]["Processed"].ToString() == "N")
                   {
                       isprocessed = "Open";
                   }
                   myAppoint.Visible = true;
                     //set the location attribute of the appointment to some meaningful string describing aspects of the promotion
                    myAppoint.Location = getPromoDates.Rows[i]["DESCRIPTION"].ToString() + " - " + ((DateTime)getPromoDates.Rows[i]["START_DATE"]).ToShortDateString() + " - " + ((DateTime)getPromoDates.Rows[i]["END_DATE"]).ToShortDateString();
                   myAppoint.Location = myAppoint.Location + " " + isprocessed;
                   myAppoint.Description = myAppoint.Location;
                     
                   radScheduler1.Appointments.Add(myAppoint);
               }
               radScheduler1.AutoSize = true;
               radScheduler1.BackColor = Color.LemonChiffon;
                
               radScheduler1.Update();
               radToolStripLabelElement2.Text = radScheduler1.ActiveView.StartDate.ToLongDateString() + " - " + radScheduler1.ActiveView.EndDate.ToLongDateString();
           }
           catch (Exception ex)
           {
           }

radScheduler1.ActiveViewType = SchedulerViewType.Month;

 

 

 

// radScheduler1.ActiveViewType = SchedulerViewType.Week;

 

 

 

SchedulerMonthView myMonthView = new SchedulerMonthView(DateTime.Now, true);

 

myMonthView.EnableWeeksHeader =

 

false;

 

myMonthView.WeekCount = 1;

myMonthView.HeaderFormat =

 

"dd-MM-yyyy";

 

myMonthView.ShowHeader =

 

true;

 

myMonthView.ShowWeeksHeader =

 

false;

 

radScheduler1.ShowAppointmentStatus =

 

true;

 

 

 

 

//myAppoint.Location

 

 

 

//SchedulerWeekView myMonthView = new SchedulerWeekView();

 

 

radScheduler1.ActiveView = myMonthView;

 

radToolStripLabelElement1.Text =

 

" ".PadRight(400, ' ');

 

radToolStripLabelElement2.Text = radScheduler1.ActiveView.StartDate.ToLongDateString() +

 

" - " + radScheduler1.ActiveView.EndDate.ToLongDateString();

 

radScheduler1.Width =

 

this.Width - 10;

 

radScheduler1.Height =

 

this.Height - radToolStrip1.Height - 15 - radDateTimePicker1.Height;

 

radSplitContainer1.Width =

 

this.Width - 10;

 

radSplitContainer1.Height =

 

this.Height - radToolStrip1.Height - 15 - radDateTimePicker1.Height;

 

radGridView1.Width =

 

this.Width - 20;

 


       }
So when i run this program, the appointents are created correctly with the right background colours but the appointments have no labels. See attached screenshot. capture.png. The exact same code on 2010Q2 produced screenshot capture2.png.
Any ideas on how i can fix this? Also i could prefer to use the timeline view, the reason i used the month view was because in the Q1 release, i had the same issue as described above, but the monthview labeling worked but the timeline view didnt.
Peter
Telerik team
 answered on 17 Aug 2010
5 answers
182 views
Hi,

I'm using SaveXML and LoadXML to restore the layout of dockpanels. Let's say we release version 1 of our application with 2 dockpanels. In version 2 we need 3 dockpanels but using LoadXML will only load the 2 dockpanels from version 1. Also if we remove a dockpanel from version 1 it will still show up in version 2.

Is there a way to make the LoadXML NOT overload new/removed dockpanels?

Thanks,
Brian
Julian Benkov
Telerik team
 answered on 17 Aug 2010
7 answers
354 views
I have a column with a datetime, how i can group it by day, and not by the entire date and time?????
Stefan
Telerik team
 answered on 17 Aug 2010
5 answers
324 views
I'm using a databound gridview, binding to a custom list of "entity" type.  The datetime field I want to group by is called Created.

    public partial class frmSearchResults : Form
    {
        private List<Entity> Results;
 
        public frmSearchResults(List<Entity> SearchResults)
        {
            InitializeComponent();
            Results = SearchResults;
            gridSearchResults.DataSource = Results;
            gridSearchResults.BestFitColumns();
        }
}

I've found some related posts in the forum but none have solved my issue yet (I'm new to rad controls so I may very well be missing or misunderstanding something).  One post mentioned CellTemplates but I'm not sure to go about that and that solution was in the context of a non bound grid.

Thanks,
John
Stefan
Telerik team
 answered on 17 Aug 2010
2 answers
116 views
Hi,

I have a GridView and when someone hovers over a cell a ScreenTip is displayed with some more informations. Works good, but now there was a need to add a button where the user can turn off these ScreenTips. And surprisingly even after turning them of some ScreenTips are still getting displayed. For us it seems that all ScreenTips which have been already displayed seems to get displayed without calling the ScreenTipNeeded Event.

How can I change this behaviour?

Thanks,
Michael
xclirion
Top achievements
Rank 1
 answered on 17 Aug 2010
3 answers
418 views
It's late, and maybe I'm missing something easy.  But if I drop a simple RadButton on a form, I cannot get tooltips to show.  I only can get tooltips to show for buttons on a toolstrip.  I've tried setting AutoTooltip on the root item and the RadButtonElement inside the designer.
Boryana
Telerik team
 answered on 16 Aug 2010
8 answers
158 views
What do I need to do to be able to drop a node between two other nodes to reorder the nodes?

No matter what I do the dragNode is always added as a child to the node it is dropped on :-(
I have tried specifying SpacingBetweenNodes to see if that help but the only effect is that the dotted line jumps from one node to the next. I can never drop a node between two other nodes.

And on the same issue: Can you provide code examples how to handle nodes dropped between two other nodes? is the dragNode infact dropped on the "parent" node and can I in the mouseUp event get the previousSibling to decide where the node has been dropped?

Thanks...
David
Top achievements
Rank 1
 answered on 16 Aug 2010
1 answer
192 views
Is there a way to hard code a header title to the Scheduler?

So, rather than a pair of dates in the format "dd dddd" or "dd/mm", for example, having a title of "Calendar"?
If not, can you hide the top header, but still display the individual headers for each day?
The ShowHeader flag hides both sets of headers when I set it to False

Thanks
Dobry Zranchev
Telerik team
 answered on 16 Aug 2010
5 answers
373 views
Hi Guys,

We seem to be unable to go around a problem on rebinding rad-grid, while moving columns. Please, advise.


We have a rad-grid, which constantly is being re-binded with the code below (the code below is running on the main thread). While this rebinding is going on, a person is reordering the columns, fast (don't know why they do it..) and at some point of time an exception is thrown and the rad-grid gets replaced by a red crossed rectangle. We cannot refresh or recover the grid - hence the user has no choice but to restart the program.
 
Private Sub ReBindMe()
        Dim ds As New DataSet
        Try
            If Not gridTasks.IsInEditMode Then
                If TypeOf gridTasks.DataSource Is DataSet And gridTasks.InvokeRequired = False Then
                    '--------------- ERROR HAPPENS ON THE LINE BELOW -------------------
                    CType(gridTasks.DataSource, DataSet).Tables("SELECT_TASKS").Clear()
                    CType(gridTasks.DataSource, DataSet).Tables("GetCheckListTriggeredLogDocList").Clear()
                    CType(gridTasks.DataSource, DataSet).Tables("GetCheckListTriggeredLogDocList").Merge(dt_GetCheckListTriggeredLogDocList)
                    CType(gridTasks.DataSource, DataSet).Tables("SELECT_TASKS").Merge(dt_Tasks)
                End If
            End If
        Catch ex As System.Exception
            'Throws error
        End Try
    End Sub
---------------------------------------------------------------------------------------------------------------------------
System Error Message:
Object reference not set to an instance of an object.
Stack trace:
   at Telerik.WinControls.RadElement.ComposeShouldPaintSystemSkin()
   at Telerik.WinControls.RadElement.ShouldPaintSystemSkin()
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintOverride(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.VisualElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.UI.GridRowElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.UI.GridTableBodyElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.VisualElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.VisualElement.PaintChildren(IGraphics graphics, Rectangle clipRectange, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadElement.Paint(IGraphics graphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RadItem.PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, Single angle, SizeF scale, Boolean useRelativeTransformation)
   at Telerik.WinControls.RootRadElement.Paint(IGraphics graphics, Rectangle clipRectangle)
   at Telerik.WinControls.RadControl.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.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 Telerik.WinControls.SafeNativeMethods.RedrawWindow(IntPtr hWnd, IntPtr rectUpdate, IntPtr hRgnUpdate, UInt32 uFlags)
   at Telerik.WinControls.UI.ThemedFormBehavior.RefreshNC()
   at Telerik.WinControls.UI.ThemedFormBehavior.OnWMNCActivate(Message& m)
   at Telerik.WinControls.UI.ThemedFormBehavior.HandleWndProc(Message& m)
   at Telerik.WinControls.UI.RadFormBehavior.HandleWndProc(Message& m)
   at Telerik.WinControls.UI.RadFormControlBase.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.IntDestroyWindow(HandleRef hWnd)
   at System.Windows.Forms.UnsafeNativeMethods.DestroyWindow(HandleRef hWnd)
   at System.Windows.Forms.NativeWindow.DestroyHandle()
   at System.Windows.Forms.Control.DestroyHandle()
   at System.Windows.Forms.Control.Dispose(Boolean disposing)
   at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
   at System.Windows.Forms.Form.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at Telerik.WinControls.UI.GridHeaderCellElement.DisposeManagedResources()
   at Telerik.WinControls.DisposableObject.PerformDispose(Boolean disposing)
   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)
   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)
   at Telerik.WinControls.RadElement.DisposeChildren()
   at Telerik.WinControls.RadElement.PerformDispose(Boolean disposing)
   at Telerik.WinControls.DisposableObject.Dispose(Boolean disposing)
   at Telerik.WinControls.RadElement.DisposeChildren()
   at Telerik.WinControls.UI.GridTableBodyElement.CleanupRows()
   at Telerik.WinControls.UI.GridTableElement.Update_Reset(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridTableElement.UpdateCore(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridTableElement.Update(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridViewTemplate.UpdateUI(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.Data.DataAccessComponent.UpdateAll(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridViewTemplate.Update(GridUINotifyAction action)
   at Telerik.WinControls.Data.DataAccessComponent.InitDataGrid()
   at Telerik.WinControls.Data.DataAccessComponent.currencyManager_ListChanged(Object sender, ListChangedEventArgs e)
   at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e)
   at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
   at System.Data.DataView.OnListChanged(ListChangedEventArgs e)
   at System.Data.DataView.IndexListChanged(Object sender, ListChangedEventArgs e)
   at System.Data.DataView.IndexListChangedInternal(ListChangedEventArgs e)
   at System.Data.DataViewListener.IndexListChanged(ListChangedEventArgs e)
   at System.Data.Index.<OnListChanged>b__2(DataViewListener listener, ListChangedEventArgs args, Boolean arg2, Boolean arg3)
   at System.Data.Listeners`1.Notify[T1,T2,T3](T1 arg1, T2 arg2, T3 arg3, Action`4 action)
   at System.Data.Index.OnListChanged(ListChangedEventArgs e)
   at System.Data.Index.FireResetEvent()
   at System.Data.Index.Reset()
   at System.Data.DataTable.ResetInternalIndexes(DataColumn column)
   at System.Data.DataTable.Clear(Boolean clearAll)
   at System.Data.DataTable.Clear()
   at ...................................................... line ...x
Julian Benkov
Telerik team
 answered on 16 Aug 2010
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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?