Hello,
I am using a EditorControl for a column in my ultragrid. The type of EditorControl I am using is UltraTextEditor and I added two StateEditorButtons to this control as depicted in the image I provided. The question that I have is that when you click one of the StateEditorButtons; making it checked value 'true', all cells in that column using the EditorControl StateEditorButton become checked as well, is there way to make this work only on the cell you clicked the StateEditorButton on? Please advise.
I attached the image so that you can see my dilemma when check state of the StateEditorButton changes for this column.
Adrian
Hello Matt,
This should help alot. Thanks again for all the help!
Click is on the base EmbeddableButtonBase class, so it will appear on the StateEditorButton too. But now that you mention it, I think that it would be better to hook the AfterEditorButtonCheckStateChanged events since at that point the buttons have been updated.
private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e){ if (e.Row.Cells["Col 1"].Editor == null) { EditorWithText editor = (EditorWithText)this.ultraTextEditor1.Editor.Clone(null); StateEditorButton checkButton = (StateEditorButton)editor.ButtonsRight[0]; checkButton.AfterCheckStateChanged += new EditorButtonEventHandler(checkButton_AfterCheckStateChanged); e.Row.Cells["Col 1"].Editor = editor; }}void checkButton_AfterCheckStateChanged(object sender, EditorButtonEventArgs e){ // Handle the check logic}
-Matt
Sorry for the late response. Perhaps I am not understanding how to get to the events on the StateEditorButton correctly, so I apologize for being a nuisance, but could you direct me as to how to get to the Click event programmatically. I did research the online documentation available and saw that the editor has events such as, BeforeEditorButtonCheckStateChanged and AfterEditorButtonCheckStateChanged available. Would those be of any use to me?
I misspoke, I meant the Click event on the StateEditorButton. As for the GetContext, you'd likely have to pass in "typeof(UltraGridCell)" as well in order to get the cel.
Ok this clearing it up for some, however, I was looking on the editor for a 'Click' event but there is none. Am I looking in the wrong place?
I do understand how to get the ultragridcell from what you described though. Like this I am assuming.
UltraGridcell aCell = ((UltraGridCell)e.Row.Cells["Col 1"].Editor.ElementBeingEdited.GetContext());