[Index.razor]
<SfDialog ID="DialogContainer" @ref="Dialog" Width="700px" IsModal="true" Header="Add Custom Dialog" @bind-Visible="@IsVisible">
<DialogTemplates>
<Content>
// Render Textbox for ID
<SfTextBox ID="InputIdContainer" @ref="InputId" Placeholder="Id" Width="300px" Value="@Id" Enabled="false"></SfTextBox>
// Render Textbox for Name
<SfTextBox ID="InputNameContainer" @ref="InputName" Placeholder="TaskName" Width="300px" Value="@Name"></SfTextBox>
</Content>
</DialogTemplates>
<DialogButtons>
<DialogButton Content="Ok" OnClick="@OkDialog" ></DialogButton>
<DialogButton Content="Cancel" OnClick="@CloseDialog" />
</DialogButtons>
</SfDialog>
<SfGantt ID="GanttExport" @ref="Gantt" TValue="Table" Height="450px" Width="700px"
…//
</SfGantt>
@code {
public string Name { get; set; }
public string Id { get; set; }
private bool IsVisible { get; set; } = false;
public void OnActionBegin(ActionBeginArgs<Table> args)
{
if (args.RequestType == "beforeOpenEditDialog" || args.RequestType == "beforeOpenAddDialog")
{
args.Cancel = true;
RenderDialog(args.RowData.TaskData); //Pass selected data
}
}
public void RenderDialog(Table data)
{
Id = data.Id.ToString(); // Render Id textbox with id value of selected data
Name = data.Name; //Render Name textbox with Name value of selected data
this.Dialog.Show();
}
private void CloseDialog()
{
this.Dialog.Hide();
}
private void OkDialog()
{
this.Gantt.UpdateRecordByID(new Table() { Id=Convert.ToInt16(this.InputId.Value), Name=this.InputName.Value}); // Update record using method
this.Dialog.Hide();
}
public SfGantt<Table> Gantt;
public SfDialog Dialog;
public SfTextBox InputName;
public SfTextBox InputId;
} |
Hi !
Do we have option to fully refresh Gantt view from datasource based on current datasource state (not only by
UpdateRecordByID).
Assume scenario:
Does it really only one option exist ? - Find modified records and iterate through by UpdateRecordByID to get data integrity ?
HI!
OK, Thank you!
Please also note, I have no access to feedback Link you provided. ("This private feedback is not associated with your account " - shown)