Telerik Forums
UI for WinForms Forum
3 answers
193 views
Hello Telerik Team,

I am facing a rather strange problem with the telerik dropdownlist and listbox.

I am developing an application which relies on a couple of nonmanaged driver-dlls. As soon as I load one particular dll, after that I cannot instanianate ANY telerik dropdownlist or listbox. As soon as the controls ctor is called, an arithmeticexception is thrown. The call stack is as follows:

bei Telerik.WinControls.UI.RadScrollBarElement.get_ThumbLengthProportion()
bei Telerik.WinControls.UI.RadScrollBarElement.SetupThumb(Int32 newValue, Boolean thumbLocationOnly)
bei Telerik.WinControls.UI.RadScrollBarElement.set_Maximum(Int32 value)
bei Telerik.WinControls.UI.VirtualizedScrollPanel`2..ctor()
bei Telerik.WinControls.UI.RadListElement..ctor()
bei Telerik.WinControls.UI.PopupEditorElement.CreateChildElements()
bei Telerik.WinControls.UI.RadDropDownListElement.CreateChildElements()
bei Telerik.WinControls.RadElement.CallCreateChildElements()
bei Telerik.WinControls.RadElement.Construct()
bei Telerik.WinControls.RadElement..ctor()
bei Telerik.WinControls.RadItem..ctor()
bei Telerik.WinControls.UI.PopupEditorElement..ctor()
bei Telerik.WinControls.UI.RadDropDownListElement..ctor()
bei Telerik.WinControls.UI.RadDropDownList.CreateChildItems(RadElement parent)
bei Telerik.WinControls.RadControl.Telerik.WinControls.IComponentTreeHandler.CreateChildItems(RadElement parent)
bei Telerik.WinControls.RadControl.ComponentOverrideElementTree.CreateChildItems(RadElement parent)
bei Telerik.WinControls.RadControl.Construct()
bei Telerik.WinControls.RadControl..ctor()
bei Telerik.WinControls.UI.RadDropDownList..ctor()
bei SenseIT._4Dtwo.CatchIT.Forms.AddNewDevice.InitializeComponent() in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Forms\AddNewDevice.Designer.cs:Zeile 37.
bei SenseIT._4Dtwo.CatchIT.Forms.AddNewDevice..ctor() in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Forms\AddNewDevice.cs:Zeile 20.
bei SenseIT._4Dtwo.CatchIT.Controls.DeviceView.radButton1_Click(Object sender, EventArgs e) in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Controls\DeviceView.cs:Zeile 161.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei Telerik.WinControls.RadControl.OnClick(EventArgs e)
bei Telerik.WinControls.UI.RadButton.ButtonElement_Click(Object sender, EventArgs e)
bei Telerik.WinControls.RadItem.OnClick(EventArgs e)
bei Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
bei Telerik.WinControls.RadItem.DoClick(EventArgs e)
bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
bei Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
bei Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei Telerik.WinControls.RadControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei SenseIT._4Dtwo.CatchIT.Program.Main() in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Program.cs:Zeile 21.
bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()

Do you have any idea how I could work around this problem?

best regards

Ulrik
Stefan
Telerik team
 answered on 14 Oct 2010
15 answers
393 views
I have the following Grid structure:

MasterGridViewTemplate (dgTransactions) --> ChildGridTemplate1 (cSubCat)  --> ChildGridTemplate2 (cTrans)

I am populating each Template with Data but the ChildGridTemplate2 is not displaying any data - even though that the Datasource is populated with data.


Code snippet:
GridViewTemplate cSubCat = new GridViewTemplate(this.dgTransactions);
 
GridViewRelation relGridSubCat = new GridViewRelation(this.dgTransactions.MasterGridViewTemplate);
 
relGridSubCat.ChildTemplate = cSubCat;
relGridSubCat.ChildColumnNames.Add("CategoryType");
relGridSubCat.ParentColumnNames.Add("CategoryType");
 
 
this.dgTransactions.Relations.Add(relGridSubCat);
 
            this.dgTransactions.MasterGridViewTemplate.ChildGridViewTemplates.Add(cSubCat);
 
GridViewTemplate cTrans = new GridViewTemplate(this.dgTransactions);
 
             
GridViewRelation relSubCatTrans = new GridViewRelation();
relSubCatTrans.ChildTemplate = cTrans;
relSubCatTrans.ParentTemplate = this.dgTransactions.MasterGridViewTemplate.ChildGridViewTemplates[0];
relSubCatTrans.ChildColumnNames.Add("CategorySubType");
relSubCatTrans.ParentColumnNames.Add("CategorySubType");
 
             
this.dgTransactions.Relations.Add(relSubCatTrans);
 
cSubCat.ChildGridViewTemplates.Add(cTrans);
 
var sub = from x in this.CurrentTransactions
          select new { CategorySubType = x.CategorySubType, CategoryType = x.CategoryType };
 
            
             
 this.dgTransactions.DataSource = sub.Select(grp => new { grp.CategoryType }).Distinct().ToList(); ;
 
 
 cSubCat.DataSource = sub.Select(grp => new { grp.CategorySubType, grp.CategoryType }).Distinct().ToList();
 
 
cTrans.DataSource = this.CurrentTransactions.ToList();
Nikolay
Telerik team
 answered on 14 Oct 2010
14 answers
253 views
Hello,
               I want  to  chang  current  row  at  radgrid    .I  use  3 level  hierarchical  and  want  to  chang seleted  row  from     level  1  to  level 2  and  so on.


Alexander
Telerik team
 answered on 14 Oct 2010
2 answers
176 views
Hello,

I´m traying to use the AllowAddNewRow property of RadGridView but
i have an error when set to true this property.

The error ocurrs when you configures the grid with readonly columns property.
When you drag and drop the "Click here to add new row" cell to other readonly cell in diferent row.

this is my example

GridViewTextBoxColumn

 

txtEstatus = new GridViewTextBoxColumn();

 

txtEstatus.Name =

"Estatus";

 

txtEstatus.HeaderText =

"Estatus";

 

txtEstatus.ReadOnly =

true;

 

radGridView1.Columns.Add(txtEstatus);

 


GridViewTextBoxColumn
txtot = new GridViewTextBoxColumn();

 

txtot.Name =

"OT";

 

txtot.ReadOnly =

true;

 

txtot.HeaderText =

"OT";

 

radGridView1.Columns.Add(txtot);

radGridView1.AllowAddNewRow =

true;

 

radGridView1.AutoSizeColumnsMode =

GridViewAutoSizeColumnsMode.Fill;

 

radGridView1.Rows.Add((

new List<string> {"333","333","dd","dd" }).ToArray());

 



to resolve this error i have to set each cell for this row to readonly




The error says Message= "No se puede convertir un objeto de tipo 'Telerik.WinControls.UI.GridViewDataRowInfo' al tipo 'Telerik.WinControls.UI.GridViewNewRowInfo'.

"Unable to cast object of type 'Telerik.WinControls.UI.GridViewDataRowInfo' to type 'Telerik.WinControls.UI.GridViewNewRowInfo'.
Alexander
Telerik team
 answered on 14 Oct 2010
7 answers
165 views
Hi,
is there any way to shorten my validation code?? like using case, etc..???
I have been tried many ways to shortened it, but i got nothing but error because the parameter (ByVal e As Telerik.WinControls.UI.CellValidatingEventArgs)
here my code:

Private Sub TabelBuku_CellValidating(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellValidatingEventArgs) Handles TabelBuku.CellValidating
    Dim kolom = TryCast(e.Column, GridViewDataColumn)
    If ((TypeOf e.Row Is GridViewDataRowInfo Or (TypeOf e.Row Is GridViewNewRowInfo)) AndAlso (kolom IsNot Nothing) AndAlso (kolom.FieldName = "Tahun Terbit")) Then
        Dim nilai = DirectCast(e.Value, String)
        If (String.IsNullOrEmpty(nilai)) Then
            e.Cancel = True
            e.Row.ErrorText = "Tahun Terbit Belum Diisi"
            warningKesalahan(Color.LightYellow, Color.Red, "Tahun Terbit Belum Diisi!!")
        Else
            e.Row.ErrorText = String.Empty
            warningKesalahan(Color.Transparent, Color.LimeGreen, "Editor Data Buku")
        End If
    End If
    If ((TypeOf e.Row Is GridViewDataRowInfo Or (TypeOf e.Row Is GridViewNewRowInfo)) AndAlso (kolom IsNot Nothing) AndAlso (kolom.FieldName = "IdBuku")) Then
        Dim nilai = DirectCast(e.Value, String)
        If (String.IsNullOrEmpty(nilai)) Then
            e.Cancel = True
            e.Row.ErrorText = "ID Buku Harus Diisi"
            warningKesalahan(Color.LightYellow, Color.Red, "ID Buku Harus Diisi")
        Else
            e.Row.ErrorText = String.Empty
            warningKesalahan(Color.Transparent, Color.LimeGreen, "Editor Data Buku")
        End If
    End If
End Sub

Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
7 answers
413 views
I am trying to use an image on the buttons in GridCommandCellElement columns. How do I Zoom the image to fit the cell?
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
1 answer
238 views
Hello Telerik,

we are currently working on a project where we using your masked textbox. We bounded a BindingSource (System.Windows.Forms.BindingSource) to a RadMaskedEditBox. The BindingSource is linked to a class instance with several properties (string, double etc.).
The textbox is masked with "c2" and the masktype is "numeric". Our problem is when we are entering a value and the group or decimal seperator is a comma, for example "200,00", the value becomes 20000,00 (we are a german developer team). The same goes for english number formats the moment a comma is involved (2,000.00 becomes 200,000.00).
The property the textbox is linked to contains a value of the datatype double.

Is there a solution to this problem because we really want to use your controls.

Here a some more information about our configuration:
OS: XP and Win7
Telerik: RadControls fpr WinForms Q10

thanks in advance and greetings from germany
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
10 answers
318 views

hi,
I have a radcontextmenu which only seems to work once. When I right click, my new items are added to the default menu, but when I go to do it again, I get the error message: 'Cannot remove the specified item because it was not found in the specified collection.'

here is the code:

 

Private

 

Sub grdSearch_ContextMenuOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs) Handles grdSearch.ContextMenuOpening

 

 

Try

 

 

 

 

e.ContextMenu.Items.AddRange(rcmDebts.Items)

 

Catch ex As Exception

 

MsgBox(ex.Message)

 

End Try

 

 

 

 

 

End Sub

 

Martin Vasilev
Telerik team
 answered on 13 Oct 2010
5 answers
114 views
Hi
I want to add UserControl in a RadToolStripItem. Not when the coding.



Thanks
Stefan
Telerik team
 answered on 13 Oct 2010
2 answers
153 views
I change the Cell Elements ForeColor To Red if the value is less than Zero.

Private Sub GridPrimerResults_CellFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles GridPrimerResults.CellFormatting
        If CInt(e.CellElement.RowInfo.Cells(1).Value) <= 0 Then
            e.CellElement.NumberOfColors = 1
            e.CellElement.ForeColor = Color.Red
            e.CellElement.DrawFill = True
        End If
    End Sub

It works fine on Load.  When I scroll beyond the text that was Default Black, and scroll back up it now becomes red.  When I click to Export the grid to Excel the Forecolor returns. 

Any ideas on why my color changes when I scroll past the values or how I can prevent it from changing to red?

Attached are screen shots of the rows and how the changed after scrolling.
Scott
Top achievements
Rank 2
 answered on 13 Oct 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
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
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
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?