Telerik Forums
UI for WinForms Forum
1 answer
93 views
I receive the following error when databind RadGridView to a list<T> array.
Version Telerik 2009.3.9.1203

Value of '612' is not valid for 'Value'. 'Value' must be between 'Minimum' and 'Maximum'.
Parameter name: Value

Dev Notes:
-----------------------
I am displaying value from sort by date in decending order, as the data comes in in real time. I add new incoming data to the binding
source.

' Add to binding source the peform functions below.

How do i fix this problem? Is there a fix for this in Telerik 2010 Q1?

 

 

Me.rgvTickets.GridElement.BeginUpdate()

 

m_bsTickets.ResetBindings(

 

False)

 

 

 

Me.rgvTickets.EnableHotTracking = True

 

 

 

Me.rgvTickets.GridElement.EndUpdate(True)

 



at Telerik.WinControls.UI.RadScrollBarElement.set_Value(Int32 value)
   at Telerik.WinControls.UI.GridTableElement.UpdateVScrollBarPosition(GridViewRowInfo rowInfo)
   at Telerik.WinControls.UI.GridTableElement.EnsureRowVisible(GridViewRowInfo rowInfo)
   at Telerik.WinControls.UI.GridViewRowInfo.EnsureVisible()
   at Telerik.WinControls.UI.BaseGridNavigator.SetCurrentRow(Boolean shift, Boolean ctrl)
   at Telerik.WinControls.UI.BaseGridNavigator.SelectRow(GridViewRowInfo row)
   at Telerik.WinControls.UI.GridTableElement.UpdateCurrentPosition()
   at Telerik.WinControls.UI.GridViewInfo.SetCurrentRow(GridViewRowInfo row, Boolean setPosition, Boolean shift, Boolean control, Boolean rightMouseButton)
   at Telerik.WinControls.UI.GridViewTemplate.SetCurrentRow(GridViewRowInfo rowInfo)
   at Telerik.WinControls.Data.DataAccessComponent.InitDataGrid()
   at Telerik.WinControls.Data.DataAccessComponent.currencyManager_ListChanged(Object sender, ListChangedEventArgs e)
   at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
   at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
   at StrataGem.frmTicketSummary.LoadTicketSummary(ListProcessedFiles list, Boolean isrunningrealtime)
   at StrataGem.frmTicketSummary.tmrMain_Tick(Object sender, EventArgs e)
Jack
Telerik team
 answered on 04 Aug 2010
7 answers
183 views

Hi

i build a user control that include a GridView and more objects.
i need to display the grid to the user without selecting the first row.
in the DataBindingComplete Event i add this line to unselect row :

this.CurrentRow = null;


when the grid show in the first time it's ok, none of the rows selected.
but when i change the DataSource of the grid, the first row selected !

when i use the debuger i saw that after the DataBindingComplete event run the

SelectionChanged event run too.

 

when i use the debugger in the first time that the form show, I saw that DataBindingComplete event run and after that the SelectionChanged run and after that DataBindingComplete event run again.

And because of that the line that I add (this.CurrentRow = null;) run in the end and none of the row selected.

What can I do to unselect row ?

I whant that the code I write will be in the user control and not in the forms code.


Martin Vasilev
Telerik team
 answered on 04 Aug 2010
1 answer
103 views
I need to have checkboxes in my treeview, but only at the bottom-most level in the tree.  As far as I know, that means I need to enable checkboxes and then suppress them where I don't want them.  I think that the SetPropertyValue command might be of use, but it isn't obvious how the command is used.  I have not been able to find any examples where it is invoked.

Can anyone tell me how to use it, or provide an alternate method to only show checkboxes on one level of the tree?
Victor
Telerik team
 answered on 04 Aug 2010
7 answers
326 views
Hello

First of all: great update, the Gridview in Q2 2010!
Still, what is causing me headache is the new drag and drop capability:

If I use the code snippets from the samples:

ddService = radHView1.GridViewElement.GetService<Telerik.WinControls.RadDragDropService>();
ddService.PreviewDragOver += new System.EventHandler<Telerik.WinControls.RadDragOverEventArgs>(_ddService_PreviewDragOver);
ddService.PreviewDragDrop += new System.EventHandler<Telerik.WinControls.RadDropEventArgs>(_ddService_PreviewDragDrop);
ddService.PreviewDragHint += new System.EventHandler<Telerik.WinControls.PreviewDragHintEventArgs>(_ddService_PreviewDragHint);

