Telerik Forums
UI for WinForms Forum
4 answers
180 views

Hi

My layoutgrid is 2 columns, 4 rows and Im seeing the control ignoring both width and  ProportionalHeightWeight settings I set. 

Rather than 20:80 I'm seeing 50:50 for columns, rather than 10:10:70:10 for rows I'm seeing 25:25:25:25.

What am I missing please?

001.private void CreateElements()
002.{
003.  _layoutPanel = new GridLayout();
004.  _layoutPanel.Columns.Clear();
005.  _layoutPanel.Rows.Clear();
006. 
007.  //add columns
008.  _layoutPanel.Columns.Add(new GridLayoutColumn()
009.  {
010.    SizingType = GridLayoutSizingType.Proportional,
011.    ProportionalWidthWeight = 20
012.  });
013.  _layoutPanel.Columns.Add(new GridLayoutColumn()
014.  {
015.    SizingType = GridLayoutSizingType.Proportional,
016.    ProportionalWidthWeight = 80
017.  });
018. 
019.  // Add rows
020.  CreateTitleRow();
021.  CreateImageRow();
022.  CreateTimeRow();
023.  CreateBeginRow();
024. 
025.  // Add rows to the layout
026.  _layoutPanel.Rows.Add(_titleRow);
027.  _layoutPanel.Rows.Add(_imageRow);
028.  _layoutPanel.Rows.Add(_timeRow);
029.  _layoutPanel.Rows.Add(_beginRow);
030. 
031.  // Add items to the panel
032.  _layoutPanel.Children.Add(_planTitle);
033.  _layoutPanel.Children.Add(_planImage);
034.  _layoutPanel.Children.Add(_totalTime);
035.  _layoutPanel.Children.Add(_beginButton);
036. 
037.  // Add layout panel to children
038.  Children.Add(_layoutPanel);
039.}
040. 
041.private void CreateTitleRow()
042.{
043.  _titleRow = new GridLayoutRow();
044.  _titleRow.SizingType = GridLayoutSizingType.Proportional;
045.  _titleRow.ProportionalHeightWeight = 10;
046. 
047.  // Set the title of the plan 0,0
048.  _planTitle = new LightVisualElement();
049.  _planTitle.SetValue(GridLayout.ColSpanProperty, 2);
050.  _planTitle.SetValue(GridLayout.ColumnIndexProperty, 0);
051.  _planTitle.SetValue(GridLayout.RowIndexProperty, 0);
052.  _planTitle.AutoEllipsis = true;
053.  _planTitle.TextAlignment = ContentAlignment.MiddleLeft;
054.  _planTitle.Text = _wplan == null ? "Free" : string.Format("{0} {1}", _index, _wplan.PlanName);
055.}// function
056. 
057.private void CreateImageRow()
058.{
059.  _imageRow = new GridLayoutRow();
060.  _imageRow.SizingType = GridLayoutSizingType.Proportional;
061.  _imageRow.ProportionalHeightWeight = 70;
062. 
063.  // Image 0,1
064.  _planImage = new LightVisualElement();
065.  _planImage.SetValue(GridLayout.ColSpanProperty, 2);
066.  _planImage.SetValue(GridLayout.ColumnIndexProperty, 0);
067.  _planImage.SetValue(GridLayout.RowIndexProperty, 1);
068.  _planImage.BackgroundImageLayout = ImageLayout.Stretch;
069.  _planImage.BackgroundImage = _backImage;
070.}// function
071. 
072.private void CreateTimeRow()
073.{
074.  _timeRow = new GridLayoutRow();
075.  _timeRow.SizingType = GridLayoutSizingType.Proportional;
076.  _timeRow.ProportionalHeightWeight = 10;
077. 
078.  // Total time 0,2 and 1,2
079.  _totalTime = new LightVisualElement();
080.  _totalTime.AutoEllipsis = true;
081.  _totalTime.SetValue(GridLayout.ColumnIndexProperty, 1);
082.  _totalTime.SetValue(GridLayout.RowIndexProperty, 2);
083.  _totalTime.Text = _wplan == null ? "-hr -mins" : _wplan.CreationDate.ToLongDateString();
084.}// function
085. 
086. 
087.private void CreateBeginRow()
088.{
089.  _beginRow = new GridLayoutRow();
090.  _beginRow.SizingType = GridLayoutSizingType.Proportional;
091.  _beginRow.ProportionalHeightWeight = 10;
092. 
093.  // Begin button 0,3
094.  _beginButton = new LightVisualElement();
095.  _beginButton.SetValue(GridLayout.ColSpanProperty, 2);
096.  _beginButton.SetValue(GridLayout.ColumnIndexProperty, 0);
097.  _beginButton.SetValue(GridLayout.RowIndexProperty, 3);
098.  _beginButton.AutoEllipsis = true;
099.  _beginButton.Text = "Begin Workout";
100.}// function
Hristo
Telerik team
 answered on 11 Jul 2016
5 answers
176 views

I have the next problem:

 

I have a radgridview with data, but i need sum rows of the same column and i use the next code: (vb.net)

 

 Dim summaryItem As New GridViewSummaryItem()
        summaryItem.Name = "column6"
        summaryItem.AggregateExpression = "(Sum(column6))"
        Dim summaryRowItem As New GridViewSummaryRowItem()
        summaryRowItem.Add(summaryItem)
        Me.RadGridView1.SummaryRowsTop.Add(summaryRowItem)

 

but i dont know in what event is correctly put it.

 

I put it in a function but the SummaryRowsTop is repeated as many times as entry records. 

