本文整理汇总了C#中System.Web.UI.WebControls.GridViewSortEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewSortEventArgs类的具体用法?C# GridViewSortEventArgs怎么用?C# GridViewSortEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridViewSortEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了GridViewSortEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gvAgency_Sorting
protected void gvAgency_Sorting(object sender, GridViewSortEventArgs e)
{
LunchboxGridView4.Order(SearchResults.AsQueryable(), e.SortExpression);
hiddenmulti.Style.Clear();
masssubmit.Style.Clear();
reset.Style.Clear();
}
示例2: GridViewProducts_Sorting
protected void GridViewProducts_Sorting(object sender, GridViewSortEventArgs e)
{
Product.SortColumn = e.SortExpression;
product.Sort();
GridViewProducts.DataSource = product;
GridViewProducts.DataBind();
}
示例3: gvMOnthlySOI_Sorting
protected void gvMOnthlySOI_Sorting(object sender, GridViewSortEventArgs e)
{
if (!string.IsNullOrEmpty(txtSearch.Text))
{
MonthlySOIManager.SearchMonthlySOI(SqlDataSourceMonthlySOI, txtSearch.Text);
}
}
示例4: FantasyDetailsGridView_Sorting
protected void FantasyDetailsGridView_Sorting(object sender, GridViewSortEventArgs e)
{
DataTable temp = (DataTable)FantasyDetailsGridView.DataSource;
temp.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
FantasyDetailsGridView.DataSource = temp;
FantasyDetailsGridView.DataBind();
}
示例5: gvStock_Sorting
protected void gvStock_Sorting(object sender, GridViewSortEventArgs e)
{
DataView sortedView = new DataView(dtView);
sortedView.Sort = e.SortExpression + " " + "Asc";
gvStock.DataSource = sortedView;
gvStock.DataBind();
}
示例6: gvReport_Sorting
protected void gvReport_Sorting(object sender, GridViewSortEventArgs e)
{
DonorEventList DEL = new DonorEventList(User.Identity.Name);
EventList EL = new EventList(User.Identity.Name, int.Parse(Request["eid"].ToString()));
string[] SortOrder = ViewState["SortExpr"].ToString().Split(' ');
if (SortOrder[0] == e.SortExpression)
{
if (SortOrder[1] == "ASC")
{
ViewState["SortExpr"] = e.SortExpression + " " + "DESC";
}
else
{
ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
}
}
else
{
ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
}
gvReport.PageIndex = 0;
gvReport.DataSource = DEL.GetDonorEventMailedTickets_ByEvent(EL.pk_Event, ViewState["SortExpr"].ToString());
gvReport.DataBind();
}
示例7: gridEmployees_Sorting
protected void gridEmployees_Sorting(object sender, GridViewSortEventArgs e)
{
if (e.SortExpression == "FirstName" && sourceEmployeesSortedGridView.SortExpression == "LastName")
{
e.SortExpression = "LastName, FirstName";
}
}
示例8: GridViewOrders_Sorting
// sets sort order and re-binds page.
protected void GridViewOrders_Sorting(object sender, GridViewSortEventArgs e)
{
SortDirection = (SortDirection == "ASC") ? "DESC" : "ASC";
SortColumn = e.SortExpression;
Bind();
}
示例9: gwStudent_Sorting
protected void gwStudent_Sorting(object sender, GridViewSortEventArgs e)
{
GridViewSortExpression = e.SortExpression;
int pageIndex = gwStudent.PageIndex;
gwStudent.DataSource = SortDataTable(gwStudent.DataSource as DataTable, false);
gwStudent.DataBind();
}
示例10: grid_Sorting
protected void grid_Sorting(object sender, GridViewSortEventArgs e)
{
var arrows = new Dictionary<string, string>
{
{"Name", "arrowName"},
{"VideoSortOrder", "arrowVideoSortOrder"}
};
const string urlArrowUp = "~/admin/images/arrowup.gif";
const string urlArrowDown = "~/admin/images/arrowdown.gif";
const string urlArrowGray = "~/admin/images/arrowdownh.gif";
Field csf = (from Field f in _paging.Fields.Values where f.Sorting.HasValue select f).First();
Field nsf = _paging.Fields[e.SortExpression];
if (nsf.Name.Equals(csf.Name))
{
csf.Sorting = csf.Sorting == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;
grid_video.ChangeHeaderImageUrl(arrows[csf.Name],
(csf.Sorting == SortDirection.Ascending ? urlArrowUp : urlArrowDown));
}
else
{
csf.Sorting = null;
grid_video.ChangeHeaderImageUrl(arrows[csf.Name], urlArrowGray);
nsf.Sorting = SortDirection.Ascending;
grid_video.ChangeHeaderImageUrl(arrows[nsf.Name], urlArrowUp);
}
pageNumberer.CurrentPageIndex = 1;
_paging.CurrentPageIndex = 1;
}
示例11: gridView_Sorting
protected void gridView_Sorting(object sender, GridViewSortEventArgs e)
{
PopulateGrid();
List<Models.Group> listGroups = (List<Models.Group>)gvGroups.DataSource;
switch (e.SortExpression)
{
case "Name":
listGroups = GetSortDirection(e.SortExpression) == "Asc" ? listGroups.OrderBy(g => g.Name).ToList() : listGroups.OrderByDescending(g => g.Name).ToList();
break;
case "Image":
listGroups = GetSortDirection(e.SortExpression) == "Asc" ? listGroups.OrderBy(g => g.ImageId).ToList() : listGroups.OrderByDescending(g => g.ImageId).ToList();
break;
case "Type":
listGroups = GetSortDirection(e.SortExpression) == "Asc" ? listGroups.OrderBy(g => g.Type).ToList() : listGroups.OrderByDescending(g => g.Type).ToList();
break;
}
gvGroups.DataSource = listGroups;
gvGroups.DataBind();
foreach (GridViewRow row in gvGroups.Rows)
{
var group = new Models.Group();
var lbl = row.FindControl("lblCount") as Label;
var dataKey = gvGroups.DataKeys[row.RowIndex];
if (dataKey != null)
group = BLL.Group.GetGroup(Convert.ToInt32(dataKey.Value));
if (lbl != null)
lbl.Text = BLL.GroupMembership.GetGroupMemberCount(group.Id);
}
}
示例12: gvReport_Sorting
protected void gvReport_Sorting(object sender, GridViewSortEventArgs e)
{
DonorList DL = new DonorList();
string[] SortOrder = ViewState["SortExpr"].ToString().Split(' ');
if (SortOrder[0] == e.SortExpression)
{
if (SortOrder[1] == "ASC")
{
ViewState["SortExpr"] = e.SortExpression + " " + "DESC";
}
else
{
ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
}
}
else
{
ViewState["SortExpr"] = e.SortExpression + " " + "ASC";
}
gvReport.PageIndex = 0;
gvReport.DataSource = DL.GetDonorDemoUpdates(ViewState["SortExpr"].ToString());
gvReport.DataBind();
}
示例13: OnSorting
protected override void OnSorting(GridViewSortEventArgs e)
{
foreach (DataControlField column in Columns)
{
if (column.SortExpression == e.SortExpression)
{
column.HeaderStyle.CssClass = "sorted";
column.HeaderStyle.BackColor = Color.Khaki;
if (e.SortDirection == SortDirection.Descending)
column.HeaderText = ViewState[column.SortExpression] + " [asc]";
else
column.HeaderText = ViewState[column.SortExpression] + " [desc]";
}
else
{
if (ViewState[column.SortExpression] != null)
column.HeaderText = ViewState[column.SortExpression] as string;
column.HeaderStyle.CssClass = "";
column.HeaderStyle.BackColor = Color.White;
}
}
base.OnSorting(e);
}
示例14: agvCustomers_Sorting
protected void agvCustomers_Sorting(object sender, GridViewSortEventArgs e)
{
var arrows = new Dictionary<string, string>
{
{"Lastname", "arrowLastname"},
{"Firstname", "arrowFirstname"},
{"Email", "arrowEmail"},
};
string urlArrowUp = UrlService.GetAdminAbsoluteLink("images/arrowup.gif");
string urlArrowDown = UrlService.GetAdminAbsoluteLink("images/arrowdown.gif");
string urlArrowGray = UrlService.GetAdminAbsoluteLink("images/arrowdownh.gif");
Field csf = (from Field f in _paging.Fields.Values where f.Sorting.HasValue select f).First();
Field nsf = _paging.Fields[e.SortExpression];
if (nsf.Name.Equals(csf.Name))
{
csf.Sorting = csf.Sorting == SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending;
agvCustomers.ChangeHeaderImageUrl(arrows[csf.Name],
(csf.Sorting == SortDirection.Ascending ? urlArrowUp : urlArrowDown));
}
else
{
csf.Sorting = null;
agvCustomers.ChangeHeaderImageUrl(arrows[csf.Name], urlArrowGray);
nsf.Sorting = SortDirection.Ascending;
agvCustomers.ChangeHeaderImageUrl(arrows[nsf.Name], urlArrowUp);
}
pageNumberer.CurrentPageIndex = 1;
_paging.CurrentPageIndex = 1;
}
示例15: StudentGrid_Sorting
protected void StudentGrid_Sorting(object sender, GridViewSortEventArgs e)
{
DataView view = new DataView(BindData());
view.Sort = e.SortExpression + " " + "Asc";
StudentGrid.DataSource = view;
StudentGrid.DataBind();
}