the events only get fired when dragging the column (GridCellElement ) as shown in the example
http://www.telerik.com/community/forums/winforms/gridview/drag-amp-drop-functionalities-to-swap-column.aspx

For the data-bound Gridrows the events do not get fired.

Am I doing something wrong? Is there any kind of documentation for the new drag and drop mechanism?

Thanks


Markus
Svett
Telerik team
 answered on 04 Aug 2010
5 answers
224 views
Guys,

I am facing significant performance issues while using the conditional formatting objects like below.
If I do not format my grid it shows up really fast - using the conditional formatting it takes minutes to load.

The data amount I am loading is around 44000 records (7.500 in the Master, the rest in the childgrid).

Is there something I can do to optimize the performance? At the moment it is nearly unusable.

Here is the code I am referring to:

Dim c1 As New ConditionalFormattingObject("ReferenceWeek0", ConditionTypes.Equal, _supplyLogicLayer.Mapping(0), "", True)
c1.RowBackColor = Color.FromArgb(79, 129, 189)
c1.CellBackColor = Color.FromArgb(79, 129, 189)
c1.CellForeColor = Color.White
c1.RowForeColor = Color.White
 
Dim c5 As New ConditionalFormattingObject("Adjusted", ConditionTypes.Equal, "Adjusted Net Requirement (User Input)", "", True)
c5.RowBackColor = Color.Orange
c5.CellBackColor = Color.Orange
c5.CellForeColor = Color.Black
 
Dim c6 As New ConditionalFormattingObject("SupplyAdjusted", ConditionTypes.Equal, "Supply Adj. Forecast (User Input)", "", True)
c6.RowBackColor = Color.Yellow
c6.CellBackColor = Color.Yellow
c6.CellForeColor = Color.Black
 
Dim c2 As New ConditionalFormattingObject("KPI1", ConditionTypes.Equal, "GREEN", "", False)
c2.RowBackColor = Color.FromArgb(97, 189, 122)
c2.CellBackColor = Color.FromArgb(97, 189, 122)
c2.CellForeColor = Color.FromArgb(97, 189, 122)
 
Dim c3 As New ConditionalFormattingObject("KPI2", ConditionTypes.Equal, "YELLOW", "", False)
c3.RowBackColor = Color.FromArgb(254, 221, 107)
c3.CellBackColor = Color.FromArgb(254, 221, 107)
c3.CellForeColor = Color.FromArgb(254, 221, 107)
 
Dim c4 As New ConditionalFormattingObject("KPI4", ConditionTypes.Equal, "RED", "", False)
c4.RowBackColor = Color.FromArgb(246, 150, 136)
c4.CellBackColor = Color.FromArgb(246, 150, 136)
c4.CellForeColor = Color.FromArgb(246, 150, 136)
 
grid.MasterGridViewTemplate.Columns("Measure").ConditionalFormattingObjectList.Add(c1)
grid.MasterGridViewTemplate.ChildGridViewTemplates(0).Columns("Measure").ConditionalFormattingObjectList.Add(c1)
grid.MasterGridViewTemplate.Columns("Measure").ConditionalFormattingObjectList.Add(c5)
grid.MasterGridViewTemplate.Columns("Measure").ConditionalFormattingObjectList.Add(c6)
 
 
For Each dc As GridViewDataColumn In grid.MasterGridViewTemplate.Columns
 
    Select Case dc.FieldName
        Case "ZZMIN"
            dc.Width = 70
            dc.TextAlignment = ContentAlignment.MiddleCenter
            dc.ReadOnly = True
        Case "SourcePlant"
            dc.TextAlignment = ContentAlignment.MiddleCenter
            dc.Width = 70
            dc.ReadOnly = True
        Case "Plant"
            dc.Width = 70
            dc.ReadOnly = True
        Case "Measure"
            dc.Width = 210
            dc.ReadOnly = True
        Case "Material"
            dc.TextAlignment = ContentAlignment.MiddleCenter
            dc.Width = 70
            dc.ReadOnly = True
        Case Else
            If IsDate(dc.FieldName) Then
                'Format values
                dc.FormatString = "{0:####,##0}"
                dc.Width = 70
                dc.TextAlignment = ContentAlignment.MiddleRight
                dc.ReadOnly = False
 
                'add conditional formatting for KPIs to each week column
                dc.ConditionalFormattingObjectList.Add(c2)
                dc.ConditionalFormattingObjectList.Add(c3)
                dc.ConditionalFormattingObjectList.Add(c4)
            End If
    End Select
 
