Telerik Forums
UI for WinForms Forum
8 answers
555 views

Please, can you help me with this question:

I have a grid with combobox column. All of these comboboxes have different DataSorce property (assigned thouth intercepting CellEditorInitialized event):

    Private Sub gridSort_CellEditorInitialized(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles gridSort.CellEditorInitialized  
        Dim i As Integer  
        If gridSort.CurrentColumn.HeaderText = "Order" Then  
            Dim editor As Telerik.WinControls.UI.RadComboBoxEditor = gridSort.ActiveEditor  
            Dim editorElement As Telerik.WinControls.UI.RadComboBoxEditorElement = editor.EditorElement  
 
            If gridSort.Rows.IndexOf(gridSort.CurrentRow) = 1 Then  
                i = editorElement.SelectedIndex  
                editorElement.DataSource = New String() {"Minimized""Maximized"}  
                editorElement.SelectedIndex = i  
                If i < 0 Then  
                    Dim ii As Integer = 0  
                    For Each ss As String In editorElement.DataSource  
                        If ss = gridSort.CurrentRow.Cells.Item(1).Value Then  
                            editorElement.SelectedIndex = ii  
                            Exit For  
                        End If  
                        ii += 1  
                    Next  
                End If  
            Else  
                i = editorElement.SelectedIndex  
                editorElement.DataSource = New String() {"Ascending""Descending"}  
                editorElement.SelectedIndex = i  
            End If  
        End If  
    End Sub 

1. Every time editorElement.SelectedIndex have value -1 (and I must set value by searching throuh DataSource list and comparing with cell Value). For values Minimized/Maximized it's done and work fine, but for values Ascending/Descending it's not and when I click on combobox field - it's filled by empty sring.

Comparing with Value of cell is not fine because here can be some duplicated values (sic!) and I can not determine what value was in this cell before. Is here some method of determine SelectedIndex after changing of value?

2. I want to collect data choosen by user. But ComboBox cell in grid have not SelectedIndex (or I can not find it?) and I must to obtain it from Value property. Problem is similiar with previous question - how can I find a real position of value in DataSource list?

Saurabh Garg
Top achievements
Rank 1
 answered on 19 Feb 2010
1 answer
95 views
Hello,

I have reported a problem with the pinned rows (in the radGrid) for the Q3 2009, this problem do not seem to be resolved in the Q1 2010 Beta.


Regards.

Court Philippe.
Nick
Telerik team
 answered on 19 Feb 2010
3 answers
144 views
I'm using 2009 Q3 Winforms.  In order to create a multi-select dropdown combobox, I used a few other forum posts' responses as a guide.  I created a GridMenuItem class that inherited from RadMenuItemBase and implemented INotifyPropertyChanged.  That GridMenuItem contains a RadGridView and adds that GridView as a RadHostItem to its children. 

Anyway, what happens is that the dropdown grid will resize itself each time you drop it down.  It appears to be decreasing the height while increasing the width, by a small amount (I think around 6 both ways).  Eventually you get to an ever-increasing line.  I cannot seem to figure out what is wrong.

Below is the code to show what is happening.

Thoughts?

(Create a new Forms project with Form1, add a dropdown button)

 

Imports Telerik.WinControls  
Imports Telerik.WinControls.UI  
Imports System.Text  
Imports System.Data.Common  
Imports System.ComponentModel  
 
Public Class Form1  
 
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
        Dim Item As GridMenuItem = New GridMenuItem  
        Dim Grid As RadGridView = Item.Grid  
 
        Grid.Columns.Add(New GridViewDataColumn("A"))  
        Grid.Columns.Add(New GridViewDataColumn("b"))  
        Grid.Columns.Add(New GridViewDataColumn("c"))  
        Grid.Rows.Add("Hello", "World", "!")  
        Grid.Rows.Add("Hello", "World", "!")  
        Grid.Rows.Add("Hello", "World", "!")  
        Grid.ReadOnly = False 
        Grid.Columns(0).Width = 5 
        Grid.Columns(1).ReadOnly = True 
        Grid.Columns(2).IsVisible = False 
        RadDropDownButton1.Items.Clear()  
        RadDropDownButton1.Items.Add(Item)  
    End Sub  
End Class  
 


Here's the item:

Imports Telerik.WinControls.UI  
Imports Telerik.WinControls  
Imports System.ComponentModel  
 
Public Class GridMenuItem  
    Inherits RadMenuItemBase  
    Implements INotifyPropertyChanged  
 
    Dim _Grid As RadGridView  
    Dim _HostItem As RadHostItem  
 
    Public ReadOnly Property Grid() As RadGridView  
        Get  
            Return Me._Grid  
        End Get  
    End Property  
 
    Protected Overrides Sub CreateChildElements()  
        _Grid = New RadGridView()  
        _Grid.BeginInit()  
        _Grid.BindingContext = New BindingContext()  
 
        _Grid.MultiSelect = True 
        _Grid.AutoSize = False 
        _Grid.HideColumnChooser()  
        _Grid.ReadOnly = False 
        _Grid.ShowGroupPanel = False 
        _Grid.ShowNoDataText = False 
        Dim Template As GridViewTemplate = _Grid.MasterGridViewTemplate  
        Template.AllowCellContextMenu = False 
        Template.AllowColumnChooser = False 
        Template.AllowColumnHeaderContextMenu = False 
        Template.AllowColumnReorder = False 
        Template.AllowAddNewRow = False 
        Template.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill  
        Template.EnableGrouping = False 
        Template.ShowFilteringRow = False 
        Template.ShowRowHeaderColumn = False 
        Template.ShowColumnHeaders = False 
 
        _Grid.EndInit()  
        _HostItem = New RadHostItem(_Grid)  
        Me.Children.Add(_HostItem)  
    End Sub  
 
    Protected Overrides Function MeasureOverride(ByVal availableSize As System.Drawing.SizeF) As System.Drawing.SizeF  
        Dim size As System.Drawing.SizeF = MyBase.MeasureOverride(availableSize)  
        Return _Grid.Size  
    End Function  
End Class  
 
Nikolay
Telerik team
 answered on 19 Feb 2010
2 answers
197 views
I add ComboBox column to GidView using this code:

GridViewComboBoxColumn stockCode = new GridViewComboBoxColumn();  
      stockCode.DataSource = dbS.view_Trans_Order_StockCodes;  
      stockCode.DisplayMember = "StockCode";  
      stockCode.ValueMember = "StockCode";  
      stockCode.FieldName = "StockCode";  
      stockCode.AutoCompleteMode = AutoCompleteMode.Suggest;  
      radGridView1.MasterGridViewTemplate.Columns.Add(stockCode); 

Data is displayed in GridView by I need:
- sort it. It is possible in this ComboBox? I try use like in normla ComboBox but it is not work
- using autocompletemode. I try do it but it is not working as Suggested :( I do now why

Could you help me?
Robert Stuczynski
Top achievements
Rank 1
 answered on 19 Feb 2010
3 answers
150 views
Hi Team,

I have a question to ask.

I have printed the summary totals at the bottom of the grid and also exporting well in ms-excel. I am also trying to print the grid with the print preview and other features(not using telerik reporting). My complete data is showing in the print preview except of the summary totals.

Is there any way to retrieve the SummaryItem values at runtime(in some user defined function)? If yes, can you please help me with
this?

Please find attached screenshot for your reference.

Thanks in advance

Cheers,
Munish Sharma
Nick
Telerik team
 answered on 19 Feb 2010
3 answers
154 views
Hi...
I have a multi column combo box bound to a binding adapter that is on a form.  I would like the combo to present a list of options , allowing to user to select one. 
This trouble I am having is, when the form loads, the combo box by default selects the first item in the list.  I have the datasource, Display member and Value member properties set. 

Is there a way to have this combo present the list (allowing me to refresh the datatable and binding adapter) with out selecting the first item in the list upon load?

Deyan
Telerik team
 answered on 19 Feb 2010
3 answers
145 views
Is there an event for when the user unselects a row within a list box?
I'm displaying the number of items that are selected within the listbox.  When I'm selecting a row the SelectedIndexChanged event fires and updated the label correctly with the number of items in the SelectedItems array.  But when I deselect/unselect no event fires unless I change rows.  I need to find a way to do this right when the user deselects/unselects the row.

Thank You
Victor
Telerik team
 answered on 19 Feb 2010
1 answer
114 views
Hi,

I have a grid in which some columns are editable , however when i click on columns which are not editable i want to make that full row as selected.

Can you please guide me in how to achieve this.

Thanks
Anuj
Martin Vasilev
Telerik team
 answered on 19 Feb 2010
3 answers
186 views
I am doing a program (C#) to display the chart according to the user selected values.For example display status of the staff members who are available.Unlike the default value 1,2,3..I wanted to change the labels in the X-axis to Available,off etc.How can I change the values of x-axis?(retrieve value from an array)
Thanks
Ves
Telerik team
 answered on 19 Feb 2010
1 answer
190 views
I hope someone can help I'm pulling my hairout here.  I know there are a few threads already on this, but none of them are helping me.

I have two columns in a datatable.  OrderDate and OrderTotal.

I've got this code.

RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45

RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.LongDate

 

RadChart1.PlotArea.XAxis.DataLabelsColumn = "OrderDate"

 

RadChart1.DataSource = dtOrders

RadChart1.DataBind()

You've already probably guessed what my question is.  This errors becuase I believe the OrderDate is not in the correct format and I need to us toAODate() in order to make this work.  Great, how?  Do I have to convert the data in the datatable with this function? How do you use it?  I've looked at the microsoft page, it didn't shed any light for me.

I understand that;

Dim SomeDateAsADouble as Double
DatetoConvert as Date = Today()

SomeDateAsADouble  = DatetoConvert.ToAODate()

How does this help with the above problem?

RadChart1.PlotArea.XAxis.DataLabelsColumn = "OrderDate".ToAODate()   ;This won't work

Please can someone help me, and anyone after me with an explained solution.  I really would appreciate it.

Ves
Telerik team
 answered on 19 Feb 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
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
Styling
Barcode
BindingNavigator
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
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?