private void RenderTab(
            GridRendererContext rendererContext,
            IMasterTableDataSet masterTableDataSet,
            ITableDataAdapter selectedDataAdapter,
            ITableDataAdapter dataAdapter)
        {
            var masterDetailRelationship = rendererContext
                                           .GridConfiguration
                                           .FindRelationshipConfiguration(dataAdapter.UnderlyingTypeOfItem);

            var localActualItem = rendererContext.ActualItem;

            rendererContext.OpenElement(HtmlTagNames.Button,
                                        selectedDataAdapter.IsForSameUnderlyingType(dataAdapter) ? "tabs-button tabs-button-active" : "tabs-button");

            rendererContext.AddOnClickEvent(() =>
                                            BindMethods.GetEventHandlerValue((UIMouseEventArgs e) =>
                                                                             masterTableDataSet.SelectDataAdapter(new MasterDetailRowArguments(dataAdapter, localActualItem)))
                                            );

            rendererContext.OpenElement(HtmlTagNames.Span, "tabs-button-text");
            rendererContext.AddContent(masterDetailRelationship.DetailGridViewPageCaption(dataAdapter));
            rendererContext.CloseElement();
            rendererContext.CloseElement();
        }
Ejemplo n.º 2
0
        private void RenderTab(
            GridRendererContext rendererContext,
            IMasterTableDataSet masterTableDataSet,
            ITableDataAdapter selectedDataAdapter,
            ITableDataAdapter dataAdapter)
        {
            var masterDetailRelationship = rendererContext
                                           .GridConfiguration
                                           .FindRelationshipConfiguration(dataAdapter.UnderlyingTypeOfItem);

            var localActualItem = rendererContext.ActualItem;

            rendererContext.OpenElement(HtmlTagNames.Button,
                                        selectedDataAdapter.IsForSameUnderlyingType(dataAdapter) ? "tabs-button tabs-button-active" : "tabs-button");

            rendererContext.AddOnClickEvent(
                EventCallback.Factory.Create(this, (MouseEventArgs e) =>
            {
                masterTableDataSet.SelectDataAdapter(new MasterDetailRowArguments(dataAdapter, localActualItem));
                rendererContext.RequestRerenderNotification?.Invoke();
            })
                );

            rendererContext.OpenElement(HtmlTagNames.Span, "tabs-button-text");
            rendererContext.AddContent(masterDetailRelationship.DetailGridViewPageCaption(dataAdapter));
            rendererContext.CloseElement();
            rendererContext.CloseElement();
        }