Hi, im trying to use waiting bars inside radgridview, I sucessfully add the waitingbars to the gridview in the CellFormatting event.
The problems comes when i try to dinamically change the state of the waitingbars individually (startwaiting - stopwaiting) when certain event happend eg. when i click a button i want determined cell to starwaiting or stopwaiting, here is the button code:
and here the editor and element editor:
this code just dosent work, the editor is always null. Please if someone can guide me how to do it correctly I will apreciate it so much!!.
Thank you,
The problems comes when i try to dinamically change the state of the waitingbars individually (startwaiting - stopwaiting) when certain event happend eg. when i click a button i want determined cell to starwaiting or stopwaiting, here is the button code:
private void NewPjButton_Click(object sender, EventArgs e){ radGridView1.EndEdit(); radGridView1.Rows[2].Cells[5].IsSelected = true; radGridView1.Rows[2].Cells[5].BeginEdit(); RadwaitingBarEditor editor = radGridView1.ActiveEditor as RadwaitingBarEditor; if (editor != null) //this is always null { RadwaitingBarEditorElement element = editor.EditorElement as RadwaitingBarEditorElement; element.StartWaiting(); }}and here the editor and element editor:
public class RadwaitingBarEditor : BaseGridEditor{ public override void BeginEdit() { base.BeginEdit(); this.EditorElement.Focus(); ((RadwaitingBarEditorElement)this.EditorElement).WaitingStarted += new EventHandler(RadwaitingBarEditor_WaitingStarted); } public override bool EndEdit() { ((RadwaitingBarEditorElement)this.EditorElement).WaitingStarted -= new EventHandler(RadwaitingBarEditor_WaitingStarted); return base.EndEdit(); } void RadwaitingBarEditor_WaitingStarted(object sender, EventArgs e) { OnValueChanged(); } protected override RadElement CreateEditorElement() { return new RadwaitingBarEditorElement(); }}public class RadwaitingBarEditorElement : RadWaitingBarElement{ public RadwaitingBarEditorElement() { this.CanFocus = true; } public event EventHandler WaitingStarted; protected override Type ThemeEffectiveType { get { return typeof(RadWaitingBarElement); } } protected override void OnPropertyChanged(RadPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (e.Property == RadTrackBarItem.ValueProperty && this.Parent != null && this.WaitingStarted != null) { this.WaitingStarted(this, EventArgs.Empty); } }}this code just dosent work, the editor is always null. Please if someone can guide me how to do it correctly I will apreciate it so much!!.
Thank you,