Telerik Forums
UI for WinForms Forum
1 answer
113 views
Hi,

I have a form that there are lots of toolwindows. Those toolwindows can be tabbedwindows or floatingwindows. So, when I change which one is activated I need to do an action with the control inside the window, but I'm having problems how can I do an action with this control when I activate this toolwindow? I couldn't find the OnActivated event.
Nikolay
Telerik team
 answered on 06 Sep 2013
5 answers
692 views
I have a scenario where I need to populate a combobox in a cell based on the selection of another cell's combo box. That is, for example, there is a ShippingCarrier (UPS, USPS, FedEx etc) and when user select one of them, it should populate next cell's combo box with their services (for example, if UPS is selected, UPS Priority, UPS Next Day Air etc should be available in second column).

I am using UnBound grid. My code seems to work, HOWEVER, when data is populated in second column, you can not drop down 2nd combo box using mouse (the only way to drop down is to put cursor on second drop down and use ALT+Down Arrow key). Below is the code I am using.

        col = AppendNewColumn(ColumnType.DropDown, 100, "Carrier""Carrier"
        Dim cCol As GridViewComboBoxColumn = CType(col, GridViewComboBoxColumn) 
        cCol.DataSource = GetShippingCarriers() 
        cCol.DisplayMember = "Display" 
        cCol.ValueMember = "Key" 

AppendNewColumn is the function which creates column and add that to columns collection of Grid. next you can see that it get shipping carriers and bind to that.

Now in CellEndEdit event, I am trying to populate second column as below.
 Private Sub grdMain_CellEndEdit(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles grdMain.CellEndEdit 
      If e.ColumnIndex = 12 Then 'Shipping Carrier Selected
            Dim row As GridViewRowInfo = Me.grdMain.Rows(e.RowIndex) 
            Dim newCarrier As String = row.Cells(e.ColumnIndex).Value.ToString 
            If newCarrier IsNot Nothing AndAlso newCarrier <> "" Then 
                'Next column is Shipping Method (e.ColumnIndex + 1)
                Dim cellElem As GridComboBoxCellElement = CType(row.Cells(e.ColumnIndex + 1).CellElement, GridComboBoxCellElement) 
                Debug.Write(cellElem.ToString) 
 
                Dim col As GridViewDataColumn = CType(cellElem.ColumnInfo, GridViewDataColumn) 
 
                Dim element As New RadComboBoxElement 
                ServiceInfo.UPSServices.ToArray() 
                element.DataSource = GetShippingServices(CType(CInt(newCarrier), ShippingCarriers)) 
                element.DisplayMember = "DisplayName" 
 
                element.StretchHorizontally = True 
                element.StretchVertically = True 
                element.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList 
 
                For Each obj As Object In cellElem.Children 
                    If TypeOf obj Is ComboBoxEditorLayoutPanel Then 
                        cellElem.Children.Remove(CType(obj, ComboBoxEditorLayoutPanel)) 
                    End If 
                Next 
                'cellElem.Children.Clear() 
                cellElem.Children.Add(element) 
 
                Debug.Write(col.FieldName) 
            End If 
        End If 

Is there anything wrong with the above code that drop down is NOT selected correctly using mouse? 
Also, as you can see that I am binding using name/value pair, however, from the cell object, I can get only Value, is there any way to get SelectedItem (Drop down item selected) which may further give me Text and Value? For example, row.Cells(e.ColumnIndex).Value.ToString returns value (numeric), however, display thing is Text (USPS, UPS etc). Is there any way to get either DisplayName or ValueMember value?

   Thanks,
   Sameers
Nikolay
Telerik team
 answered on 06 Sep 2013
1 answer
293 views
Hi,

I'm using telerik rad controls and I've encountered roadblocks.

I've application that have RadGridView with multiple RadComboBox different datasource.

Questions:

How I'll bind a specific cell in RadGridView with ComboBox? Please see my codes below.

        private void grdList_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            DataTable dt = PopulateList();

            GridViewComboBoxColumn comboCol = e.Column as GridViewComboBoxColumn;
            comboCol.DataSource = dt;
            
            ((GridViewComboBoxColumn)e.Column).DataSource = dt;
        }

This code bind all the Rad Combo and I want only the specific cell..

Like this one on DataGridView

                (grdList.Rows[e.RowIndex].Cells[4] as DataGridViewComboBoxCell).DataSource = _dt;
                (grdList.Rows[e.RowIndex].Cells[4] as DataGridViewComboBoxCell).ValueMember = "CODE";
                (grdList.Rows[e.RowIndex].Cells[4] as DataGridViewComboBoxCell).DisplayMember = "NAME";

Thanks
Nikolay
Telerik team
 answered on 06 Sep 2013
1 answer
146 views
I am trying to set the background color of a RadMenuItem based on some logic in order to highlight a particular item in the menu. To set the highlighted item color I am doing this:

menuItem.FillPrimitive.BackColor = Color.Gray;


The problem is this coloring only is visible when the mouse moves over the item. I want the coloring to apply to all states. Is there something else that must be done for this to appear in non-hover states?
Nikolay
Telerik team
 answered on 05 Sep 2013
1 answer
148 views
hi telerik

i save nodes  name in sql database ,how can i get new name  after renaming a node  .?
i test this codes  :

Private Sub TreeDevices_TextChanged(sender As Object, e As EventArgs) Handles TreeDevices.ValueChanged
     
   dim Com as sqlcommand=" update Table1 set Field2='" &  TreeDevices.SelectedNode.Name & "' where field1 = " & TreeDevices.SelectedNode.Tag

            con.Open()
            com.ExecuteNonQuery()
            con.Close()
     
    End Sub

 after renaming a node event  "TreeDevices.ValueChanged" occur   but  "TreeDevices.SelectedNode.Name"  still return old name.
what can i do?

thank you
omid




George
Telerik team
 answered on 05 Sep 2013
1 answer
103 views
Hello,
how do I set filter for a checkboxcolumn to filter only checked/unchecked or all rows?
Stefan
Telerik team
 answered on 05 Sep 2013
3 answers
1.1K+ views
Hi,

I have RadGridView populated and it has first column as boolean column shown as checkbox on UI. I need to disable some checkbox on RadGridview based on some data on other column (means user can't click or do any operation.) and need to select and Unselect some checkbox. I tried cellformatting event and cellClick event but no success. I treid to access checkboxelement but it don't have any check property. Please help me how to access checkbox cell element at these events. Or is there any other event???

GridViewBooleanColumn

columnA = new GridViewBooleanColumn();

columnA.HeaderTextAlignment =

ContentAlignment.MiddleLeft;

columnA.HeaderText =

"";

columnA.DataField =

"Check";

columnA.ReadOnly =

false;

columnA.Width = 20;

columnA.AllowResize =

false;

columnA.MinWidth = 20;

radDownLoadListGridView.MasterGridViewTemplate.Columns.Add(columnA);


...........................

private void radDownLoadListGridView_CellClick(object sender, GridViewCellEventArgs e)

{

if (e.ColumnIndex == 0)

{

if (radDownLoadListGridView.CurrentRow.Cells[9].Value.ToString().ToLower() == "y")

{

(radDownLoadListGridView.CurrentCell).Column.ReadOnly =

false;

((Telerik.WinControls.UI.

GridCheckBoxCellElement)(radDownLoadListGridView.CurrentCell)).IsReadOnly = false;

((Telerik.WinControls.UI.

GridCheckBoxCellElement)(radDownLoadListGridView.CurrentCell)).IsSelected = true;

}

else

{

(radDownLoadListGridView.CurrentCell).Column.ReadOnly =

false;

}

}

}

George
Telerik team
 answered on 05 Sep 2013
5 answers
181 views
I want to display the scale of Y-Axis in Custom Format,  i-e  instead of displaying 10,000 I want to show 10K. ?

WarriorJorge
Top achievements
Rank 1
 answered on 04 Sep 2013
1 answer
148 views
I have a tab control and each tab's [x] button (far right of tab strip) behavior is to remove the tab page from the collection.
1) how do I change the [x] to an icon; and,
2) how do I override the event to provide my own functionality (example to delete the underlying object).
Stefan
Telerik team
 answered on 04 Sep 2013
1 answer
320 views
I have a RadContextMenu on a RadListView with 2 commands.  Add and Remove.  The Add works fine, but when I use the remove a few times, It removes the selected Index item in addition to the one above it.  The Item.text for the listview items are unique and that is how  I am removing them. 

Help!  I've been fighting this for 3 days.  Still clicking remove on 1 item results in multiple items being removed. 

A good example of the radMenuItem1_Click event would be very useful.

Thanks,
-Henry
Stefan
Telerik team
 answered on 04 Sep 2013
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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?