Telerik Forums
UI for WinForms Forum
1 answer
129 views
I try to change RadComboBoxItems collection through casting SelectedIndexChanged event (for localization reasons). And it works fine in version 2009.2.729. But in current version 2009.3.1103 it produced exception ("Object reference not set to an instance of an object") if I change item in combobox. If I press button - all works fine.

What's wrong with that code?

Public Class RadForm1 
    Private m_cmbCurLanguage As Boolean = False 
 
    Private Sub RadForm1_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load 
        AssignCurLanguage(0) 
        m_cmbCurLanguage = True 
    End Sub 
 
    Private Sub AssignCurLanguage(ByVal lng As Integer
        Dim lng1 As String = "", lng2 As String = "", lng3 As String = "" 
 
        Select Case lng 
            Case 0 
                lng1 = "Eng1" : lng2 = "Ger1" : lng3 = "Fra1" 
            Case 1 
                lng1 = "Eng2" : lng2 = "Ger2" : lng3 = "Fra2" 
            Case 2 
                lng1 = "Eng3" : lng2 = "Ger3" : lng3 = "Fra3" 
        End Select 
 
        m_cmbCurLanguage = False 
 
        cmbCurLanguage.Items.Clear() 
        cmbCurLanguage.Items.Add(New Telerik.WinControls.UI.RadComboBoxItem(lng1, 0)) 
        cmbCurLanguage.Items.Add(New Telerik.WinControls.UI.RadComboBoxItem(lng2, 1)) 
        cmbCurLanguage.Items.Add(New Telerik.WinControls.UI.RadComboBoxItem(lng3, 2)) 
 
        cmbCurLanguage.SelectedIndex = lng 
    End Sub 
 
    Private Sub cmbCurLanguage_SelectedIndexChanged(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles cmbCurLanguage.SelectedIndexChanged 
        If m_cmbCurLanguage Then 
            AssignCurLanguage(cmbCurLanguage.SelectedIndex) 
            m_cmbCurLanguage = True 
        End If 
    End Sub 
 
    Private Sub RadButton1_Click(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles RadButton1.Click 
        AssignCurLanguage(1) 
        m_cmbCurLanguage = True 
    End Sub 
End Class 
Victor
Telerik team
 answered on 18 Nov 2009
1 answer
119 views

 

Hi
I am trying to get a combobox inside the radgridview. Below code doesnt seem to work. Any help would be appreciated

   Dim farmer As New UI.GridViewComboBoxColumn()
            farmer.DataType = GetType(String)
            farmer.UniqueName = "UserID"

            farmer.HeaderText = "Farmer"
            farmer.DataSource = GetFarmerDataSource()
            farmer.DisplayMember = "UserID"
            farmer.ValueMember = "UserCode"
            farmer.FieldName = "UserID"
            farmer.Width = 150


            rgvBill.MasterGridViewTemplate.Columns.Add(farmer)


            Dim Bags As New UI.GridViewTextBoxColumn()
            Bags.DataType = GetType(Int32)
            Bags.UniqueName = "Bags"
            Bags.FieldName = "Bags"
            Bags.HeaderText = "Bags"
            Bags.Width = 50
            rgvBill.MasterGridViewTemplate.Columns.Add(Bags)


My radgrid at design time has no columns defined
Jack
Telerik team
 answered on 18 Nov 2009
3 answers
207 views
Good Afternoon,

I recently upgraded to the new Radcontrols for Winforms 2009 Q3 and noticed an issue with code that was previously working.

In my grid's I was handling the "CurrentRowChanged" event as it seemed this event would fire after the current row had changed allowing me to look at "GridView1.CurrentRow.GridViewInfo.CurrentIndex" to get the new index of the row that was selected. From this I was able to get some information from a specific Cell that contained an ID and query my database to load assocaited information.

Unfortuantely since installing 2009 Q3, this event still fires, but the resulting Index is always 0 even though the grid itself visually does display the highlighted row properly.

Has something changed with the "CurrentRowChanged" event, should I be using "SelectionChanged" instead? If so I could not find any exampled for "SelectionChanged"

In reality all I am wanting to do is get the index of the newly selected row after it is clicked on.

Any help would be apprecaited.

Thank You,

Chris Eisnaugle

Jack
Telerik team
 answered on 18 Nov 2009
2 answers
165 views
Hi

I have a RadDock control (named dockManager) that I am listening to the drag/drop service on, using the following code in the form's constructor:
            DragDropService dragDrop = dockManager.GetService<DragDropService>();  
            dragDrop.DragDropMode = DragDropMode.Preview;  
            dragDrop.PreviewDockPosition += new DragDropDockPositionEventHandler(dragDrop_PreviewDockPosition);  
            dragDrop.Starting += new StateServiceStartingEventHandler(dragDrop_Starting);  
            dragDrop.AllowedStates = AllowedDockState.All & ~AllowedDockState.TabbedDocument;  
 
 
I need to determine whether I am dragging a ToolWindow, a DockTabStrip and also determine the type of toolwindow/DockTabStrip
At the risk of asking a stupid question, how do I determine what object I am dragging in dragDrop_Starting event handler and/or dragDrop_PreviewDockPosition?

Thanks in advance

Alan
Georgi
Telerik team
 answered on 18 Nov 2009
1 answer
101 views
Hi there,

Not sure if this is DEU syndrome or not, but I seem to have closed the windows in the StyleBuilder, and can't for the life of me figure out how to get them back.  This only seems to be the case from an instance that runs after being initiated from VS. If I run from the start menu, the proper windows are displayed.  I tried to rename the cfg file from ProgramData, but it didn't seem to make a difference.

Thanks.

Ashley
Nikolay
Telerik team
 answered on 18 Nov 2009
1 answer
144 views
I'm developing a project where i have to use the ADO.net architecture. I'm trying to understand the whole SchedulerDataDataSet, but i'm kinda stuck. If there any way to change everything and do it with a Business Entities Component and a Data Acces Layer Component.
Nikolay
Telerik team
 answered on 18 Nov 2009
1 answer
187 views
I'm trying to get the RadMarkupDialog working at runtime (using the code from http://www.telerik.com/help/winforms/radmarkupdialog.html). I have references to Telerik.WinControls, Telerik.WinControls.UI, Telerik.WinControls.UI.Design, TelerikCommon, and TelerikData (all 2009.3.9.1103) and can't find the RadMarkupDialog class in any of them. Did the runtime version not make it in to Q3 or am I missing something?
Svett
Telerik team
 answered on 18 Nov 2009
1 answer
128 views
What I am trying to do is add a new row to a grid and then automatically set it to edit mode. What i'm finding is this fails on the first row that is inserted, but for every other row it works fine. I have tried setting current row/column a few different ways and found the same behaviour. Have set up a basic example of it below.

        private void Form1_Load(object sender, EventArgs e) 
        { 
            radGridView1.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; 
            radGridView1.ShowGroupPanel = false
            radGridView1.MasterGridViewTemplate.EnableGrouping = false
            radGridView1.MasterGridViewTemplate.AllowAddNewRow = false
 
            GridViewComboBoxColumn col1 = new GridViewComboBoxColumn("Test1""Test1"); 
            col1.DropDownStyle = RadDropDownStyle.DropDownList; 
            col1.FieldName = "Test1"
            col1.DisplayMember = "Test1"
            col1.DataType = typeof (int); 
            col1.DataSource = new[] {1, 2, 3}; 
            col1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; 
 
            radGridView1.Columns.Add(col1); 
        } 
 
        private void button1_Click(object sender, EventArgs e) 
        { 
            int rowCount = radGridView1.Rows.Count; 
 
            object[] values = {1}; 
            radGridView1.Rows.Add(values); 
            radGridView1.MasterGridViewInfo.CurrentRow = radGridView1.Rows[rowCount]; 
 
            radGridView1.Rows[rowCount].Cells["Test1"].BeginEdit(); 
        } 

What happens is the first row will get inserted without being in edit mode. if you click the button every other row works correctly.

Is there anything that i'm doing wrong in this case?

Version i'm using is: Q2 2009 SP1.

Have attached an image of the result. http://bayimg.com/image/maefbaaco.jpg

Jack
Telerik team
 answered on 18 Nov 2009
1 answer
250 views

During the CellBeginEdit event I need to supply a default value for the cell if there is no data in the cell and only during an Edit event. I initialized the default value during the CellEditorInitialized event and all works, the default value appears.
 

 

 

Private Sub gv_CellEditorInitialized(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles gv.CellEditorInitialized  
    If TypeOf gv.ActiveEditor Is RadTextBoxEditor Then 
        gv.ActiveEditor.Value = IIf(object.Data= 0, "",object.Data)  
    End If 
End Sub

Now when the Enter Key is pressed (accepting the default value) the CellEndEdit event is fired and I have the following code:
If IsNumeric(e.Value.ToString) Then 
  object.data = e.Value  
End If 
The issue is that the Cell Value (e.value) is never equal to the default value, it's empty.

Any help greatly appreciated.



Jack
Telerik team
 answered on 18 Nov 2009
3 answers
183 views
What's the recommended solution for expanding a tree view when bound to an object data source.  The created nodes are collapsed by default and I don't see a way to change the default behavior, nor do I see any events indicating when a node is added
Victor
Telerik team
 answered on 18 Nov 2009
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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
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
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
NavigationView
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?