i need only one SummaryRowsTop 

 

Hristo
Telerik team
 answered on 11 Jul 2016
7 answers
329 views
Hi,

Can I create or extend radMultiColumnComboBox to add a new section below the bottom of the grid, which includes one or more buttons (e.g. New)? After clicking the button(s), a new modal dialog/window will popup, while the MultiColumn Combobox will be kept open (dropped-down list).

Any suggestions or instructions will be very helpful. Thanks!

Regards,
James
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 11 Jul 2016
3 answers
372 views

The attached pic is (touched up) what my designer has asked me to produce for our first rewrite of our product. We've moved to telerik control set from an in house one which is looking dated. The 2nd one is my first attempt.
I've googled for an answer and seen several responses to people wanting to drop the space between tiles, or for ASP css, but in my case where the tiles are created and added to the panorama dynamically, they're all joined together and however much I've played with margins and padding I don't seem to be able to get a space around them.
Can anybody tell me how to do this very simple thing please?

Dimitar
Telerik team
 answered on 08 Jul 2016
17 answers
410 views

Good Afternoon,

 I've recently downloaded the latest trial release of WinForms UI controls and our code to set a custom contextmenustrip on a Grid view no longer works.

 We need to do this programatically, based on the row being clicked as below:

 

Private Sub radGrdHistory_ContextMenuOpening(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs) Handles radGrdHistory.ContextMenuOpening
    If TypeOf e.ContextMenuProvider Is Telerik.WinControls.UI.GridHeaderCellElement Or TypeOf e.ContextMenuProvider Is Telerik.WinControls.UI.GridFilterCellElement Then
        radGrdHistory.ContextMenuStrip = Nothing
    Else
        BuildAppointmentTypeRightClickMenu()
        radGrdHistory.ContextMenuStrip = cmsAppointment
    End If
End Sub

 

 Using the Q1 2014 version this correctly showed our cmsAppointment contextmenustrip when rightclicking a grid element but this no longer occurs. I just see a context menu with 'Copy' and nothing else.

 All the reading on the docs just says to use the ContextMenu properly and doesn't say anything about ContextMenuStrip. Has support been discontinued for this? Do I need to change all my contextmenustrips to contextmenus? Or do I need to write the code to show the CMS manually (say, off a right click event?).

 

 

 

Josef
Top achievements
Rank 1
 answered on 08 Jul 2016
2 answers
169 views

Hi. This is my first encounter with the Telerik control set.

As I don't have a clue yet, I'm amending a code fragment I found online to create a custom RadTileElement for my needs.

I'm passing in a database record to a constructor. I've then overridden the CreateChildElements method to map out the grid and set the strings etc according to whatever's passed in. But I noticed, when stepping through the code, that CreateChildElements was being called before my parameterized constructor.

Am I correct in assuming that the base constructor is calling a virtual method?

If the child elements are created before my constructor gets it's turn to set up the control then is there a better way to handle this?

ty in advance

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Jul 2016
1 answer
130 views

I need to show something different that Text in ToolTip.

How to get other property like Id, Start, End etc (binded row)... connected with GanttViewTaskElement?

 

private void GanttView_ToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e)
{
  if(sender.GetType() == typeof(Telerik.WinControls.UI.GanttViewTaskElement))
  {
    var task = (Telerik.WinControls.UI.GanttViewTaskElement)sender;
    //e.ToolTipText = task.Id.Text.ToString();
  }
}

 

Hristo
Telerik team
 answered on 07 Jul 2016
5 answers
316 views

Hello, i have this, were working using microsoft grid, how can i make it work with the winforms grid?

When i try to add a new row raise an exception like 'System.MissingMethodException' no parameterless constructor.

[Serializable]
public class ScheduledMovement : NotifyPropertyChanged
{
    //various props
    public excMovements Movements
      {get;set;}
    //other
}
 
public class excMovements :
  BindingList<ScheduledMovementDetail>, IBindingList
{
  protected override object AddNewCore()
  {
      ScheduledMovementDetail n = new ScheduledMovementDetail(parent);
      Add(n);
      return n;
   }
}

Dimitar
Telerik team
 answered on 07 Jul 2016
1 answer
128 views

Hi,

 

I've been trying to figure out how to get my radgridview to colour/put a border around the selected cell only when the user clicks on it. At the moment, using the following code, the grid draws horizontal borders on the selected row when a cell is selected (image attached).

 

    Private Sub gridView_CellFormatting(sender As Object, e As CellFormattingEventArgs) Handles gridView.CellFormatting

        If Not e.CellElement.IsCurrent AndAlso
            e.CellElement.RowInfo.IsCurrent Then
            e.CellElement.BorderColor = Color.FromArgb(208, 215, 229)
        Else
            e.CellElement.ResetValue(LightVisualElement.BorderColorProperty, ValueResetFlags.Local)
        End If

    End Sub

    Private Sub gridView_RowFormatting(sender As Object, e As RowFormattingEventArgs) Handles gridView.RowFormatting

        e.RowElement.DrawFill = False
        e.RowElement.DrawBorder = False

    End Sub

 

How can I get those lines above and below the row to go away?

Thanks for your help.

Mary
Top achievements
Rank 1
 answered on 06 Jul 2016
0 answers
90 views

Hello.
after applying localization for RadReminder, returned value for reminder in "Appointment Form" limited and after reopened the form, reminder value changed to hours.
for example "5 minutes" changed to "5 hours".
applied culture is set to "fa-IR".

Thank you.

Raminmjj
Top achievements
Rank 1
 asked on 05 Jul 2016
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
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
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
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?