3

I have added a new system(DB) to the existing dynamic data application. I have registered routes in global.asax . I have given scaffoldalltables to true.

But in table navigation while giving DataSource to gridview, Visibletables count is always zero. eventhough tables count is 4.

region Test Configuration

        TestModel.RegisterContext(typeof(TestModel.CompassionEntities), new ContextConfiguration { ScaffoldAllTables = true });
        TestModel.FieldTemplateFactory = new AdvancedFieldTemplateFactory();
        routes.Add(new DynamicDataRoute("Test.{table}/ListDetails.aspx")
        {
            Action = PageAction.List,
            RouteHandler = new AdvancedDynamicDataRouteHandler(),
            ViewName = "ListDetails",
            Model = TestModel
        });
        routes.Add(new DynamicDataRoute("Test.{table}/ListDetails.aspx")
        {
            Action = PageAction.Details,
            RouteHandler = new AdvancedDynamicDataRouteHandler(),
            ViewName = "ListDetails",
            Model = TestModel
        });

endregion

tablenavigation.cs

TestGridView.DataSource = Global.TestModel.VisibleTables; TestGridView.DataBind();

Please assist

Community
  • 1
  • 1
Ram
  • 27
  • 3

1 Answers1

0

In my case that was caused by absence of ~/DynamicData/Content folder with GridViewPager.ascx in it. You can examine this if look at exception for Global.DefaultModel.VisibleTables in debug.

Konstantin Salavatov
  • 4,370
  • 2
  • 25
  • 24