Telerik Forums
UI for WinForms Forum
4 answers
151 views
Hi Telerik Team 

I customize to inherit GridViewMultiComboBoxColumn, BaseGridBehavior and RadMultiColumnComboBox. Example MeGridBehavior (inherited form BaseGridBehavior), MeGridViewMultiComboBoxColumn(inherited form GridViewMultiComboBoxColumn)MeMultiColumnComboBox (inherited form RadMultiColumnComboBox), MeMultiColumnComboBoxElement (inherit RadMultiColumnComboBoxElement)

when init GridView i set this.GridBehavior = new MeGridBehavior(), if column is Combobox editor i create MeGridViewMultiComboBoxColumn column and i  override event  OnEditorRequired and CreateMultiColunmnComboboxElement ;

//On MeMultiColumnCombobox
protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement()
{
    return new MeMultiColumnComboBoxElement(this.Name,this);
}
 
// on GridView
protected override void OnEditorRequired(object sender, EditorRequiredEventArgs e)
{
    if (this.CurrentColumn is MeGridViewMultiComboBoxColumn)
    {
        var column = this.CurrentColumn as MeGridViewMultiComboBoxColumn;
      MeMultiColumnComboBox cbx= CreateDataComboBox("Countries");
      e.Editor = cbx.MeMultiColumnComboBoxElement;        
    }
}
 
