当前位置: 首页>>代码示例>>C#>>正文


C# MetaTable.GetColumnValuesFromRoute方法代码示例

本文整理汇总了C#中System.Web.DynamicData.MetaTable.GetColumnValuesFromRoute方法的典型用法代码示例。如果您正苦于以下问题:C# MetaTable.GetColumnValuesFromRoute方法的具体用法?C# MetaTable.GetColumnValuesFromRoute怎么用?C# MetaTable.GetColumnValuesFromRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.DynamicData.MetaTable的用法示例。


在下文中一共展示了MetaTable.GetColumnValuesFromRoute方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
            GridDataSource.EntityTypeFilter = table.EntityType.Name;

            // Set the search data fields to all the string columns
            var searchExpression = (SearchExpression)GridQueryExtender.Expressions[1];
            searchExpression.DataFields = String.Join(",", table.Columns.Where(c => c.IsString).Select(c => c.Name));
            if (String.IsNullOrEmpty(searchExpression.DataFields))
            {
                // No string fields, remove the search elements
                SearchPanel.Visible = false;
                GridQueryExtender.Expressions.Remove(searchExpression);
            }

            // Disable various options if the table is readonly
            GridView1.ColumnsGenerator = new OrderedFieldGenerator(table);
            if (table.IsReadOnly)
            {
                GridView1.Columns[0].Visible = false;
                InsertHyperLink.Visible = false;
                GridView1.EnablePersistedSelection = false;
            }
        }
开发者ID:henrycomein,项目名称:NuGetGallery,代码行数:25,代码来源:List.aspx.cs

示例2: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
            GridDataSource.EntityTypeFilter = table.EntityType.Name;

        }
开发者ID:50minutos,项目名称:ATENTO-ASP.NET,代码行数:7,代码来源:List.aspx.cs

示例3: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            FormView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));

            DetailsDataSource.DomainServiceTypeName = table.DataContextType.AssemblyQualifiedName;
            DetailsDataSource.QueryName = table.GetSelectMethod();
        }
开发者ID:davidebbo-test,项目名称:DomainServiceDynamicData,代码行数:8,代码来源:Insert.aspx.cs

示例4: Page_Init

 protected void Page_Init(object sender, EventArgs e) {
     table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
     GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
     GridDataSource.EntityTypeName = table.EntityType.AssemblyQualifiedName;
     if (table.EntityType != table.RootEntityType) {
         GridQueryExtender.Expressions.Add(new OfTypeExpression(table.EntityType));
     }
 }
开发者ID:roysalor,项目名称:Curso-ASP.NET,代码行数:8,代码来源:List.aspx.cs

示例5: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));

            GridDataSource.DomainServiceTypeName = table.DataContextType.AssemblyQualifiedName;
            GridDataSource.QueryName = table.GetSelectMethod();

            GridView1.ColumnsGenerator = new DefaultAutoFieldGenerator(table);
            GridView1.DataKeyNames = table.PrimaryKeyColumns.Select(c => c.Name).ToArray();
        }
开发者ID:davidebbo-test,项目名称:DomainServiceDynamicData,代码行数:11,代码来源:List.aspx.cs

示例6: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            FormView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
            DetailsDataSource.EntityTypeFilter = table.EntityType.Name;

            DetailsDataSource.ContextCreating += (o, args) =>
            {
                args.Context = (ObjectContext)table.CreateContext();
            };
        }
开发者ID:ZhiYuanHuang,项目名称:NuGetGallery,代码行数:11,代码来源:Insert.aspx.cs

示例7: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            IsPublic = true;

               table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
               FormView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
               DetailsDataSource.EntityTypeFilter = table.EntityType.Name;

               Master.FormTitle = "Add new entry to " + table.DisplayName;

               DetailsDataSource.Inserted += new EventHandler<EntityDataSourceChangedEventArgs>(DetailsDataSource_Inserted);
        }
开发者ID:weavver,项目名称:weavver,代码行数:12,代码来源:Insert.aspx.cs

示例8: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
            GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
            GridDataSource.EntityTypeFilter = table.EntityType.Name;

            GridDataSource.ContextCreating += (o, args) =>
            {
                args.Context = (ObjectContext)table.CreateContext();
            };

            // Set the search data fields to all the string columns 
            var searchExpression = (SearchExpression)GridQueryExtender.Expressions[1];
            searchExpression.DataFields = String.Join(",", table.Columns.Where(c => c.IsString).Select(c => c.Name));
            if (string.IsNullOrEmpty(searchExpression.DataFields))
            {
                // No string fields, remove the search elements 
                SearchPanel.Visible = false;
                GridQueryExtender.Expressions.Remove(searchExpression);
            }
        }
开发者ID:ZhiYuanHuang,项目名称:NuGetGallery,代码行数:21,代码来源:List.aspx.cs

示例9: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
               GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
               FormView1.SetMetaTable(table);
               GridDataSource.EntityTypeFilter = table.EntityType.Name;
               DetailsDataSource.EntityTypeFilter = table.EntityType.Name;
               DetailsDataSource.WhereParameters.Add(new Parameter("OrganizationId", DbType.Guid, LoggedInUser.OrganizationId.ToString()));

               Master.FormTitle = table.DisplayName;
               Master.FixedWidth = false;

               GridView1.RowCreated += new GridViewRowEventHandler(GridView1_RowCreated);
        }
