private void UpdatePageControl(ASPxPageControl pageControl)
 {
     //loop through PageControl's tabs
     foreach (TabPage tab in pageControl.TabPages)
     {
         //remove the item count from the tab caption
         tab.Text = DetailViewControllerHelper.ClearItemCountInTabCaption(tab.Text);
         var listPropertyEditor = View.FindItem(tab.Name) as ListPropertyEditor;
         if (listPropertyEditor != null)
         {
             var count = listPropertyEditor.ListView.CollectionSource.GetCount();
             if (count > 0)
             {
                 tab.Text += " (" + count + ")";
             }
             if (listPropertyEditor.ListView.Editor is ASPxGridListEditor editor && editor.Grid != null)
             {
                 //Assign the ASPxClientGridView.EndCallback event hander. This is required for inline editing
                 editor.Grid.JSProperties["cpCaption"] = tab.Text;
                 ClientSideEventsHelper.AssignClientHandlerSafe(editor.Grid, "EndCallback", $"function(s, e) {{ " +
                                                                $"if (!s.cpCaption) return;" +
                                                                $"var tab = {pageControl.ClientInstanceName}.GetTabByName('{tab.Name}');" +
                                                                $"tab.SetText(s.cpCaption);" +
                                                                $"delete s.cpCaption}}", nameof(EmployeeDetailViewWebController));
             }
         }
     }
 }
 private void UpdateLayoutGroupText()
 {
     if (layoutGroup != null)
     {
         int count = View.CollectionSource.GetCount();
         layoutGroup.Text = DetailViewControllerHelper.ClearItemCountInTabCaption(layoutGroup.Text);
         if (count > 0)
         {
             layoutGroup.Text += " (" + count + ")";
         }
     }
 }
Beispiel #3
0
 private void RefreshTabCaptions()
 {
     foreach (var item in View.GetItems <ListPropertyEditor>())
     {
         item.Caption = DetailViewControllerHelper.ClearItemCountInTabCaption(item.Caption);
         int count = item.ListView.CollectionSource.GetCount();
         if (count > 0)
         {
             item.Caption = DetailViewControllerHelper.AddItemCountToTabCaption(item.Caption, count);
         }
     }
 }
 private void RefreshTabCaptions()
 {
     foreach (var item in View.GetItems <BlazorListPropertyEditor>())
     {
         if (item.MemberInfo.GetValue(item.CurrentObject) is ICollection collection)
         {
             item.Caption = DetailViewControllerHelper.ClearItemCountInTabCaption(item.Caption);
             int count = collection.Count;
             if (count > 0)
             {
                 item.Caption = $"{item.Caption} ({count})";
             }
         }
     }
 }