Telerik Forums
UI for WinForms Forum
1 answer
789 views
Hi All ,
I am getting the error "Object reference not set to an instance of an object." when trying to filter on gridview.
my functional requirement is to referesh grid data on every 5 seconds. I get this error when i keep open filter popup  above 5 seconds and trying to filter the data. However its working if i try to filter within 5 seconds.

 Please help to suggest .

The followings are the stacktrace details for your reference:

System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="Telerik.WinControls.GridView"
  StackTrace:
       at Telerik.WinControls.UI.GridHeaderCellElement.filterPopup_FilterConfirmed(Object sender, EventArgs e)
       at Telerik.WinControls.UI.BaseFilterPopup.OnFilterConfirmed()
       at Telerik.WinControls.UI.RadListFilterPopup.OnButtonOkClick(EventArgs e)
       at Telerik.WinControls.RadItem.OnClick(EventArgs e)
       at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
       at Telerik.WinControls.UI.RadButtonElement.OnClick(EventArgs e)
       at Telerik.WinControls.RadItem.DoClick(EventArgs e)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       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 Telerik.WinControls.RadControl.WndProc(Message& m)
       at Telerik.WinControls.UI.RadPopupControlBase.WndProc(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 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at WindowsApplication2.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Jun 2014
1 answer
87 views
I have a GridView with a second-level hierarchy. I apply a filter to the BindingSource based on the node selected on a TreeView, for example: GridViewBindingSource.Filter = "Department = '" & e.Node.Text & "'". However, if any row is expanded (i.e. showing the second-level hierarchy information) it closes when the BindingSource is filtered. I would like to have any row that is open to remain open. Is there a way to do this?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Jun 2014
1 answer
1.0K+ views
Hi Telerik
is there a Property to change hover color for buttons (radButton , ToggleButton) in UI Element Editor
without using Visual Studio Builder

if not how to change hover color in Visual Studio Builder  in single button without changing all

thank you
Dimitar
Telerik team
 answered on 05 Jun 2014
1 answer
94 views
Hi,

I am exporting the XAML RadDocument from the RichTextBox to use for my own Gdi+ rendering. To do this I need the text color as (A)RGB values, but especially when I am pasting webcontent into the RichTextBox I sometimes get color names (such as "red", "lime" and so on) as text color. Is there any way to make sure colors in the XAML are always ARGB values without having to convert them myself?

Thanks a lot for your help.

Regards
Jan
Dimitar
Telerik team
 answered on 05 Jun 2014
1 answer
153 views
Hi,

I have applied custom filtering on the Treeview on Drop down selection change. Let's say I have applied filter to show only checked nodes and it did only showed me checked nodes. After filtering I unchecked one or more nodes but It didn't hide them so I figured that I might have to apply Filter on it again which I did but it didn't applied any filter nor did it go to the Filter Function that I have linked to it as well. Al thought it's working from UI.

Here's my code:

TreeView.TreeViewElement.FilterPredicate = FilterNode;


private bool FilterNode(RadTreeNode node)
 {
            bool filter = false;
            //Code 
            return filter;
 }

//For applying the filter

TreeView.Filter = string.Empty;
TreeView.Filter = "Custom";

Let me know if that makes any sense.

Thanks,
Attiqe







Dimitar
Telerik team
 answered on 04 Jun 2014
3 answers
234 views
I know how to merge RadDocuments, but I'm trying to insert into a RadDocument which is acting as a template. How would I go about inserting the following XAML into a RadDocument?

<t:Paragraph FontSize="13.333333" LineSpacing="1" SpacingAfter="12"><t:Span FontFamily="Verdana" FontSize="13.333333" Text="Lorem ipsum dolor sit amet" /></t:Paragraph>

The above XAML comes from a RadRichTextBox and should be inserted into the RadDocument when exporting. It seems like the DocumentFragment class used to have this functionality (http://www.telerik.com/forums/loading-multiple-raddocuments-into-a-richtextbox), but it no longer takes in a Document in the constructor. It might be possible to do the above in an actual RichTextBox, but I'd like to do it using the RadDocument if possible.



George
Telerik team
 answered on 04 Jun 2014
5 answers
275 views
I have 2 proposals for Step-by-step Tutorial – RadControls for WinForms.
  1. On tutorial download page could be version number or last update date so we will not make unnecessary downloads to check if pdf or chm is updated.
  2. It will be easier to read the pdf or help file if there are different version for C# and VB.

Kristina
Telerik team
 answered on 04 Jun 2014
3 answers
111 views
Hi, I followed your example for creating a basic radar chat as follows:


           RadarAreaSeries radarAreaSeries = new RadarAreaSeries("Sec1");
           radarAreaSeries.BackColor = Color.FromArgb(100, 142, 196, 65);
           radarAreaSeries.BorderColor = Color.FromArgb(100, 142, 196, 65);
           radarAreaSeries.DataPoints.Add(new CategoricalDataPoint(3.8d, "Oranges"));
           radarAreaSeries.DataPoints.Add(new CategoricalDataPoint(4d, "Bananas"));
           radarAreaSeries.DataPoints.Add(new CategoricalDataPoint(1.5d, "Apples"));
           this.EEGChart.Series.Add(radarAreaSeries);

           RadarAreaSeries radarAreaSeries2 = new RadarAreaSeries("Sec2");
           radarAreaSeries2.BackColor = Color.FromArgb(100, 27, 157, 222);
           radarAreaSeries2.BorderColor = Color.FromArgb(100, 27, 157, 222);
           radarAreaSeries2.DataPoints.Add(new CategoricalDataPoint(3.1d, "Oranges"));
           radarAreaSeries2.DataPoints.Add(new CategoricalDataPoint(1.8d, "Bananas"));
           radarAreaSeries2.DataPoints.Add(new CategoricalDataPoint(2.9d, "Apples"));
           this.EEGChart.Series.Add(radarAreaSeries2);

My question is if there exists another way to define the radar chart, by first defining the Categories, say Apple, Oranges etc and then creating the data series for each category. Having fixed the categories it would be much easieer to update data on the chart when values change, say every 1 sec.




Dimitar
Telerik team
 answered on 03 Jun 2014
3 answers
81 views
We are using a RadGridView to display data in a small area, only two rows are visible at any given time with the third row partially visible.  Using the RowFormatting event handler, we set the forecolor to reflect rows that contain 'inactive' or 'invalid' records based on columns in the underlying data.  Generally this works fine.  But when there are more than three rows in the grid and some of those rows are not visible, the forecolor change is not reliable.  For example, if the first three rows are 'valid' and the fourth row is 'invalid', all appears correct when the grid is initially displayed and the user scrolls down to the fourth row.  The 'invalid' row has the forecolor changed to gray.  But when the fourth is selected and the user then scrolls back to the first row, the first row now shows as 'invalid' (forecolor = gray) even though the data has not changed and the other rows still display the same as before.  From that point on the first row displays incorrectly until the data is refreshed.  Sometimes this occurs even if the last row is not selected, just scrolling from top to bottom and back.

        private void grdEFT_RowFormatting(object sender, RowFormattingEventArgs e)
        {
                if (e != null &&
                    e.RowElement.RowInfo != null &&
                    e.RowElement.RowInfo.DataBoundItem is DataRowView)
                {
                    DataRow drEFT = ((DataRowView)e.RowElement.RowInfo.DataBoundItem).Row;
                    DataRow drAPM = drEFT.GetParentRow(this.rAutopayDS.Relations["AssociatePaymentMethodEFTPaymentMethodInfo"]);

                    if (drAPM != null)
                    {
                        // Show the row as inactive if it is not active.
                        if (!(bool)drAPM["Active"] ||
                            !(bool)drEFT["Valid"])
                        {
                            e.RowElement.ForeColor = System.Drawing.SystemColors.ControlDark;
                        }
                        else
                        {
                            e.RowElement.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local);
                        }
                    }
                    else
                    {
                        e.RowElement.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local);
                    }
                }
        }

