Telerik Forums
UI for WinForms Forum
1 answer
183 views
Hi Telerik

I am building a multicolumn dropdown list in which I wish to use grouping. The grid has three columns, SecurityType, InstrumentGroup and Instrument. I want to group on SecurityType and within that grouping by InstrumentGroup so as to create a little hierarchy to act as a visual aid in selection.

If I allow manual grouping and drag the required columns to the group panel everything works fine but if I attempt to achieve the grouping programmaically the group header text for the InstrumentGroup header shows the same text as the SecurityType header.

I have attached the relevant snippet in the hope that you will have some insight into this one. Please note the commented out code was left in so you could see the other method I tried.

Regards
Ian Carson

Grid is setup like so..

private void GenerateMComboGrids()
{
    mcboInstrument.AutoSizeDropDownToBestFit = true;
    mcboInstrumentComboElement = mcboInstrument.MultiColumnComboBoxElement;
    mcboInstrumentComboElement.MultiColumnPopupForm.DropDownAnimationDirection = RadDirection.Left | RadDirection.Down;
    mcboInstrumentComboElement.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
    mcboInstrumentComboElement.DropDownHeight = 100;
    mcboInstrumentComboElement.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
    mcboInstrumentComboElement.EditorControl.MasterTemplate.AutoGenerateColumns = false;
    mcboInstrumentComboElement.EditorControl.ShowGroupedColumns = false;
    mcboInstrumentComboElement.EditorControl.ShowRowHeaderColumn = false;
    mcboInstrumentComboElement.EditorControl.EnableGrouping = true;
    mcboInstrumentComboElement.EditorControl.AutoExpandGroups = true;
    mcboInstrumentComboElement.EditorControl.ShowGroupPanel = false;
    mcboInstrumentComboElement.RightToLeft = true;
    
    GridViewTextBoxColumn column = new GridViewTextBoxColumn("SecurityType"); 
    column.HeaderText = "Security Type";
    mcboInstrumentComboElement.EditorControl.Columns.Add(column);
    GridViewTextBoxColumn column2 = new GridViewTextBoxColumn("InstrumentGroup"); 
    column2.HeaderText = "Instrument Group";
    mcboInstrumentComboElement.EditorControl.Columns.Add(column2);
    GridViewTextBoxColumn column3 = new GridViewTextBoxColumn("Instrument"); 
    column3.HeaderText = "Instrument";
    mcboInstrumentComboElement.EditorControl.Columns.Add(column3);
    mcboInstrumentComboElement.EditorControl.GroupDescriptors.Expression = "SecurityType ASC; InstrumentGroup ASC";
    //GroupDescriptor descriptor = new GroupDescriptor();
    //descriptor.GroupNames.Add("SecurityType", ListSortDirection.Ascending);
    //GroupDescriptor descriptor2 = new GroupDescriptor();
    //descriptor2.GroupNames.Add("InstrumentGroup", ListSortDirection.Ascending);
    //mcboInstrumentComboElement.EditorControl.GroupDescriptors.Add(descriptor);
    //mcboInstrumentComboElement.EditorControl.GroupDescriptors.Add(descriptor2);
    //mcboInstrumentComboElement.EditorControl.GroupSummaryEvaluate += new GroupSummaryEvaluateEventHandler(EditorControl_GroupSummaryEvaluate);
}


Data is entered using this method and for testing there is only a single row as follows:
SecurityType="Forex", InstrumentGroup="EUR", Instrument="EUR/USD"

private void PopulateInstrumentList()
{
    StrategyDistinctInstruments instruments = new StrategyDistinctInstruments(ThisVariation.StrategyVariation);
    Dictionary<string, BacktestInstrument> uniqueInstruments = instruments.UniqueInstruments;
    mcboInstrumentComboElement.EditorControl.TableElement.BeginUpdate();
    foreach (KeyValuePair<string, BacktestInstrument> kvp in uniqueInstruments)
    {
        GridViewRowInfo rowInfo = mcboInstrumentComboElement.EditorControl.Rows.AddNew();
        rowInfo.Tag = kvp.Value.Inst;
        rowInfo.Cells[0].Value = kvp.Value.SecurityType;
        rowInfo.Cells[1].Value = kvp.Value.InstrumentGroup;
        rowInfo.Cells[2].Value = kvp.Value.Inst.Name;
    }
    mcboInstrumentComboElement.EditorControl.TableElement.EndUpdate(true);
      
}




 
Julian Benkov
Telerik team
 answered on 08 Dec 2011
3 answers
166 views
How about letting the user select multiple document windows (tabs) for instance by pressing Shift and then have options in the Context Menü like Close Selected, Close all but these etc?

Regards
Erwin
Julian Benkov
Telerik team
 answered on 08 Dec 2011
3 answers
439 views
Hi everybody,

I would like to know if it is possible to complete a gridview  with empty rows?

For example, I have a grid view which can contain 9 rows but I only have 3 items to show.
The bottom of my grid is empty and I'd prefer having empty rows than nothing!

