Telerik Forums
UI for WinForms Forum
1 answer
151 views
Is there an easy work around for the MultiSelect not working in child grids?  I'm using ver 2010.1.10.504 and if I try to select (Ctrl-Click) a couple child rows under one parent row it works. However if I try to select two child rows under different parent rows, selection of the first row is removed upon clicking the second.  Is creating and using a new checkbox column the only way?   Thanks...
Martin Vasilev
Telerik team
 answered on 05 Aug 2010
3 answers
208 views
Hello,

I'm working with GridViewDecimalColumn and I would like that digits shown to have differents numbers of decimals according to their row. I've only found a command to impose the fomatString for all the columns. Before the update, it was possible through the command radGridView.rows[i].cell[j].cellElement.formatString, but won't functionnate anymore. I've searched in the documentations and tryed with GetCellElement function and with the cellFormating, but found nothing.

Does someone have an idea ?

Thank you

Georges DE VOS
Stefan
Telerik team
 answered on 05 Aug 2010
13 answers
282 views
Hello!
Need your help!

I have following code:
if (_providerGridView.CurrentCell.ColumnIndex == 0) return;
Cursor.Current = Cursors.WaitCursor;
DataRowView row = (DataRowView) gNSSDataProviderBindingSource.Current;
DataRow provRow = row.Row;
var rows = provRow.GetChildRows(_relationName);
_pointGridView.DataSource = rows;
CheckSeletedRows(rows);
Cursor.Current = Cursors.Default;

which throws ArgumentOutOfRangeException  when I try to switch in parent grid when some filter is applied to child grid (for example I selected several rows in child grid  based on some condition).
I try to add _pointGridView.EndEdit() before
_pointGridView.DataSource = rows;

but nothing helps.

Stack trace is :
System.ArgumentOutOfRangeException was unhandled by user code
  Message="Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
  Source="mscorlib"
  ParamName="index"
  StackTrace:
       at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)
       at Telerik.WinControls.RadElementCollection.get_Item(Int32 index)
       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.UI.GridViewTemplate.Update(GridUINotifyAction action)
       at Telerik.WinControls.Data.DataAccessComponent.InitDataGrid()
       at Telerik.WinControls.Data.DataAccessComponent.Bind(Object dataSource, String dataMember)
       at Telerik.WinControls.Data.DataAccessComponent.set_DataSource(Object value)
       at Telerik.WinControls.UI.RadGridView.set_DataSource(Object value)
       at DataProviderUI.ProivderTask.ProviderTaskControl.gNSSDataProviderBindingSource_CurrentChanged(Object sender, EventArgs e) in D:\SVN\Trunk\Archivarius\src\DataProviderUI\ProivderTask\ProviderTaskControl.cs:line 164
       at System.Windows.Forms.BindingSource.OnCurrentChanged(EventArgs e)
       at System.Windows.Forms.BindingSource.CurrencyManager_CurrentChanged(Object sender, EventArgs e)
       at System.Windows.Forms.CurrencyManager.OnCurrentChanged(EventArgs e)
  InnerException:

Thanks.
Nikolay
Telerik team
 answered on 04 Aug 2010
1 answer
141 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
248 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
136 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
368 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
294 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
161 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
125 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
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?