Telerik Forums
UI for WinForms Forum
5 answers
174 views
I have a telerik grid and wrote a function to allow searching all the Grid text columns, by specifying the filter type and input, the function changes all the text columns filter expressions.

It used to work very well on Q1, in Q2 everything changed.

Function is the following, I need to know how to set filter expressions programmatically in the right way in Q2.

private void SetFilter(GridKnownFunction filterFnType, string searchInput)
        {
            FilterExpression filter;
            string input = searchInput.Trim();
        
            if (!string.IsNullOrEmpty(input))
            {
               
                foreach (GridViewDataColumn column in this._GridTextColumns)
                {
   
filter = new FilterExpression(FilterExpression.BinaryOperation.OR, filterFnType, "@FilterEditor1");
  
filter.Parameters.Add("@FilterEditor1", input);
 
  
 column.FilterDescriptor = filter;
                    
                }
            }
            else
            {
                this.grid_Data.MasterTemplate.FilterDescriptors.Clear();
            }
        }
Rabeeh
Top achievements
Rank 2
 answered on 13 Oct 2010
4 answers
191 views
Hi Telerik

I want to know which ORMs do you support for rad grid view because i have problems with radgridview and Entity Framework
and do you support OpenAccess completely for radgridview?
I think radgridview only support typed dataset completely as ORM , is this true?

thanks alot
Julian Benkov
Telerik team
 answered on 13 Oct 2010
5 answers
342 views

Hi Telerik,

I think a circular waiting control will be a good feature to add.

thanks
Stefan
Telerik team
 answered on 13 Oct 2010
2 answers
320 views

Hi

I created my custom cell and column:

 Cell:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.WinControls.UI;
using System.Windows.Forms;
using System.Drawing;
using System.Diagnostics;
  
namespace GridViewUnboundMode
{
    public class EditableCheckBoxCellElement : GridDataCellElement
    {
        private RadCheckBoxElement _chk;
        private RadTextBoxElement _txtBox;
        private RadLabelElement _lbl;
  
        public EditableCheckBoxCellElement(GridViewColumn column, GridRowElement row)
            : base(column, row)
        {
        }
  
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
  
            _chk = new RadCheckBoxElement();
            _chk.Margin = new Padding(0, 2, 0, 0);
            _chk.MinSize = new Size(20, 20);
            _chk.Text = string.Empty;
            _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off;
            _chk.ToggleStateChanged += new StateChangedEventHandler(_chk_ToggleStateChanged);
  
            _txtBox = new RadTextBoxElement();
            _txtBox.Margin = new Padding(0, 2, 0, 0);
            _txtBox.MinSize = new Size(10, 20);
            _txtBox.Text = "sss";
  
            _lbl = new RadLabelElement();
            _lbl.Text = "Not assigned";
            _lbl.Margin = new Padding(0, 4, 0, 0);
            _lbl.MinSize = new Size(1, 20);
            _lbl.TextWrap = false;
            _lbl.Font = new Font(_lbl.Font.Name, _lbl.Font.Size, FontStyle.Italic);
            _lbl.ForeColor = Color.Gray;
  
            this.Children.Add(_chk);
            this.Children.Add(_lbl);
        }
  
        void _chk_ToggleStateChanged(object sender, StateChangedEventArgs args)
        {
            if (_chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                if (this.Children.Contains(_lbl))
                { this.Children.Remove(_lbl); }
                this.Children.Add(_txtBox);
            }
            else if (_chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.Off)
            {
                if (this.Children.Contains(_txtBox))
                { this.Children.Remove(_txtBox); }
                this.Children.Add(_lbl);
            }
        }
   
  
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            if (this.Children.Count == 2)
            {
                this.Children[0].Arrange(new RectangleF(0, 0, 20, 20));             
                this.Children[1].Arrange(new RectangleF(21, 0, finalSize.Width - 28, 20));
                if (this.Children[1] == _lbl)
                { _lbl.MinSize = new Size(Convert.ToInt32(finalSize.Width - 28), 20); }
            }
            return finalSize;
        }
  
        public override object Value
        {
            get
            {
                return _txtBox.Text;
            }
            set
            {
                _txtBox.Text = value.ToString();
            }
        }
  
        public bool IsChecked
        {
            get
            {
                return _chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On;
            }
            set
            {
                if (value)
                { _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On; }
                else
                { _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off; }
            }
        }
    }
}

 


 Column:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.WinControls.UI;
  
namespace GridViewUnboundMode
{
    public class EditableCheckBoxColumn : GridViewDataColumn
    {
        public EditableCheckBoxColumn(): base()
        {
        }
   
