Telerik Forums
UI for WinForms Forum
1 answer
137 views

Simple code

new System.Threading.Thread(delegate ()
{               
   
  var grid = new RadGridView();
  grid.Columns.Add("column");
  grid.Rows.Add(new Object[] { "value1" });
  grid.Dock = System.Windows.Forms.DockStyle.Fill;
 
  var form = new RadForm();
  form.Controls.Add(grid);
  form.ShowDialog();
 
}).Start();

 

When i try right click + copy on cell i got error:

Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Aug 2017
1 answer
87 views

Hey, 

 

I need help with Drag 'n Drop MultiLines from GridView to ListView.

Everything works, but I have to press Shift or Ctrl to drag more than one line.

If I drag without holding the key, only I line drags.

 

Is there any solutions for this?

 

Best regards

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Aug 2017
5 answers
173 views
If i paste hungarian characters into a cell of a radGridView, it changes some of them to codes.

Example: Árvíztűrő tükörfúrógép --> Árvíztűrő tükörfúrógép

The example above contains all the non standard letters of the hungarian language. I don't understand that it handles ű and ő correctly but none of the others (á,í,ü,ö,ú,ó,é)
We use Visual Studio 2015 Version 14.0.25123.00 Update 2 and Telerik WinForms 2017.2.629.0
Could you please help me?
Hristo
Telerik team
 answered on 18 Aug 2017
5 answers
162 views
I am trying to identify when these events are fired, so that when someone use default context menu to add/delete/edit, I can respond in a different manner than simply anytime a node is added/deleted/edited.
Dimitar
Telerik team
 answered on 18 Aug 2017
1 answer
168 views

Hi there,

I've tried to make an outlook inspired form using the RibbonBar but am not able to get the colours correct. Please see Picture 1 for how I want it to look and Picture 2 of how it actually looks.

I've tried going through each element via the 'Edit UI Elements' on the RibbonBar and haven't been able to find the element that controls this.

Any help will be appreciated.

Thanks,

Ray

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Aug 2017
1 answer
121 views

hi. 

I have 3 tables that structure showed in attached picture and I want to create the manual hierarchy. for this goal I do this steps  :

1. add column to master and child's template from designer and set "FieldName" property to table file name

2. add GridVew relation from for these master/child template.

3. in the button event click, load tables and set GridView DataSource & child template DataSource from entity framwork:

 using (var entity = new VaccinationEntities())
            {
                radGridView1.DataSource = entity.Patients.ToList();
                childTemplate1.DataSource = entity.ChildVaccinations.ToList();
                childTemplate2.DataSource = entity.ProblemBackgrounds.ToList();
            }

but after load data just master template showed in GridView without child template.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Aug 2017
3 answers
61 views
This happens when the control is loaded and bound to a datasource that contains this information, or when a new node is added with these values.  I understand why this logically would cause an error, but having a check in the control, to prevent an application crashing exception would be useful.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Aug 2017
1 answer
122 views

Hi,

I have an eventhandler for the GraphicalViewItemFormatting event so I can change the look&feel of the items in the ganttview according to the contents. Now I also want to make it more clear which item is selected. Unfortunately I seem to be doing something wrong. 

 

In the handler I have this part that should draw the border in red:

private void GanttViewElement_GraphicalViewItemFormatting(object sender, Telerik.WinControls.UI.GanttViewGraphicalViewItemFormattingEventArgs e)
{

if (e.ItemElement.Selected)
            {                
                e.ItemElement.TaskElement.BorderColor = Color.Red;
                e.ItemElement.TaskElement.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders;
                e.ItemElement.TaskElement.BorderWidth = 6;
                e.ItemElement.TaskElement.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
                e.ItemElement.TaskElement.DrawBorder = true;
                
            }

}

 

But the border keeps working in the standard way. There is only a slight difference between selected and non-selected items.

