本文整理汇总了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;
}
}
示例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;
}
示例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();
}
示例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));
}
}
示例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();
}
示例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();
};
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
//.........这里部分代码省略.........