Telerik Forums
UI for WinForms Forum
3 answers
147 views
Hi,

I'm using a GridView to display "Order Items".
Order Items can be arranged hierarchically by setting the Property "ParentOrderItemID" equal to the Property "OrderItemID" of the parent order item. Please not I can NOT use hierarchical grids.

What I want to do now is enabling custom sorting the following way:
If the User sorts by a certain attribute the sort algorithm must still keep together connected rows.

Say the grid has the following structure
[Order Item ID | Parent Order Item ID | Gross Value]

And the following values
[1 | null | 30]
  [2 | 1 | 20]
  [3 | 1 | 15]
[4 | null | 10]

If I now sort by "Gross Value", I want the sorted result to be:
[4 | null | 10]
[1 | null | 30]
  [3 | 1 | 15]
  [2 | 1 | 20]

How can I do it? I tried to use CustomSorting Event, but I'm stuck.

private void orderItems_grid_CustomSorting(object sender, GridViewCustomSortingEventArgs e)
       {
           if (this.orderItems_grid.SortDescriptors.Count == 0)
           {
               return;
           }
 
           int result = 0;
 
           SD_OrderItems item1 = e.Row1.DataBoundItem as SD_OrderItems;
           SD_OrderItems item2 = e.Row2.DataBoundItem as SD_OrderItems;
 
           for (int i = 0; i < this.orderItems_grid.SortDescriptors.Count; i++)
           {
               string cellValue1 = e.Row1.Cells[this.orderItems_grid.SortDescriptors[i].PropertyName].Value.ToString();
               string cellValue2 = e.Row2.Cells[this.orderItems_grid.SortDescriptors[i].PropertyName].Value.ToString();
 
               if (item1.ParentOrderItem.HasValue && item2.ParentOrderItem.HasValue)
               {
                   if (item1.ParentOrderItem.Value == item2.ParentOrderItem.Value)
                       result = cellValue1.CompareTo(cellValue2);
                   else
                       result = item1.ParentOrderItem.Value.CompareTo(item2.ParentOrderItem.Value);
               }
               else
               {
                   result = cellValue1.CompareTo(cellValue2);
               }
                
                
               if (result != 0)
               {
                   if (this.orderItems_grid.SortDescriptors[i].Direction == ListSortDirection.Descending)
                   {
                       result *= -1;
                   }
                   break;
               }
           }
           e.SortResult = result;
       }


Any help would be appreciated.

Thank you!
Stefan
Julian Benkov
Telerik team
 answered on 13 Jan 2011
4 answers
241 views
Hi,

I need this functionality in my application that when user is in edit mode in a cell and then leaves the cell, then next selected cell should not be in edit mode. Means leaving an editable cell should bring the grid out of editable mode no matter user leaves the editable cell by pressing right or left key or by using mouse . Can anyone help about it? Any help would be appreciated.

Thanks
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Jan 2011
3 answers
250 views
We'd like to have the ability to add icon overlays to appointments. I don't see this functionality documented anywhere, so I assume that its not implemented directly. So my next question's would be:

Are appointments drawn using their own individual OnDraw() ? If so, where do I look to grab the drawing rectangle and graphics handle for an appointment object. 

If they are drawn on the schedule using the GDI graphics object of the scheduler grid, is there and accessible collection of rects for the current view, or would the control have to be extended manually. Obviously the latter option would be a last resort, since the layout logic would be a lot of work.

I know I could look at the source and find this out on my own, but where is the fun in that.

Thanks,
Chris
Richard Slade
Top achievements
Rank 2
 answered on 12 Jan 2011
1 answer
124 views

Hello,

I have created a custom theme for an application and I would like to know how I can theme the ExplorerBar view mode.

While exporting the premade theme “ControlDefault” as example, I only find these files in my directory:

  • -        ControlDefault_RadPageView_Telerik_WinControls_RootRadElement.xml
  • -        ControlDefault_RadPageView_Telerik_WinControls_UI_RadPageViewOutlookElement.xml
  • -        ControlDefault_RadPageView_Telerik_WinControls_UI_RadPageViewStackElement.xml
  • -        ControlDefault_RadPageView_Telerik_WinControls_UI_RadPageViewStripElement.xml