开发者ID:weavver,项目名称:weavver,代码行数:14,代码来源:ListDetails.aspx.cs

示例10: Page_Init

 protected void Page_Init(object sender, EventArgs e)
 {
     table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
     FormView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
     DetailsDataSource.EntityTypeName = table.EntityType.AssemblyQualifiedName;
 }
开发者ID:MGGROUP,项目名称:BASICA,代码行数:6,代码来源:Insert.aspx.cs

示例11: OnInit

    //-------------------------------------------------------------------------------------------
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
               table = DynamicDataRouteHandler.GetRequestMetaTable(Context);

               ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(string), "RunScripts", "run();", true);

               Controls_ColumnPicker obj = (Controls_ColumnPicker) SecureContent.FindControl("ColumnPicker1");
               if (obj != null)
               {
                    obj.DataSaved += new DataSavedHandler(obj_DataSaved);
                    GridView1.ColumnsGenerator = obj.FieldManager;
               }

               ((IQueryableDataSource)this.GridDataSource).QueryCreated += new EventHandler<QueryCreatedEventArgs>(List_QueryCreated);
               GridView1.DataBound += new EventHandler(GridView1_DataBound);
               GridView1.PageIndexChanging += new GridViewPageEventHandler(GridView1_PageIndexChanging);
               GridView1.RowDataBound += new GridViewRowEventHandler(GridView1_RowDataBound);
               GridView1.RowCreated += new GridViewRowEventHandler(GridView1_RowCreated);

               GridDataSource.Selected += new EventHandler<EntityDataSourceSelectedEventArgs>(GridDataSource_Selected);

               GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
               //if (!IsPostBack)
               //{
                    GridDataSource.EntityTypeFilter = table.EntityType.Name;
               //}

               //GenerateMenu(TableActions.List, table.EntityType.GetType());

               GridDataSource.WhereParameters.Add(new Parameter("OrganizationId", DbType.Guid, BasePage.SelectedOrganization.Id.ToString()));

               //set the default sort
               if (table.DisplayColumn != null)
               {
                    GridDataSource.AutoGenerateOrderByClause = true;
                    GridDataSource.OrderByParameters.Add(new Parameter(table.DisplayColumn.Name));
               }

               if (Request["ObjectId"] != null)
                    GridDataSource.WhereParameters.Add(new Parameter("ObjectId", DbType.Guid, Request["ObjectId"]));

               if (Request["AccountId"] != null)
               {
                    GridDataSource.WhereParameters.Add(new Parameter("AccountId", DbType.Guid, Request["AccountId"]));

                    using (WeavverEntityContainer data = new WeavverEntityContainer())
                    {
                         string title = data.GetName(new Guid(Request["AccountId"]));

                         if (Request["LedgerType"] != null)
                         {
                              title += " - " + Request["LedgerType"];
                         }

                         BasePage.WeavverMaster.FormTitle = title;
                    }
               }

               DataAccess insertPermissions = table.EntityType.InsertPermissions();
               if (insertPermissions.HasAnyRole(Roles.GetRolesForUser()))
               {
                    newObjectLink.Visible = true;
                    newObjectLink.Title = "Accessible to: " + String.Join(", ", insertPermissions.AllowedRoles);

                    string newLink = "javascript:createPopup('/{0}/Details.aspx', {1}, {2});";
                    newObjectLink.HRef = String.Format(newLink, table.EntityType.Name, insertPermissions.Width, insertPermissions.Height);
               }

               MethodInfo tableMenu = table.EntityType.GetMethod("GetTableMenu");
               if (tableMenu != null && tableMenu.IsStatic)
               {
                    var x = tableMenu.Invoke(null, null);
                    if (x != null)
                    {
                         List<WeavverMenuItem> items = (List<WeavverMenuItem>)x;
                         foreach (WeavverMenuItem item in items)
                         {
                              if (item.Link.StartsWith("control://"))
                              {
                                   string controlPath = item.Link.Substring(10);
                                   if (File.Exists(Server.MapPath(controlPath)))
                                   {
                                        WeavverUserControl customControl = (WeavverUserControl)LoadControl(controlPath);
                                        //quickAdd.DataSaved += new DataSavedHandler(QuickAdd_DataSaved);
                                        AvailableActions.Controls.Add(customControl);
                                   }
                              }
                              else
                              {
                                   LinkButton webMethod = new LinkButton();
                                   webMethod.ID = "DynamicWebMethod_" + item.Name;
                                   webMethod.Text = item.Name;
                                   webMethod.CommandName = item.Name;
                                   webMethod.CssClass = "attachmentLink";
                                   webMethod.Click += new EventHandler(DynamicWebMethod_Click);
                                   AvailableActions.Controls.Add(webMethod);
                              }
                         }
//.........这里部分代码省略.........
开发者ID:weavver,项目名称:weavver,代码行数:101,代码来源:DynamicList.ascx.cs


注:本文中的System.Web.DynamicData.MetaTable.GetColumnValuesFromRoute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。