Next
 
'Format childgrid
For Each dc As GridViewDataColumn In grid.MasterGridViewTemplate.ChildGridViewTemplates(0).Columns
    Select Case dc.FieldName
        Case "ZZMIN"
            dc.TextAlignment = ContentAlignment.MiddleCenter
            dc.ReadOnly = True
        Case "SourcePlant"
            dc.TextAlignment = ContentAlignment.MiddleCenter
            dc.ReadOnly = True
        Case "Plant"
            dc.TextAlignment = ContentAlignment.MiddleCenter
            dc.ReadOnly = True
        Case "Measure"
            dc.ReadOnly = True
        Case "Material"
            dc.TextAlignment = ContentAlignment.MiddleCenter
            dc.ReadOnly = True
        Case Else
            If IsDate(dc.FieldName) Then
                dc.FormatString = "{0:####,##0}"
                dc.TextAlignment = ContentAlignment.MiddleRight
                dc.ReadOnly = False
 
                'add conditional formatting for KPIs to each week column
                dc.ConditionalFormattingObjectList.Add(c2)
                dc.ConditionalFormattingObjectList.Add(c3)
                dc.ConditionalFormattingObjectList.Add(c4)
            End If
    End Select
 
Next
grid.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None
grid.MultiSelect = True
Dirk LX
Top achievements
Rank 1
 answered on 04 Aug 2010
2 answers
115 views
Ok I have a GridView on my form. The GridView datasource is a DataTable. 
the datatable columns types are:    bool (checkbox), text, text, text.
I set all the grid columns to read only except for the first one, to allow the user to check/uncheck to box. 

I also have a timer that ticks every 7 seconds and refreshes the datatable. 
Everything works fine to this point. 

Within the tick event i save the selected row, and then select it again after the data refresh, so the highlighted row doesn't pop back up to the top. 

private void tTickets_Tick(object sender, EventArgs e)
{
   int selectedrow = gridview.CurrentCell.RowIndex;
   GetData();
   gridview.CurrentRow = gvMassTickets.Rows[selectedrow];
}


 
The problem is, when it does this, column[0] (the check box column) becomes readonly. 
if i comment out the "gridview.CurrentRow = gvMassTickets.Rows[selectedrow];"
it works just fine. 


Alexander
Telerik team
 answered on 04 Aug 2010
2 answers
92 views

Hello,

I use the RadCalendar with the Office2010 style. When I activate the row header the calendar week is shown. But when I start my application only the first numer is visible. The width of the row header is to small. So, how can I change the width of the row header.

Best regards

Martin

Boryana
Telerik team
 answered on 04 Aug 2010
3 answers
95 views

Hi,

in the RadForms demo application the cells of the calendar control (First Look) have a blue header an are separated with a thin blue lines. In the example code the calendar controls uses a "Scheduler" theme. Is this theme only used inside the demo? I try to get the same visual style in my application, but without success.

Regards

Martin

Nikolay
Telerik team
 answered on 04 Aug 2010
3 answers
189 views
I think this is an oversight on the MS controls.

Only some controls have a ReadOnly property e.g. the textBox and derivitaves.

For the standard checkbox you can use the AutoCheck property to achieve the same, but the RadCheckbox does not have that property either

Would it be possible to have a 'ReadOnly' property added to all the controls, what, imo, it should do it allow us to look but not touch, e.g. simular to enable, but still allow scrollbars, dropdowns to work, oh and not to change the colour (so users can still read the data and copy it)


Boryana
Telerik team
 answered on 04 Aug 2010
3 answers
191 views
Hi,

What I am attempting to do is to detect all changes to appointments, as well as deletions or additions of appointments. New appointments, deletions of appointments, or changes to appointments must be saved to the Appointments table of our database.

My approach has been to use an event handler for the RadScheduler.Appointments.CollectionChanged event. Of course, the RadScheduler's Appointment collection changes when you initially load it, so you have to handle that case. But I find my event handler being called when I mouse-click an appointment in the scheduler.

Is my approach all wrong?
Nikolay
Telerik team
 answered on 04 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)
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
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
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
DateTimePicker
CollapsiblePanel
Conversational UI, Chat
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
NavigationView
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
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
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?