Thanks,
Greg Swope






Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Jun 2014
33 answers
856 views
Hi
Is there a way to hide or grey out sections of the Scheduler time to prevent appointments being made?

Sort of out of Office type periods or when a resource is not available?

This sort of does things, but it gets a bit messy on the Day and Timeslot overlap.  I watned to try and get a Day to be grayed out.  Sort of if someone was on leave then the day is greyed out entirely like the Saturday and Sunday are.  But I seem to have some bug in the way it is working because the Wednesday keeps being open.

Here is the code so far

Private Sub radSchedulerDemo_CellFormatting(sender As System.Object, e As SchedulerCellEventArgs) Handles radSchedulerDemo.CellFormatting
       'Check Date Block
       Dim dbDateBlocked As Boolean = isDateBlocked(e.CellElement.Date)
       If dbDateBlocked Then
           e.CellElement.Enabled = False
       End If
       If isTimeBlocked(e.CellElement.Date) Then
           e.CellElement.Enabled = False
       End If
   End Sub

Function isDateBlocked(ByVal eDate As Date) As Boolean
       Dim blReturn As Boolean = False
       'Test that the date is not in the range of blocked dates
       'Specific dates
       Dim dtBlock As Date = New Date(2012, 9, 5)
       'No Appointments in the Past
       If dtBlock < DateTime.Today Then
           blReturn = True
       End If
       If eDate.Equals(dtBlock) Then
           blReturn = True
       End If
       'Weekends
       If eDate.DayOfWeek = DayOfWeek.Saturday Then
           blReturn = True
       End If
       If eDate.DayOfWeek = DayOfWeek.Sunday Then
           blReturn = True
       End If
       Return blReturn
   End Function

