Add a GridViewCheckBoxColumn to the GridView and set its EnableHeaderCheckBox property to true. An exception is caused when the column is hidden and the Readonly property of the GridView is set.
The test code is as follows: Press Btn1 and then Btn2 to trigger an exception.public partial class RadForm1 : RadForm
{
private bool flag1 = false;
private bool flag2 = false;
private GridViewCheckBoxColumn checkColumn;
public RadForm1()
{
InitializeComponent();
AddCheckColumn();
AddButton();
this.radGridView1.RowCount = 10;
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.MasterTemplate.AllowAddNewRow = false;
}
private void AddCheckColumn()
{
checkColumn = new GridViewCheckBoxColumn();
checkColumn.Name = "Select";
checkColumn.HeaderText = "All";
checkColumn.EnableHeaderCheckBox = true;
this.radGridView1.Columns.Insert(0, checkColumn);
this.radGridView1.HeaderCellToggleStateChanged += RadGridView1_HeaderCellToggleStateChanged;
this.radGridView1.Columns.Add(new GridViewTextBoxColumn("A"));
this.radGridView1.Columns.Add(new GridViewTextBoxColumn("B"));
}
private void RadGridView1_HeaderCellToggleStateChanged(object sender, GridViewHeaderCellEventArgs e)
{
MessageBox.Show($"Stateļ¼{e.State}");
}
private void AddButton()
{
Button btn1 = new Button();
btn1.Text = "Btn1";
btn1.Click += (o, e) =>
{
checkColumn.IsVisible = flag1;
flag1 = !flag1;
};
btn1.Location = new Point(5, 5);
this.Controls.Add(btn1);
Button btn2 = new Button();
btn2.Text = "Btn2";
btn2.Click += (o, e) =>
{
if (flag2)
radGridView1.Hide();
else
{
radGridView1.Show();
try
{
radGridView1.ReadOnly = flag2;
}
catch { }
}
flag2 = !flag2;
};
btn2.Location = new Point(120, 5);
this.Controls.Add(btn2);
}
}
I just started using RadPDFViewer and it works well but I have two things that are driving me crazy.
HI,
Is it possible to apply Telerik themes to any of the native (i.e. non-Telerik) Microsoft controls, such as System.Windows.Forms.Button? This is possible with WPF controls (https://docs.telerik.com/devtools/wpf/styling-and-appearance/stylemanager/common-styling-themes-mscontrols), but I have not found any documentation for doing this with WinForms controls.
Is this possible?
Thanks!
We want to use a customer Browsable() attribute to Show/Hide columns from a grid, but we are having an issue just getting it to work. Does telerk grids support customer browsable attribute? I know it does for DisplayName.
If so, I could use some help.
Hello
How to get the IdOperacao value from selected row?
Best Regards,
Marco Gaspar
Helo, i'll go straight to the point
************** ERROR START **************
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at Telerik.WinControls.ComponentInputBehavior.ElementUnderMouseMonitorTimer_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** ERROR END **************
I get the error when i subscribe to the event 'GraphicalViewItemFormatting'.
Example: THIS-OBJECT:radGanttView1:GraphicalViewItemFormatting:Subscribe(THIS-OBJECT:radGanttView1_GraphicalViewItemFormatting).
I can replicate the error by moving the mouse really fast (from the text element to the graphic element over and over again). If i unsubscribe then everything works just fine. This error is faster to replicate if there's more objects in the RadGanttView in question.
This error doesn't seem to exist anywhere BUT in Progress. I had this problem with the "RadGridView" but i managed to go around it. Something i wasn't able to do in this object.
My goal is to change the items/tasks colors but aparently that isn't something that can be done OUTSIDE of an event...
I talked to my colleagues and the ones with years of experience said it's probably on the DLL side. They said a 'Collection' is being modified at the wrong time and it's not in my control.
Does anyone know how to go around this? How I may change the items colors without using this event? Maybe a way to disable highlights and animations on the object to prevent said 'Collection' from being modified?
Thank you.
JP
Update1: Aparently this also happens to the 'TextViewItemFormatting' event. If i comment both subscribes everything goes perfect.
I am using the RadMaskedEditBox to limit the user input. I need to allow the user to enter values from 0.0 to 999.9. I was using a MaskType of Standard with a Mask of 999.9 or ###.#...however, this is forcing the user to enter numbers that are < 100 as 099.0. The users down't want to enter 0 for any value below 100, this is a real pain for them. so, I switched it to using a MaskType of Numeric and setting the Mask to N1, but this has its own problem of allowing the user to enter 9999999.9, which when saved, thows an error (the underline field is only 5 characters). Since there is no MaxLenth field on this control, I need a better method. I looked at using REGEX as the masktype, but, to this date, I still struggle with REGEX EXPRESSIONS and how to create an REGEX Expression to make this work. Anyone help me out here.
Thanks.
Hello All,
I'm working on an active directory project where the RadTreeView requires it's nodes to have images according to the nodes respective containers (I.E. User Accounts will have an user icon). I have posted some code relating to my issue. I hope someone here can shed some light on this and tell me what it is I'm doing wrong.
To be clear on this, the nodes show active directory binded data but not the images. Thank you in advance.
public void subEnumerateChildren(RadTreeNode oRootNode)
{
DirectoryEntry deParent = new DirectoryEntry("LDAP://RootDSE");
foreach (DirectoryEntry deChild in deParent.Children)
{
RadTreeNode oChildNode = oRootNode.Nodes.Add(deChild.Path);
switch (deChild.SchemaClassName)
{
case "computer":
oChildNode.ImageIndex = 6;
break;
case "user":
oChildNode.ImageIndex = 7;
break;
case "group":
oChildNode.ImageIndex = 8;
break;
case "organizationalUnit":
oChildNode.ImageIndex = 3;
break;
case "container":
oChildNode.ImageIndex = 1;
break;
case "publicFolder":
oChildNode.ImageIndex = 5;
break;
default:
oChildNode.ImageIndex = 1;
break;
}
oChildNode.Tag = deChild;
oChildNode.Text = deChild.Name.Substring(3).Replace("\\", "");
}
}
Hello everyone, I want to turn off the hidden function of the ribbonTab drop-down interface after double-clicking the mouse in Telerik's radRibbonBar control. How can I change it? I rewrote the double-click event of the ribbonTab and found that it has no effect. After double-clicking the ribbonTab, it will still be hidden. Thank you.
private void radRibbonBar1_Load(object sender, EventArgs e)
{
foreach (var tab in radRibbonBar1.CommandTabs)
{
tab.DoubleClick += new EventHandler(ribbonTab_DoubleClick);
}
}
private void ribbonTab_DoubleClick(object sender, EventArgs e)
{
// do nothing
}