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

I have created a custom Appointment class which implements Telerik.WinControls.UI.Appointment.
I store a few fields in this class and they are stored in a database via a custom Edit Appointment Dialog.

I have enabled the recurrence dialog recently and this works fine - can add a recurrence rule and this generates occurrences, etc. Looking at the other threads, I figured I had to include the following in my custom class for this to happen:
Private _masterEvent As Telerik.WinControls.UI.IEvent
   Public Shadows ReadOnly Property MasterEvent() As Telerik.WinControls.UI.IEvent
        Get
            If Object.Equals(_masterEvent, Nothing) Then
                Return Nothing
            Else
                Return _masterEvent
            End If
        End Get
    End Property
 
 
    Public Overrides Function CreateOccurrence(start As Date) As Telerik.WinControls.UI.IEvent
        Dim appointment As New JobAppointment()
        Dim startDate As Date = start
        Dim ts As TimeSpan = Me.Duration
        Dim endDate As Date = startDate.Add(ts)
 
        ..........
 
        'Added this to set the settings required by Telerik.
        appointment.ApplySettingsToAppointment()
 
        'For repeated occurrences..
        Dim appType As Type = GetType(Telerik.WinControls.UI.Appointment)
        appType.GetField("masterEvent", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic).SetValue(appointment, Me)
 
        Return appointment
    End Function

The issue I now face is that I want to store the RecurrenceRule in my database (right now recurrence only works in-memory). To do this, I have a string field "JobRecurrenceRule" which is stored in the database.

When an appointment is to be saved to the database, I do the following:
If RecurrenceRule IsNot Nothing Then
If RecurrenceRule.IsValid Then
JobRecurrenceRule = CalHelper.RecurrenceRuleToString(RecurrenceRule)
End If
End If

When appointments are read from the database, I do the following to instantiate RecurrenceRule:
If JobRecurrenceRule <> "" Then
            CalHelper.TryParseRecurrenceRule(JobRecurrenceRule, RecurrenceRule)
End If

The recurrence rule is being correctly saved to the database, but when I try to load the appointment back from the database, the scheduler seems to freeze. I get a context switch deadlock:

ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x4ac6f90 to COM context 0x4ac7100 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

I have traced the freezing down to the code where I add the appointment with the RecurrenceRule to the RadScheduler.

Commenting out the line:
CalHelper.TryParseRecurrenceRule(JobRecurrenceRule, RecurrenceRule)

Therefore, not reading the recurrence rule from the database, prevents this deadlock.

I am assuming that something is not quite right with the way I am loading the RecurrenceRule from the database. Perhaps I am missing something? Any help much appreciated.

Regards.


Ivan Todorov
Telerik team
 answered on 12 Sep 2011
1 answer
162 views

I am trying to set the backcolor of a gridview GridViewCommandColumn using conditional formating, but it is not showing the colors:
I am using gridview version 2011.1.11.419
Please help

Thanks

Here is the code:

 

 

 

 

 

 

 

void radGV_CellFormatting(object sender, CellFormattingEventArgs e)

 

{


if (mycondn == true)
                    {
                        e.CellElement.DrawFill = true;
                       e.CellElement.ForeColor = Color.Blue;
                        e.CellElement.NumberOfColors = 1;
                        e.CellElement.BackColor = System.Drawing.Color.Gold;
                     
                    }
                 else                    {
                        e.CellElement.DrawFill = true;
                        e.CellElement.ForeColor = Color.Blue;
                        e.CellElement.NumberOfColors = 1;
                         e.CellElement.BackColor = System.Drawing.Color.LightBlue;
  
                    }
}

my cell is created like this:

//data base field name is ScDate
 GridViewCommandColumn colSchDelDate = new GridViewCommandColumn("ScDate");
  colSchDelDate.UseDefaultText = false;
  colSchDelDate.Width = 80;
  colSchDelDate.HeaderText = "Sc Date";
  colSchDelDate.ReadOnly = true;
  colSchDelDate.FormatString = "{0:MM/dd/yy}";
  colSchDelDate.TextAlignment = ContentAlignment.MiddleCenter;
  radGV.MasterTemplate.Columns.Add(colSchDelDate);

}



Emanuel Varga
Top achievements
Rank 1
 answered on 12 Sep 2011
4 answers
118 views
Hi
How to insert new row to RadGridView in custom place. this code add new row at top or bottom :
RadGridView1.Rows.Add("x","y")
Thank you.
tuonglam
Top achievements
Rank 1
 answered on 10 Sep 2011
3 answers
151 views
Hi,

   I'd like know how to do get value of rows selected with CheckBox on GridView?
Example:

Name               |  Selected
Steve Jobs        
Bill Gates                x
Larry Page
Mark Zuck               x

Your select Bill Gates and Mark Zuck.

I tried with foreach, but isn't get the values selected.

Thanks attention!

Emanuel Varga
Top achievements
Rank 1
 answered on 09 Sep 2011
2 answers
110 views
hi friends.
when i'm merging assemblies; gridview's custom detail view element is not working.
other components and forms are working but this has 'Telerik.WinControls.UI.RadPageViewDragDropService' error message....
koray
Top achievements
Rank 2
 answered on 09 Sep 2011
1 answer
303 views
HI
Does WinForms support diplaying data received on a serial port in a scrolling time chart?
I have seen examples on how to connec an rss feed from the net but want to display data from an electronic instrument.

Regards
Fredrik Enquist
Yavor
Telerik team
 answered on 09 Sep 2011
2 answers
1.6K+ views
Hello!
Is it possible to turn off automatic selection of the first row in a GridView. The automatic selection takes place on grid creation an when rebinding the data source.
Thanks. 
Emanuel Varga
Top achievements
Rank 1
 answered on 09 Sep 2011
1 answer
116 views
Hi I am using the Gridview, to display some data. I have a tax filing status column, which I am giving it the values of the combo box from an enumeration, like the following. 


(gridViewTemplateTaxData.Columns["FilingStatus"] as GridViewComboBoxColumn).DataSource = Enum.GetNames(typeof(TaxFilingStatus));

When I the user changes the value in the combo box, I change the bound data of the grid. Then I refresh the templates of the grid. 
Some of the time this works fine, but often enough, I get the following exception. 

Object reference not set to an instance of an object. 

Telerik.WinControls.UI.GridComboBoxCellElement.SetContent().  I walked through the code that I have in the cell value changed, and there is no issues there. Am I using the ComboBoxColumn wrong ? 

- Erion
Emanuel Varga
Top achievements
Rank 1
 answered on 09 Sep 2011
2 answers
117 views
Hi,

  I'd like know how to do set a icon on GridViewCommand?
Example attached!

Thanks attention!
Flávio
Top achievements
Rank 1
 answered on 08 Sep 2011
3 answers
110 views
Hello, Happy Holidays!

I  have a variable SelectedIndex that is bound to the index of the "clicked" row. I use SelectedIndex like this: radGridView1.Rows[0].ChildRows[SelectedIndex].IsCurrent = true; but this doesn´t work, it highlights the first row. If I use radGridView1.Rows[0].ChildRows[1].IsCurrent = true; for example it works! anyone can give me an idea?

thanks in advance,
Michael
Alexander
Telerik team
 answered on 08 Sep 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)
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
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
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
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?