What part am I missing?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Aug 2017
12 answers
683 views
I have two GridViews: radGridView1, radGridViewPreview
I want drag items from radGridView1 and drop to radGridViewPreview
also do the same drag & drop items within radGridViewPreview
I am able to drag & drop one item from one GridView to the other or within the same GridView with the following code.
However, I am not able to get multiple-rows drag & drop work. Please help. thanks
void initialize()   //this is
{

SetupDragDrop(radGridViewPreview);

SetupDragDrop(radGridView1);

}
        private void SetupDragDrop(RadGridView grid)
        {
            grid.MultiSelect = true;
            //handle drag and drop events for the grid through the DragDrop service
            var svc = grid.GridViewElement.GetService<RadDragDropService>();
            svc.PreviewDragStart += svc_PreviewDragStart;
            svc.PreviewDragDrop += SvcPreviewDragDrop;
            svc.PreviewDragOver += svc_PreviewDragOver;
            //register the custom row selection behavior
            grid.GridBehavior = new CustomGridBehavior();
        }

        private void svc_PreviewDragStart(object sender, PreviewDragStartEventArgs e)
        {
            e.CanStart = true;
        }
 
        private void SvcPreviewDragDrop(object sender, RadDropEventArgs e)
        {
            var rowElement = e.DragInstance as GridDataRowElement;

            if (rowElement == null)
            {
                return;
            }
            e.Handled = true;

            var dropTarget = e.HitTarget as RadItem;
            var targetGrid = dropTarget.ElementTree.Control as RadGridView;
            if (targetGrid == null || targetGrid == radGridView1)
            {
                return;
            }

            var dragGrid = rowElement.ElementTree.Control as RadGridView;

            //Grab every selected row from the source grid, including the current row
            List<GridViewRowInfo> dragRows = dragGrid.SelectedRows.ToList<GridViewRowInfo>();
            if (dragGrid.CurrentRow != null)
            {
                GridViewRowInfo row = dragGrid.CurrentRow;
                if (!dragRows.Contains(row)) dragRows.Add(row);
            }

            var dropTargetRow = dropTarget as GridDataRowElement;
            int indexToMoveTo = targetGrid.RowCount;
            if (dropTargetRow != null) indexToMoveTo = GetTargetRowIndex(dropTargetRow, e.DropLocation);
            if (targetGrid != dragGrid)
            {
                e.Handled = true;
                MoveRows(targetGrid, dragGrid, dragRows, indexToMoveTo);
            }
            else
            {
                MoveRowsWithinGrid(targetGrid, dragRows, indexToMoveTo);
            }
        }
  
  private void svc_PreviewDragOver(object sender, RadDragOverEventArgs e)
        {
            if (e.DragInstance is GridDataRowElement || e.DragInstance is ListViewDataItem)
            {
                e.CanDrop = e.HitTarget is GridDataRowElement || e.HitTarget is GridTableElement || e.HitTarget is GridSummaryRowElement;
            }
        }
  
 public class CustomGridBehavior : BaseGridBehavior
    {
        List<GridViewRowInfo> selectedRows = new List<GridViewRowInfo>();

        public List<GridViewRowInfo> SelectedRows
        {
            get { return selectedRows; }
        }

        public override bool OnMouseDown(MouseEventArgs e)
        {
            selectedRows.Clear();
            bool result = base.OnMouseDown(e);
   selectedRows.AddRange(this.GridControl.SelectedRows);
            return result;
        }
    }

 

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Aug 2017
1 answer
128 views

Hello all together!

 

I am currently experiencing the below issues with RadTrackBar.

 

TrackBar.Minimum is set to 50.

TrackBar.Maximum is set to 150.

TrackBar.Value is set to 100.

 

I guess, everybody should now expect the track bar to move the knob in the exact middle of the control. But it simply doesn't. When looking at the track bar's minimum, maximum and value properties during FormLoad event, I discovered that the minimum changed to 19.

What I did next was searching for the number in the designer class of the respective form, assuming that Visual Studio somehow messed it up as it is always doing from time to time. But nothing found here. Setting the minimum value again in FormLoad fixes the problem, but this should not be the default approach when working with a RadTrackBar. So this must be a bug, right?

Dimitar
Telerik team
 answered on 17 Aug 2017
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
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?