Function isTimeBlocked(ByVal eDate As DateTime) As Boolean
       Dim blReturn As Boolean = False
       Dim dtBlock As Date = New Date(2012, 9, 5)
       'Check if Day Blocked
       If eDate.Equals(dtBlock) Then
           'Block all slots for this day as a override for any other open slots by default
           Return True
           Exit Function
       End If
       'Working hours Mon - Friday
       'Block Slots 
       '   0:00 - 8:00
       Dim tsDayStart As New TimeSpan(0, 0, 0)
       Dim tsWorkStart As New TimeSpan(8, 0, 0)
       Dim tsWorkStartLate As New TimeSpan(10, 0, 0)
       '   12:00-13:00
       Dim tsLunchStart As New TimeSpan(12, 0, 0)
       Dim tsLunchEnd As New TimeSpan(13, 0, 0)
       '   17:00-24:00
       Dim tsWorkEndEarly As New TimeSpan(15, 0, 0)
       Dim tsWorkEnd As New TimeSpan(17, 0, 0)
       Dim tsWorkEndLate As New TimeSpan(19, 0, 0)
       Dim tsDayEnd As New TimeSpan(23, 59, 59)
       Select Case eDate.DayOfWeek
           Case DayOfWeek.Monday
               If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsWorkEnd AndAlso eDate.TimeOfDay <= tsDayEnd Then
                   blReturn = True
               End If
           Case DayOfWeek.Tuesday
               If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay <= tsLunchEnd Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsWorkEnd AndAlso eDate.TimeOfDay <= tsDayEnd Then
                   blReturn = True
               End If
           Case DayOfWeek.Wednesday
               'Late working day
               If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsWorkEndLate AndAlso eDate.TimeOfDay <= tsDayEnd Then
                   blReturn = True
               End If
           Case DayOfWeek.Thursday
               'Late Start of Day
               If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStartLate Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsWorkEnd AndAlso eDate.TimeOfDay <= tsDayEnd Then
                   blReturn = True
               End If
           Case DayOfWeek.Friday
               'Early Working end
               If eDate.TimeOfDay >= tsDayStart AndAlso eDate.TimeOfDay < tsWorkStart Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsLunchStart AndAlso eDate.TimeOfDay < tsLunchEnd Then
                   blReturn = True
               End If
               If eDate.TimeOfDay >= tsWorkEndEarly AndAlso eDate.TimeOfDay <= tsDayEnd Then
                   blReturn = True
               End If
           Case DayOfWeek.Saturday
               blReturn = True
           Case DayOfWeek.Saturday
               blReturn = True
       End Select
       Return blReturn
   End Function

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Jun 2014
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?