Telerik Forums
UI for WinForms Forum
2 answers
218 views

How can you group off one column but sort on another column through code??

I have one column that has the group name "string" lets say 'ROOM' but the order they need to be displayed is an int lets say "Room Order" so I have data like

Bedroom, 2,  'Some Info1'
Bedroom, 2,  'Some Info2'
Bedroom, 2,  'Some Info3'
Kitchen, 1, 'Some Info1'
Kitchen, 1, 'Some Info2'
Kitchen, 1, 'Some Info3'
Bathroom, 3, 'Some Info1'
Bathroom, 3, 'Some Info2'

I want to group off of the ROOM column but sort offer the Room Order column, however, once I group it always sorts off the group column, in this example ROOM

I have tried bringing in the data already sorted it does help. I have also tried following code:

Me

 

.gvRoomNights.Columns("ROOM_SORT_ORDER_SITE").Sort(RadSortOrder.Ascending, True)

 

 

 

Dim expression As New GridGroupByExpression("[ROOM_POOL_CD] as [Room Pool] Group By [Room Pool]")

 

 

'Dim expression2 As New GridSortField("[ROOM_SORT_ORDER_SITE]")

 

gvRoomNights.EnableSorting =

True

 

gvRoomNights.MasterTemplate.EnableSorting =

True

 

gvRoomNights.MasterTemplate.GroupDescriptors.Add(expression)

 

Me.gvRoomNights.Columns("ROOM_SORT_ORDER_SITE").Sort(RadSortOrder.Ascending, True)

 

 

'gvRoomNights.MasterTemplate.SortDescriptors.Add(expression2)

 

gvRoomNights.Columns(

"ROOM_POOL_CD").Width = 60

I guess I could group by the ROOM SORT ORDER but I need to change the Groups HEader text to the actual room name. If you can show me that I would be able to get around this. Thanks.

 


Eric
Emanuel Varga
Top achievements
Rank 1
 answered on 05 Oct 2010
