Hi,
I'm formatting my RadGridView and changing its color based a cell value. It's working fine but if I scroll up or down It becomes to change all rows color.
Is it a bug, or I'm doing something wrong?
Here is my code:
Thank you.
Private Sub grid_RowFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.RowFormattingEventArgs)
e.RowElement.RowInfo.MinHeight = 24
If e.RowElement.RowInfo.Cells("Recusa").Value = "S" Then
e.RowElement.ForeColor = Color.DarkRed
e.RowElement.BackColor = Color.Coral
End If
End Sub
I have set the button's top border color to be red and bottom border color to be yellow by the below codes but the appearance never show the border colors when running.
this.ButtonElement.BorderElement.BoxStyle = BorderBoxStyle.FourBorders;
this.ButtonElement.BorderElement.TopColor = Color.Red;
this.ButtonElement.BorderElement.TopWidth = 2;
this.ButtonElement.BorderElement.BottomColor = Color.Yellow;
this.ButtonElement.BorderElement.BottomWidth = 2;
Please help me to solve this problem.
Hi,
I am trying to add a tooltip to a RadDropDownListElement embedded in a Ribbonbar.
One may add tooltip text directly, to the ListElement or to the Textbox, but no one results in a tooltip being displayed.
I do not wish to add tooltip to individual items in the dropdownlist, but just one tooltip to the entire control.
Any advice?
/Brian
I am trying to create a GridViewCheckedDropDownListColumn. I have some of it working.
It is creating the column and the drop-down is displaying as it should. However, the main cell does not show the checked items after the drop-down is no longer displayed. Nor does it remember which items had previously been checked when the drop-down is displayed a second time.
I wasn't able to attach my project, so here is the important code:
public class Foo
{
public int Id { get; set; }
public string Value { get; set; }
public bool IsSelected { get; set; }
}
public class Boo : Foo
{
public List<
Foo
> Foos { get; set; }
public Boo()
{
this.Foos = new List<
Foo
>();
}
}
public class RadCheckedDropDownListEditorElement : RadCheckedDropDownListElement
{
...
}
public class RadCheckedDropDownListEditor : BaseGridEditor
{
public string ValueMember { get; set; }
public string DisplayMember { get; set; }
public string CheckedMember { get; set; }
public override object Value
{
get
{
var listEditorElement = (RadCheckedDropDownListElement) this.EditorElement;
return listEditorElement.DataSource;
}
set
{
var listEditorElement = (RadCheckedDropDownListElement) this.EditorElement;
listEditorElement.ValueMember = this.ValueMember;
listEditorElement.DisplayMember = this.DisplayMember;
listEditorElement.CheckedMember = this.CheckedMember;
listEditorElement.DataSource = value;
}
}
[AttributeProvider(typeof(IListSource))]
[RadDescription("DataSource", typeof(RadListElement))]
[Category("Data")]
[RadDefaultValue("DataSource", typeof(RadListElement))]
public object DataSource
{
get
{
var listEditorElement = (RadCheckedDropDownListElement)this.EditorElement;
return listEditorElement.DataSource;
}
set
{
var listEditorElement = (RadCheckedDropDownListElement)this.EditorElement;
listEditorElement.DataSource = value;
}
}
protected override RadElement CreateEditorElement()
{
return new RadCheckedDropDownListEditorElement();
}
}
public class GridViewCheckedDropDownListColumn : GridViewComboBoxColumn
{
private RadCheckedDropDownListEditor _editor;
private string _checkedMember;
[Browsable(true)]
[Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
[Category("Data")]
[DefaultValue(null)]
[Description("Gets or sets a string that specifies the property or database column from which to get values that correspond to the items in the RadDropDownListEditor.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string CheckedMember
{
get
{
return this._checkedMember;
}
set
{
if (this._checkedMember == value) return;
this._checkedMember = value;
this.DispatchEvent(KnownEvents.ColumnDataSourceInitializing, GridEventType.UI, GridEventDispatchMode.Send, (object)null, (object[])null);
}
}
public GridViewCheckedDropDownListColumn()
{
}
public GridViewCheckedDropDownListColumn(string fieldName) : base(fieldName)
{
}
public GridViewCheckedDropDownListColumn(string uniqueName, string fieldName) : base(uniqueName, fieldName)
{
}
public override Type GetDefaultEditorType()
{
return typeof(RadCheckedDropDownListEditor);
}
public override IInputEditor GetDefaultEditor()
{
return new RadCheckedDropDownListEditor();
}
public override void InitializeEditor(IInputEditor editor)
{
var dropDownListEditor = (RadCheckedDropDownListEditor) editor;
if (dropDownListEditor == null) return;
dropDownListEditor.ValueMember = this.ValueMember;
dropDownListEditor.DisplayMember = this.DisplayMember;
dropDownListEditor.CheckedMember = this.CheckedMember;
dropDownListEditor.DataSource = this.DataSource;
}
public virtual void RadGridView_EditorRequired(object sender, EditorRequiredEventArgs e)
{
if (e.EditorType == typeof(RadCheckedDropDownListEditor))
{
e.Editor = this._editor ?? (this._editor = new RadCheckedDropDownListEditor());
}
}
}
public partial class Form1 : Form
{
private List<
Boo
> _boos;
public Form1()
{
this.InitializeComponent();
this.InitializeList();
this.InitializeColumns();
this.radGridView.DataSource = this._boos;
}
private void InitializeList()
{
this._boos = new List<
Boo
>();
for (int i = 0; i < 10; i++)
{
Boo b = new Boo
{
Id = i,
Value = $"Boo-{i}"
};
for (int j = 0; j < 10; j++)
{
Foo f = new Foo
{
Id = j,
Value = $"Foo-{i}.{j}"
};
b.Foos.Add(f);
}
this._boos.Add(b);
}
}
private void InitializeColumns()
{
var c1 = new GridViewTextBoxColumn(nameof(Boo.Id));
var c2 = new GridViewTextBoxColumn(nameof(Boo.Value));
var c3 = new GridViewCheckedDropDownListColumn(nameof(Boo.Foos))
{
ValueMember = nameof(Foo.Id),
DisplayMember = nameof(Foo.Value),
CheckedMember = nameof(Foo.IsSelected),
Width = 500
};
this.radGridView.Columns.Add(c1);
this.radGridView.Columns.Add(c2);
this.radGridView.Columns.Add(c3);
this.radGridView.EditorRequired += c3.RadGridView_EditorRequired;
}
}
Hi guys,
I don't understand how can I obtain rows of particular page (current page also), then get single cell and update it.
I would click to next page for example, view rows of this page and update specific column of these rows.
How can I do it?