protected override void OnCellValidating(object sender, CellValidatingEventArgs e)
{
    //if value not in list of countries ?
    var cbxCol = e.Column as MeGridViewMultiComboBoxColumn;
    var detectError = ComboBoxValidating(text, e);
    if (detectError)
    {
        e.Cancel = true;
        base.OnCellValidating(sender,e);
        ShowValidateError(); 
        return;
    
}


When i click to another cell it throw exeption on mouseup event of MeGridBehavior 

Unable to cast object of type 'MeMultiColumnComboBoxElement' to type 'Telerik.WinControls.UI.BaseGridEditor'.

   at Telerik.WinControls.UI.GridViewEditManager.EndEditCore(Boolean validate, Boolean cancel)
   at Telerik.WinControls.UI.GridViewEditManager.CloseEditor()
   at Telerik.WinControls.UI.RadGridViewElement.CloseEditor()
   at Telerik.WinControls.UI.GridRowBehavior.OnMouseUpLeft(MouseEventArgs e)
   at Telerik.WinControls.UI.GridRowBehavior.OnMouseUp(MouseEventArgs e)
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseUp(MouseEventArgs e)
   at ......OnMouseUp(MouseEventArgs e) in d:\\MeProject\GridView\MeGridViewBehavior.cs

This error throw when I update to telerik rad control winforms version Q3 2013  but it work with version Q1 2013

Any one can help me ! 
Thanks .
Le
Top achievements
Rank 1
 answered on 18 Jan 2014
5 answers
1.4K+ views
Hi, I have this old winforms application that I am updating.
I want the RadGridView I have just added to it to use a different theme than default, but whatever I do, nothing happens..

I tried setting the ThemeName on the grid to "TelerikMetro", I also tried;
ThemeResolutionService.ApplicationThemeName = "TelerikMetro";
That sounded like the right thing to do after googling a bit - didn't work either from Program.cs or main.cs (the form with the grid)

I just don't get it.. how the heck do you get themes to work?

I've added references to Telerik.WinControls, t.w.gridview, t.w.themes.telerikmetro,t.w.ui, t.w.ui.design, t.windows.controls, t.w.c.data, t.w.c.datavisualization, t.w.c.gridview

This is driving me off the edge at the moment :(

  // Regards, Morten
Dimitar
Telerik team
 answered on 17 Jan 2014
2 answers
1.3K+ views
Hello guys, I hope you are doing great.

I'm working on a WinForms project. One of the requirements is to drag files from the Desktop (or Windows Explorer) and drop them on a RadListView component. 

I set the AllowDrop and AllowDragDrop properties of the my listView object, and then I added the following events:

private void listView_DragEnter(object sender, DragEventArgs e)
{
    MessageBox.Show("DragEnter");
}
 
private void listView_DragDrop(object sender, DragEventArgs e)
{
    MessageBox.Show("DragDrop");
}

When I drag an item from the Desktop and enter the listView area, I get the "DragEnter" message. If I comment that code out, and then drop an item on the listView, I don't get the "DragDrop" message. 

My first question is: is it possible to achieve what I'm trying to do? And if it is possible, my second question is: what am I doing wrong?

I created a small test project to isolate the situation. The following is the complete code of the form class:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
 
namespace DragFromDesktop
{
    public partial class DragFromDesktopForm : Telerik.WinControls.UI.RadForm
    {
        public DragFromDesktopForm()
        {
            InitializeComponent();
        }
 
        private void DragFromDesktopForm_Load(object sender, EventArgs e)
        {
 
        }
 
        private void closeButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
        private void listView_DragEnter(object sender, DragEventArgs e)
        {
            //MessageBox.Show("DragEnter");
        }
 
        private void listView_DragDrop(object sender, DragEventArgs e)
        {
            MessageBox.Show("DragDrop");
        }
    }
}

I'm also attaching an example of how the form looks like. The big white square is the list view which I want to drop the items to.

Thanks in advance.

Best regards,

Alejandro
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Jan 2014
0 answers
75 views
I have a grid which has to be filtered programatically based on user entry. More than one column has to be filtered and each column may have more than 1 value to be filtered upon. Like say, Col1, Col2, Col7, Col8 has to be filtered on {1,4}, {1,38}, {78,65} & {1,0} respectively.

I have written the below code for this but looks like it filters only on the last set of values i.e. 4,38,65,0.

public static void SetGridFilterComposite(RadGridView gridView, Dictionary<string, List<int>> filterValues)
        {
            CompositeFilterDescriptor mainDescriptor = new CompositeFilterDescriptor();
            List<int> values = null;
 
            if (filterValues == null || filterValues.Count == 0) return;
 
            ClearGridFilterColumns(gridView);
 
            foreach (string column in filterValues.Keys)
            {
                CompositeFilterDescriptor columnDescriptor = new CompositeFilterDescriptor();
                if (gridView.Columns.Contains(column))
                {
                    values = filterValues[column];
                    FilterDescriptor filterDescriptor = new FilterDescriptor();
                    foreach (int value in values)
                    {
                        filterDescriptor.PropertyName = column;
                        filterDescriptor.Operator = FilterOperator.IsEqualTo;
                        filterDescriptor.Value = value;                       
                        columnDescriptor.FilterDescriptors.Add(filterDescriptor);
                    }
                    columnDescriptor.LogicalOperator = FilterLogicalOperator.Or;
                    mainDescriptor.FilterDescriptors.Add(columnDescriptor);
                }
            }
            mainDescriptor.LogicalOperator = FilterLogicalOperator.And;
            mainDescriptor.IsFilterEditor = true;
            gridView.FilterDescriptors.Add(mainDescriptor);
        }
Priyam
Top achievements
Rank 1
 asked on 16 Jan 2014
0 answers
81 views
avatar

Posted 9 hours ago (permalink)

hello, well I tested the demo of your product working with the listview control by the database
radlistview1.DataSource = dt
dt.Columns radlistview1.DisplayMember = (1). ToString


and post pictures in the ItemDataBound event to perfect the problem there is that I require key press selects the first item that Start with good lyrics that I hope your help thanks.


I tried this and nothing


For i = 0 To ViewVideos.Items.Count - 1
             If ViewVideos.Items (i). Text = "sauce" Then
                 ViewVideos.SelectedIndex = i

                 MsgBox (i)
             else
             End If
         Next

regards
John
Top achievements
Rank 1
 asked on 15 Jan 2014
8 answers
199 views
i am developing alarm system application using telerik 2012 q3  and i need your help in 2 questions :

1- how to convert database appointments  rows to appointments object without using rad scheduler
2- how can i select rows from appointment table before 1 hours from starting time(recurring appointments)

George
Telerik team
 answered on 15 Jan 2014
2 answers
190 views
I am working on a Winform program, and I can't believe there isn't an easier way to accomplish what I'm trying. 

Basically, I want to display an image that will always be 640x480.  Then, I want to have another control on top of it that is nothing more than a selection area that the user can change its size & location inside that 640x480 area, and it will report back its pixel size & x/y location. 

Short of drawing all of the lines by hand and adding grips by hand, I can't seem to find an easy way to do this.  Am I overlooking something? 
George
Telerik team
 answered on 15 Jan 2014
17 answers
301 views

Hi again... :-)

I have read the FAQ : Redistributing Telerik RadControls for WinForms

But have some doubts regarding it.

There are two approaches right ? One is to make a single EXE file by merging the assemblies and the EXE of the program. And the other is to merge the assemblies into a single assembly. Am I right ?

If I want to go for the second approach, from where should I get the ILMerge program ?

Thanks in advance..

PS: Special thanks to Richard Slade for the continuous help he had provided to me. Really appreciate it... :-)

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Jan 2014
0 answers
187 views
Hello,

I need to place buttons in the ribbon bar and I only want to show any image and text. I do not want the border or background although it may be nice to have some border show when the mouse is over the button and clicked. I have read about the visual style builder but this is too complicated for me. Has anyone done this and have a DLL for this already? I would even pay someone to do this for me if possible.

Thanks,

Warren
Warren
Top achievements
Rank 1
 asked on 15 Jan 2014
8 answers
80 views
hi sir/madam

I have a problem with using Progressbarelement in gridview; according your trainmen we can add progressbar to cells by cellformatting but when I create a click event for the Progressbarelement ; it's not fire; also I check MousDown and ...

But when use radbuttonelement there is no problem and fire well;

private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
    {
    .
    .
    .
 
    RadProgressBarElement ProgressBarOne = new RadProgressBarElement();
    ProgressBarOne.Click += new EventHandler(ProgressBarOne_Click);
    .
    .
    }
    void ProgressBarOne_Click(object sender, EventArgs e)
    {
        MessageBox.Show("somethings");
    }


thank you for helping
Hadilionson
Top achievements
Rank 1
 answered on 14 Jan 2014
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
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
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?