        public override Type GetCellType(GridViewRowInfo row)
        {
            if (row is GridViewDataRowInfo)
            {
                return typeof(EditableCheckBoxCellElement);
            }        
            return base.GetCellType(row);
        }
    }
}

 

When I create new row I do something like this:

private void btnAddNewRows_Click(object sender, EventArgs e)
{
    GridViewRowInfo rowInfo = this.radGridView1.Rows.AddNew();
    int columnIndex = 0;
    int rowIndex = rowInfo.Index;
    foreach (GridViewCellInfo cellInfo in rowInfo.Cells)
    {
        cellInfo.Value = string.Format("{0}-{1}", columnIndex, rowIndex);
        columnIndex++;
    }
}

 

The problem is that in this loop when I set GridViewCellInfo.Value to some value, property EditableCheckBoxCellElement.Value is not set to this value.


I also don`t know how to get access to EditableCheckBoxCellElement because I need to control property EditableCheckBoxCellElement.IsChecked.

 


How can I control values for controls that are inside my EditableCheckBoxCellElement?

 


Data binding is not an option in my case.

Regards

 

Raymond
Top achievements
Rank 1
 answered on 13 Oct 2010
1 answer
95 views
Hello, I can't find where to change colors for top group panel where you could drag columns to group grid. Could someone point me to right direction please?
beavisCZ
Top achievements
Rank 1
 answered on 13 Oct 2010
4 answers
251 views
Hi.

I have found an issue in RadGridView when using multiselect and menu.
What i want to do is: select multiple lines, right click on RadGridView and execute some action on each line.
Apparently no big deal, done it with this code:

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private RadMenuItem mnuAdd = new RadMenuItem("Add");
 
 
        private void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
        {
            e.ContextMenu.Items.Add(mnuAdd);
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            mnuAdd.Click += new EventHandler(mnuAdd_Click);
 
            radGridView1.Rows.AddNew().Tag = false;
            radGridView1.Rows.AddNew().Tag = false;
        }
 
        void mnuAdd_Click(object sender, EventArgs e)
        {
            foreach (GridViewRowInfo row in radGridView1.SelectedRows)
            {
                row.Tag = !((bool)row.Tag);
                row.Cells[0].Value = row.Tag;
            }
        }
    }
}

I only drag and drop a RadGridView control to my form,  changed MultiSelect property to true and added a column.
Now, when i select multi lines (or just one line) i right click and the menu show up with my menu (and others... but also no big deal). If i chose my menu, the row value change from false to true and from true for false. Simple.


The real problem is when i order the column. After that, if i select more than one row and i select my menu, it is thrown this exception:
"InvalidOperationException: Collection was modified; enumeration operation may not execute."

According my visual studio the error it is in the foreach iteration, more exactly in the "in":
foreach (GridViewRowInfo row in radGridView1.SelectedRows)


Ok... its a foreach problem. I try replace the foreach with a for statement:

for (int a = 0; a < radGridView1.SelectedRows.Count; a++)
{
    radGridView1.SelectedRows[a].Tag = !((bool)radGridView1.SelectedRows[a].Tag);
    radGridView1.SelectedRows[a].Cells[0].Value = radGridView1.SelectedRows[a].Tag;
}


With this solution, after i select both rows and right click and select my menu, i found out that radGridView1.SelectedRows only have one row, the one where i right click and is the only one that got changed.

Think this is one bug in RadGridView (or i am doing someting really wrong...).

I would like some help/answer.

Kind Regards,

Bruno Almeida
bruno
Top achievements
Rank 1
 answered on 13 Oct 2010
3 answers
226 views
hello to all

i m making a project in vb.net (window application)  using radcontrols(telerik) now i want to create setup of my project but problem is that project is working fine if radcontrol_winfrom .exe is install in conputer otherwise project is not working.
so what should i have to add in the setup.
Richard Slade
Top achievements
Rank 2
 answered on 13 Oct 2010
3 answers
328 views
I need that control but is not in Component.

Help me.

I must use it !!
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
1 answer
182 views
Hi,
maybe this is an ridiculous question, but I can't solve it...
I have a dropdownlist..and I setting the font size 12..then I'm running it and looks ugly like this link below:
bingung

I already tried change some property like dropdown height, etc...but doesn't solve the problem...
is there any solution??
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
2 answers
256 views
Hi,
Recently I have installed telerik 2010 controls for winform ,But after installing when i go to vs 2008 Ide , I cannot see the rad tabstrip control in tool box.
I tried to add all telerik dll to toolbox but still the tab strip control is not coming.

Please help me its very urgent.

Thanks,
Ajeesh
A2H
Top achievements
Rank 1
 answered on 13 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)
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?