

private void radGridView5_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (e.Column.Name == "operati") { RadDropDownListEditor editors = (RadDropDownListEditor)e.ActiveEditor; RadDropDownListEditorElement elements = (RadDropDownListEditorElement)editors.EditorElement; switch (_endOperationSoc) { case "принят": elements.Items.RemoveAt(4); elements.Items.RemoveAt(1); break; case "приостановлен": elements.Items.RemoveAt(3); elements.Items.RemoveAt(1); break; case "снят": elements.Items.RemoveAt(4); elements.Items.RemoveAt(3); elements.Items.RemoveAt(2); break; case "возобновлен": elements.Items.RemoveAt(4); elements.Items.RemoveAt(1); break; } } if (e.Column.HeaderText == "соц. работник") { RadDropDownListEditor editors = (RadDropDownListEditor)e.ActiveEditor; RadDropDownListEditorElement elements = (RadDropDownListEditorElement)editors.EditorElement; if (radGridView5.RowCount != 0) elements.SelectedIndex = elements.FindString(radGridView5.Rows[radGridView5.RowCount - 1].Cells[1].Value.ToString()); } RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor; if (editor == null) { return; } RadDropDownListElement element = editor.EditorElement as RadDropDownListEditorElement; int scrolBarWidth = 0; if (element.DefaultItemsCountInDropDown < element.Items.Count) { scrolBarWidth = 35; } foreach (RadListDataItem item in element.Items) { string text = item.Text; Size size = TextRenderer.MeasureText(text, element.Font); if (element.DropDownWidth < size.Width) { element.DropDownWidth = size.Width + scrolBarWidth; } } }here is this moment:
switch (_endOperationSoc) { case "принят": //elements.Items[4].IsVisible = false; elements.Items.RemoveAt(4); elements.Items.RemoveAt(1); RadMessageBox.Show("принят", "Ошибка", MessageBoxButtons.OK, RadMessageIcon.Exclamation); break; case "приостановлен": elements.Items.RemoveAt(3); elements.Items.RemoveAt(1); RadMessageBox.Show("приостановлен", "Ошибка", MessageBoxButtons.OK, RadMessageIcon.Exclamation); break; case "снят": elements.Items.RemoveAt(4); elements.Items.RemoveAt(3); elements.Items.RemoveAt(2); RadMessageBox.Show("снят", "Ошибка", MessageBoxButtons.OK, RadMessageIcon.Exclamation); break; case "возобновлен": elements.Items.RemoveAt(4); elements.Items.RemoveAt(1); RadMessageBox.Show("возобновлен", "Ошибка", MessageBoxButtons.OK, RadMessageIcon.Exclamation); break; } }How do I not delete items but just hide or display them?
It is necessary to do it in this moment.
Thank you.

Good afternoon.
I want to change the color according to the Data value of a certain column in Cardview.
Cardview does not have a CellFormatting in the Gridview or Listview.
I change the color of the entire item using Cardview's VisualItemFormatting.
private void RadCardView1_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
{
if (e.VisualItem.Data["EIFSTATUS"].Equals("OFF"))
{
e.VisualItem.BackColor = Color.Red;
e.VisualItem.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}
}
But I do not want it.
I would like to change Backcolor only for "OFF" value only when the column value of "EIFSTATUS" is "OFF" instead of whole.
I want to change it like the Grid screen below.
private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo.HeaderText == "EIFSTATUS")
{
if (e.CellElement.RowInfo.Cells["EIFSTATUS"].Value.Equals("OFF"))
{
e.CellElement.DrawFill = true;
e.CellElement.GradientStyle = GradientStyles.Solid;
e.CellElement.BackColor = Color.Red;
}
}
}
I would appreciate your help.


I have a very simple RadLayoutControl with two LayoutControlItems inside it - each Control Item has a RadListControl - these are stacked on top of each other.
Each LayoutControlItem is the same height - a 50/50 split which is exactly what I want.
Unfortunately because of how WinForms are displayed - the form is first drawn as the same size as it is in the designer...then everything expands to the actual size of the form and you get this ugly double-painting effect...my RadLayoutControl is shown...then blink and it's redrawn at its Run-Time size and everything resizes correctly.
Well, I hate that WinForms do that...and I'm not smart enough to know how to tell the application, "Hey! Don't draw anything until the form has finished resizing!" so I fake it...anything that gives me this double-paint I set Visible = false and once the form's finished its resizing I set Visible = True.
My problem is this: With the RadLayoutControl doing this: The TOP panel is the same size as in the designer and only the bottom panel resizes to fill the rest of the space.
My question is this: Is there any way I can tell the RadLayoutControl, "Take your current height and go resize everything equally" so I wind up with two panels the same height?
I've attached a couple of images to show you what I mean. One shows you how I want it to look and the other shows how it does look. Hopefully you can make sense of this post and I don't sound like some crazy guy trying to do something I shouldn't be...heck if anyone there knows anyway to tell a WinForm not to paint until it's resized that would solve everything :)
-C

The following link has a great example for Button FillPrimitive.
https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/override-theme-settings-at-run-time
However, I am having a lot of trouble trying to do the same thing with my RadButton's BorderPrimitive.
The following does not work.
this.radButton1.ButtonElement.SetThemeValueOverride(Telerik.WinControls.Primitives.BorderPrimitive.ForeColorProperty,Color.Red, "", (Telerik.WinControls.Primitives.BorderPrimitive));
What will work? I tried accessing this.radButton1.ButtonElement.BorderElement but there is no SetThemeValueOverride member.

Hi,
I am very confused with validating data before sending it to the DB.
My Grid is popultated with datatable (from Web service) and I would like to send row data each time the user finishes to edit the row (send via Web Service) and also I would like to send a new row data by using a web service call with the params as needed.
The proble is that I do not know wich event to use sa there are a lot.
I tried to use grid_RowsChanged but I do not know if I should also use RowValidating as rows_Changed occured before row_valdating. or should I use only rows_changed? there is also a user_added_row event... please help..
I want to let user finish add new row then check if everything is valid. If it is not valid I would like to prevent him from pushing data (rovalidating is the only way I have to cancel telerik grid action to add the new row or accept the current row changes.
It is very consfusing, could you please help me.
Yaron

How can I disable the Complete Message Box from the SpellCheck in the RadRichTextEditor?
In RadSpellChecker I can use the property EnableCompleteMessageBox, but in RadRichTextEditor I can't find it.
Regards.