3 answers
135 views
Does anyone have an example of how to use a MultiColumnComboBox with RadControls for WinForms 2010 Q2?  I can't seem to find an example in the demos that came with it and I'm not able to get it working.  My code is posted below.  Basically my grid (the comboelement if I'm reading correctly) never displays.  The first value in the datatable displays in the text box but no grid shows up.  I can press the down arrow and the value changes but still never displays.  Can anyone help me?

 

 

 

//set up data

 

 

 

Data objData = new Data();

 

 

DataTable dtCarriers = objData.GetCarriers();

 

bindingSource1.DataSource = dtCarriers;

 

 

//setup drop down grid display options

 

rmccbCarrier.AutoSizeDropDownToBestFit =

true;

 

rmccbCarrier.DisplayMember =

"CARRIER_CODE";

 

 

RadMultiColumnComboBoxElement multiColumnComboElement = this.rmccbCarrier.MultiColumnComboBoxElement;

 

multiColumnComboElement.DropDownSizingMode =

SizingMode.UpDownAndRightBottom;

 

multiColumnComboElement.DropDownMinSize =

new Size(420, 300);

 

 

this.rmccbCarrier.MultiColumnComboBoxElement.AutoCompleteMode = AutoCompleteMode.None;

 

 

this.rmccbCarrier.DropDownStyle = RadDropDownStyle.DropDown;

 

 

FilterDescriptor descriptor = new FilterDescriptor(this.rmccbCarrier.DisplayMember, FilterOperator.StartsWith, string.Empty);

 

 

this.rmccbCarrier.EditorControl.FilterDescriptors.Add(descriptor);

 

 

this.rmccbCarrier.DropDownStyle = RadDropDownStyle.DropDown;

 

rmccbCarrier.AutoFilter =

true;

 

rmccbCarrier.MultiColumnComboBoxElement.AutoCompleteMode =

AutoCompleteMode.None;

 

Svett
Telerik team
 answered on 05 Oct 2010
2 answers
117 views
I need to set an usercontrol which I've developed in the place of GridView column. For example, for a GridViewTextBoxColumn I coded something like this:
GridViewTextBoxColumn columnName = new GridViewTextBoxColumn();
columnName.HeaderText = "Phone";
columnName.Width = 120;

But now, I'd like to create an GridViewColumn as my UserControl type, something like:
GridViewMyUserControlColumn columnName= new GridViewMyUserControlColumn();
columnName.HeaderText = "Phone";
columnName.Width = 120;

I know that sentence is incorrect but I need to know how I can to set my user control as a GridView column, well, in case of that is possible... Thank you.
Julian Benkov
Telerik team
 answered on 05 Oct 2010
6 answers
89 views

Hi!

  1. Run demo application from "RadControls for WinForms Q2 2010 SP2"
  2. Select GridView -> Hierarchy -> Folder Tree
  3. Expand “Program Files” folder – everything is ok.
  4. Expand “My Documents” folder - ok.
  5. Collapse “Program Files” folder – folder is collapsed but icon on “My Documents” folder is changed from “-“to “+”! It might be very misleading to the user.

 

Is there any workaround?

Regards

Martin Vasilev
Telerik team
 answered on 05 Oct 2010
1 answer
112 views
I'm attempting to clear the items from an existing RadRotator, and replace them with new ones.  Does anyone know if the example below the correct way to do this, or what the best way would be?  Any help would be greatly appreciated.  Thank you!

// add first image to rotator
RadImageItem image = new RadImageItem();
image.Image = Image.FromStream(imageBuffer);
radRotator1.Items.Add(image);

// clear existing items so we can add new ones
radRotator1.Items.Clear();

// add a differrent image to the rotator
RadImageItem image2 = new RadImageItem();
image2.Image = Image.FromStream(imageBuffer2);
radRotator1.Items.Add(image2);
radRotator1.Items.
Peter
Telerik team
 answered on 05 Oct 2010
4 answers
122 views
Hi! 
I am trying to implement GridViewComboBoxColumn on gridview for existing"DEPARTMENT_ID"
colum.
I tried below and it works fine, but it is adding another column on the gridview instead of replacing existing "DEPARTMENT_ID" column.
1. What should I change?
2. What property will remove a scroll bar on GridViewComboBoxColumn?

 
 With Me.rgvEmployee
            .Columns("EMP_ID").HeaderText = "EMP ID"

            Dim deptComboboxColumn As GridViewComboBoxColumn = New GridViewComboBoxColumn
            With deptComboboxColumn
                .UniqueName = "DeptColumn"
                .HeaderText = "Dept"
                .DataSource = From q In db.MST_DEPARTMENT _
                              Select q.DEPARTMENT_ID, q.DEPARTMENT_NM
                .ValueMember = "DEPARTMENT_ID"
                .DisplayMember = "DEPARTMENT_NM"
                .FieldName = "DEPARTMENT_ID"
                .Width = 200
            End With
            Me.rgvEmployee.Columns.Add(deptComboboxColumn)

        End With
Won
Top achievements
Rank 1
 answered on 05 Oct 2010
3 answers
152 views
Hi,

Can we implement such a window:

1. The window has menu and toolbar;
2. The client area of the window is a grid.
3. There is a 'toggle view' button in the toolbar, which toggles the grid view between Grid (List) view and Detail (single record) view. That is to say, users can select any row of the grid, and toggle to Detail (single record) view; and vice versa.

Any suggestions will be appreciated much!

Regards,
James
Jack
Telerik team
 answered on 05 Oct 2010
2 answers
91 views
Hello room!

I have send 1 image (grid_group). I want create 1 that radGridView.

Help me!

Thank you All!
Jack
Telerik team
 answered on 05 Oct 2010
6 answers
182 views
*edit* Forgot to title the post properly! Should be "Hierarchy with multiple child datasources" Feel free to correct this admins!

I've got a code defined hierarchy to work fine in C#, with a RadGridView with a datasource etc and then defined a template with a relation and a datasource for the child rows and assigned these to the RadGridView.

This works fine and the '+' expands and shows the child rows.

What I want to do though is have the expanded child row be from a different datasource depending on some value in the parent. Ie what expands has different columns depending on the parent row.

I can't seem to specify more than one datasource for the childrows.
What I want to see is:

AAA BBB CCC                      (Parent row)
--d e f                                    (Expanded child row)
AAA2 BBB2 CCC2                 (Parent row)
--g h i                                     (Expanded child, different columns/datasource to the other child row)

The parent rows have the same columns/datasource.
The child rows have different columns/datasource.

Is this possible and can both different child rows be expanded at the same time?
Julian Benkov
Telerik team
 answered on 05 Oct 2010
4 answers
132 views
We're currently evaluating your grid (which is great by the way) and I have a few questions regarding hierarchies:

1. Is it possible to remove (or at least reduce the size of) the border around child grids? The default one has a thick blue border which is eating up a lot of screen space.

2. Rows in the grid are typically highlighted when you move the mouse over them, but the last row hovered over in a child grid stays highlighted when you move the mouse down and out of the child grid. It's not such a big issue, but if that row has the background colour changed for business reasons, the highlight remains which hides the background colour. If you move the mouse up and over the child column headers first the highlight is removed as normal. Is this a bug?

3. Am I missing something or is there no way to bind hierarchies of business objects with self contained collections? For example, I have a collection property on my view model called Customers. This model works great in your WPF grid, but for the WinForms case I had to create two separate collections in the view model for customers and orders, add a CustomerKey property to the Order class and then specify a GridViewRelation between them.

public class Customer
{
    public int CustomerKey { get; set; }
    public string Name { get; set; }
    public IList<Order> Orders { get; set; }
}
 
public class Order
{
    public int OrderKey { get; set; }
    public decimal Price { get; set; }
}
Alexander
Telerik team
 answered on 05 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
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?