I am trying to create by myself the missing one (“_RadPageViewExplorerBarElement.xml”), but I fails in this task.


Can you please provide me this xml as example?


I am currently working in version 2010_2_10_914 (Q2SP2).

Thank you.

Stefan
Telerik team
 answered on 12 Jan 2011
5 answers
308 views
Hi,
    I am using winform - gridview, 
    In this i used combobox column, i bounded  Itemname and Itemid  columns from the itemmaster table, Itemname as display member and Itemid as value member, i got Combobox with bounded the table values, but when i selected  the item name and swich to the next column it gets disapper. i need to retain the selected text in the combo text.
( Note: I am using empty Grid with no datasource, whenever I click the add new  button all the combo boxes will bound, when i  change the combo remaining columns gets the corrsponding values.)

Thanks & Regards,
S.Lalitha


Alexander
Telerik team
 answered on 12 Jan 2011
1 answer
102 views
Hi:

I found this code in your page for assign shortcuts on buttons and controls differents to radmenuitem:

Me.RadButton1.ButtonElement.Shortcuts.Add(New RadShortcut(Keys.Control, Keys.B))

The problem is when I write Me.RadButton1.ButtonElement. the word Shortcuts isn´t in the list. Also, appears the following error:

Shortcuts aren´t a member of Telerik.Wincontrols.UI.RadButtonElement

Thanks.
Nikolay
Telerik team
 answered on 12 Jan 2011
3 answers
206 views
I am using Dock and RibbonBar (Q2 2009 release) to design a UI. I have the Dock control set to AutoDetectMdiChildren, and can easily add forms as tabbed documents. What I would like to do is change the active RibbonTab based on the active child form in Dock so that the commands match the active document.

I thought this would be relatively easy to do, but I seem to be stuck.
I have implemented an event handler for the ActiveWindowChanged event of the Dock control. I can obviously gain access to the DockWindow via the DockWindowEventArgs parameter. What I haven't been able to do is determine the type of form that the DockWindow represents. Basically what I would like to be able to do is something like this:

if (DockWindow is SettingsForm) 
  // Change to appropriate RadRibbonTab 
else 
 // do something else 

It seems like there should be a way of doing something like this without having to iterate over the MdiChildren array and I would be at all surprised if I am looking at this the wrong way.
Nikolay
Telerik team
 answered on 12 Jan 2011
8 answers
187 views
I'm trying to inherit from a base form with a telerik grid. The grid's modifier is set to protected. On the inheriting form, the grid appears but completely disables as if it's modifier is Privet (it's not). Other controls (Microsoft + Telerik) are not showing this behaviour. They are working properly when their modifier is set to protected.

Kindly help me in this regard.
Richard Slade
Top achievements
Rank 2
 answered on 12 Jan 2011
14 answers
337 views

 

Hi There,

I have a project that I have currently started to rebuild with the latest version of the telerik controls that seems to behave differently than the initial project did with version 2009 Q2. Basically I have a grid that has 3 child tabs for each row using this example:

Main Grid

User Information
--HR Data  --Security Group Membership  --Users who report to this person


the problem is HR Data always has information in the sub tab, however Security and / or Users who report might not.

the problem that I am getting now is that in the previous version of the gird I would see the child row with the headers and no information below so for instance:

HR - DATA
Full Name        Phone                Home Address
first last          555-111-222        example lane

Security Group
GroupName     GroupOwner        GroupType

the problem is now if there is no data for Security group the tab is now displayed as such:

HR - DATA
Full Name        Phone                Home Address
first last          555-111-222        example lane

Security Group
Full Name        Phone                Home Address
first last          555-111-222        example lane


If there is no data in the child tab grid, can I hide that tab or is it possible to set where I still see the column headers without any data in the grid.

thanks!

Jonathan

Jack
Telerik team
 answered on 12 Jan 2011
9 answers
480 views
For some reason, I get a StackOverflow exception when the command bar is on my dialog and from the parent form I call

dlg.ShowDialog(this);

I've created a base dialog from which other's are derived.  All of them behave fine; however this one fails every single time .ShowDialog() is called.
Ivan Todorov
Telerik team
 answered on 12 Jan 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)
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
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
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
NavigationView
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
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
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?