How can I do this?

Thanks

Lookoum
Julian Benkov
Telerik team
 answered on 08 Dec 2011
4 answers
598 views
I have a page view in my application.  Programmatically, I add 3 pages.  On each page I add a TableLayoutPanel.  Inside each panel I add about 15 rows with 2 columns each.  Each column has one label and one "other" control.  The "other" control is one of the following...

RadTextBox
RadCheckBox
RadDropDownList
RadSpinEditor

The pages with the drop down and spin editor takes several seconds to load and my processor is pegged!

I'm not hitting the database at this time, it is definitely in the control.
Sebastian
Top achievements
Rank 1
 answered on 07 Dec 2011
9 answers
675 views
See Article: http://www.telerik.com/support/kb/aspnet-ajax/window/adding-a-custom-button-to-radwindow-titlebar.aspx

I would like to know how to add a custom print button to RadWindow for WinForms.

For example how to implement a print button in my window titlebar. Some typical scenarios include implementing help or print button based on this functionality.

I would like to add buttons to the windows that I am using in a RadDock.  It it possible in WinForms?

Alexander
Telerik team
 answered on 07 Dec 2011
1 answer
208 views
Hello,

I would like that when I add some specific MDI child to the RadDock programatically it gets displayed int a new horizontal tab group instead of a new tab. Is this possible ? And how ?


Thank you.
Julian Benkov
Telerik team
 answered on 07 Dec 2011
3 answers
185 views
How do I focus control inside toolwindow on form load ?
Julian Benkov
Telerik team
 answered on 07 Dec 2011
2 answers
172 views
Hi,

I have few questions about how to create custom item in RadListView.

I have a list of objects and would like to create custom item for each of the object. The value of visualElements of each custom item will get from properties value of associated object.

By reading the online documents, I know that the custom visual item is created by caling VisualItemCreating event. But how can I trigger the event?

As I understand the function SynchronizeProperties() is used to assign values to visualElements when the custom visual items are created (please let me know if I am wrong). In the example code, the value assigned to custom visual item are from data table. But In my case I want to assign the value of properties of a object from the object list to each custom visual item. What steps I need to go through to achieve that?

Thanks a lot
Ivan Todorov
Telerik team
 answered on 06 Dec 2011
1 answer
111 views
Good morning.

i am working with the schedule and i am doing the next scenario.
i am making schedule from 8 am until 8pm with interval of five minuts between 8am - 8pm then the count the schedule are 144 more or less
and in the week are 864 but when i made click  in the button week in the control RadSchedulerNavigator and this control no show the information schedule just show the week but empty.. but when i change the next property of this control
(this.schScheduler.ActiveView as SchedulerDayViewBase).RangeFactor and put the value ScaleRange in five minuts the control is able to show the infomation but the problem is that is need a lot time to load de information more or less 6-7 minutos ..is take much time..to show the information, let me know what i can do.. to show the information in the week..or there other posibility
thanks for your help.
Elver Emilio
Ivan Todorov
Telerik team
 answered on 06 Dec 2011
3 answers
249 views
Hi, everyone,

I have been using telerik controls for windows for few months now, and this may be a stupid question. I've noticed that when a radgrid has been filtered or sorted, the SelectedRows property shows only one row selected even though more than one has been selected. I had a piece of code that uses that property so that on the edition of one row the value is copied to the other rows.

Here's a sample of my code:

Private Sub rgvContractDetails_CellEndEdit(sender As Object, e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles rgvContractDetails.CellEndEdit
   Try
 
      If rgvContractDetails.SelectedRows.Count > 1 Then
 
         Select Case e.Column.Name
            Case "Quantity"
               For Each Row As GridViewRowInfo In rgvContractDetails.SelectedRows
                  Dim oSelectedItem As SalesContractDetail = Row.DataBoundItem
                  Row.Cells("Quantity").Value = e.Value
                  oSelectedItem.QuantityStr = e.Value
                  oSelectedItem.CalculateBalance()
                  Row.Cells("QtyBalance").Value = oSelectedItem.BalanceStr
               Next
            Case "QtyCancel"
               For Each Row As GridViewRowInfo In rgvContractDetails.SelectedRows
                  Dim oSelectedItem As SalesContractDetail = Row.DataBoundItem
                  Row.Cells("QtyCancel").Value = e.Value
                  oSelectedItem.CancelStr = e.Value
                  oSelectedItem.CalculateBalance()
                  Row.Cells("QtyBalance").Value = oSelectedItem.BalanceStr
                  Row.Cells("CancelDate").Value = Today.ToShortDateString
               Next
      End If
 
   Catch ex As Exception
      MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
   End Try
End Sub


Is this the default behavior? If so, is there a workaround so that I can persist the selected rows programmatically and keep my code as it is?  I am using version 2011.02.712.

Thanks for your help,

Mauricio.
Alexander
Telerik team
 answered on 06 Dec 2011
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
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
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?