I would like to be able to programmatically force a cell in the UltraGanttView grid to enter edit mode. As it stands currently, when a user uses the directional arrows to move to another cell, the cell does not enter edit mode. I would like to implement this functionality.
Is there something that would achieve something like the PerformAction function for the UltraGrid, and I'm just missing it?
Hello
One possible approach to achieve desired behavior could be if you are using the code:
private void ultraButton1_Click(object sender, EventArgs e)
{
EmbeddableUIElementBase embeddableElement = this.ultraGanttView1.UIElement.GetDescendant(typeof(EmbeddableUIElementBase)) as EmbeddableUIElementBase;
if (embeddableElement != null) ultraGanttView1.GridSettings.ColumnSettings[TaskField.Name].Editor.EnterEditMode(embeddableElement);
}
Let me know if you have any questions.
Regards
Thank you for the quick response.
This has the desired effect, but only causes the first row in the grid to enter edit mode. How do I access the currently active task?
Hello mictherr,
Maybe one possible solution for this task, could be:
// Declare List of UIElementsprivate List<UIElement> list = new List<UIElement>();
private void ultraButton1_Click(object sender, EventArgs e){ list = new List<UIElement>(); GetChild(ultraGanttView1.UIElement); EmbeddableUIElementBase embeddableElement = list[ultraGanttView1.ActiveTask.RowNumber-1].GetAncestor(typeof(EmbeddableUIElementBase)) as EmbeddableUIElementBase;
if (embeddableElement != null ) ultraGanttView1.GridSettings.ColumnSettings[TaskField.Name].Editor.EnterEditMode(embeddableElement);}
// Create a Recursive methodprivate void GetChild(UIElement element){ foreach (UIElement el in element.ChildElements) { if (el.ChildElements.Count > 0) GetChild(el); else { if(el.GetType() == typeof(ExpandableEditorWithTextIndentationUIElement)) { list.Add(el); } } }}
Please take a look at the attached video file for more details and let me know if you have any questions.
Thank you for the response. This does enter edit mode for the selected task. However, changes made are not persisted, and instead, the changes made are reflected in an entirely different task.
I appreciate your assistance on this, but this is turning into a much bigger deal than I wanted it to be! I'm simply going to create a separate editor panel where the details of each task can be modified, while leaving the grid of the Gantt as read only.
Thanks for the feedback. I was not able to reproduce your issue "changes made are reflected in an entirely different task". If you need further assistance, please send me your sample with this issue and I`ll be glsd to reserach it for you.
Hello Mictherr,
I`m not sure that I understand your scenario. Could you please upload your sample and steps that reproduce your issue and I`ll be glad to research it for you.
I'm not sure if this makes a difference or not, but the task in particular I am editing is a brand new task. Incidentally, it does not end up being the element at the row position of the active task, but rather the last element listed in the list. Could this affect it?
I will put together a small sample and you can see what I mean. I'm interested in seeing this through if you believe you can help me.