Hi Sharath,
Greetings from Syncfusion. We have analyzed the reported problem with your sample and we were able to reproduce the reported issue at our end. We would like to inform you that while TabControl loading, it loads all controls (placed in all tabs) available in it, even that is not in the view.
Same as GanttControl (in second Tab) gets loaded without initializing its inner element. So that we got NRE while loading the TabControl. To overcome this NRE issue, we have added null check before the inner element (GantttGrid) accessing in GanttControl loaded event. Please find the code snippet as below.
Code snippet :
void AssociatedObject_Loaded(object sender, RoutedEventArgs e)
{
if (this.AssociatedObject.GanttGrid != null)
{
this.AssociatedObject.GanttGrid.UpdateMode = UpdateMode.PropertyChanged;
// Remove all the columns
this.AssociatedObject.GanttGrid.Columns.Clear();
GridTreeColumn column = new GridTreeColumn { MappingName = "Range", HeaderText = "Range", Width = 100 };
// adding the custom columns to GanttGrid(Table)
this.AssociatedObject.GanttGrid.Columns.Add(column);
}
} |
NOTE: Already we have resolved this issue and updated the sample in forum 141444. Please download the solution sample from there.
Hope it helps.
Regards,
Muneesh Kumar G.