本文整理汇总了C#中System.Web.UI.WebControls.GridViewRowEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewRowEventArgs类的具体用法?C# GridViewRowEventArgs怎么用?C# GridViewRowEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridViewRowEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了GridViewRowEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: grdCourses_RowDataBound
protected void grdCourses_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (IsPostBack)
{
if (e.Row.RowType == DataControlRowType.Header)
{
Image SortImage = new Image();
for (int i = 0; i <= grdCourses.Columns.Count - 1; i++)
{
if (grdCourses.Columns[i].SortExpression == Session["SortColumn"].ToString())
{
if (Session["SortDirection"].ToString() == "DESC")
{
SortImage.ImageUrl = "/images/desc.jpg";
SortImage.AlternateText = "Sort Descending";
}
else
{
SortImage.ImageUrl = "/images/asc.jpg";
SortImage.AlternateText = "Sort Ascending";
}
e.Row.Cells[i].Controls.Add(SortImage);
}
}
}
}
}
示例2: gvScore_RowDataBound
protected void gvScore_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//����ƶ���ÿ��ʱ��ɫ����Ч��
e.Row.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#c1ebff'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=e");
//�����������ָ����״Ϊ"С��"
e.Row.Attributes["style"] = "Cursor:hand";
LinkButton lbtName = e.Row.FindControl("lbtnName") as LinkButton;
Button btnSubmit = e.Row.FindControl("btnSubmit") as Button;
if (lbtName.Text == "���")
{
int basid = Convert.ToInt32(gvScore.DataKeys[e.Row.RowIndex]["DriverScoreId"].ToString());
DriverScoreInfo ds = new DriverScoreInfo(basid);
if (ds.IsSubmit == 2)
{
btnSubmit.Enabled = false;
}
}
else if (lbtName.Text == "�Ų�")
{
int fid = Convert.ToInt32(gvScore.DataKeys[e.Row.RowIndex]["NurseScoreId"].ToString());
NurseScoreInfo ma = new NurseScoreInfo(fid);
if (ma.IsSubmit == 2)
{
btnSubmit.Enabled = false;
}
}
}
}
示例3: gridView_OnRowCreated
protected void gridView_OnRowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
//e.Row.Cells[0].Text = "<input id='Checkbox2' type='checkbox' onclick='CheckAll()'/><label></label>";
}
}
示例4: GridViewOrders_RowCreated
// adds glyph to header according to current sort settings.
protected void GridViewOrders_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
AddGlyph(this.GridViewOrders, e.Row);
}
}
示例5: grdBusqueda_RowDataBound
protected void grdBusqueda_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["OnClick"] = "return GetSelectedRowC(this);";
}
}
示例6: grdMain_RowDataBound
protected void grdMain_RowDataBound(object sender, GridViewRowEventArgs e)
{
int cellIndex;
string puntaje = "";
if (e.Row.RowType == DataControlRowType.DataRow)
{
cellIndex = 0;
foreach (TableCell celda in e.Row.Cells)
{
if ((cellIndex + 1) != e.Row.Cells.Count)
{
var ddlCtl = (DropDownList)e.Row.FindControl("ptext" + cellIndex);
var lblCtl = (Label)e.Row.FindControl("ptl" + cellIndex);
if (ddlCtl != null)
{
string valorAnterior = ddlCtl.Text;
ddlCtl.Items.Clear();
ddlCtl.Items.Add(new ListItem("N/A", "-1"));
ddlCtl.Items.Add(new ListItem("0", "0"));
ddlCtl.Items.Add(new ListItem(puntaje, puntaje));
ddlCtl.Text = valorAnterior;
}
if (lblCtl != null)
puntaje = lblCtl.Text;
}
cellIndex++;
}
}
}
示例7: StudentsGridView_RowDataBound
protected void StudentsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (IsPostBack)
{
//if header row has been clicked
if (e.Row.RowType == DataControlRowType.Header)
{
LinkButton linkButton = new LinkButton();
for (int index = 0; index < StudentsGridView.Columns.Count - 1; index++)
{
if (StudentsGridView.Columns[index].SortExpression == Session["SortColumn"].ToString())
{
if (Session["SortDirection"].ToString() == "ASC")
{
linkButton.Text = "<i class='fa fa-caret-up fa-lg'></i>";
}
else
{
linkButton.Text = "<i class='fa fa-caret-down fa-lg'></i>";
}
e.Row.Cells[index].Controls.Add(linkButton);
}
}
}
}
}
示例8: GridView1_RowCreated
protected void GridView1_RowCreated(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
}
}
示例9: gvList_RowDataBound
protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblUserType = e.Row.FindControl("lblUserType") as Label;
NoName.NetShop.ShopFlow.ExpressInfoModel model = e.Row.DataItem as NoName.NetShop.ShopFlow.ExpressInfoModel;
MemberType userType = (MemberType)model.UserType;
UserLevel userLevel = (UserLevel)model.UserLevel;
switch (userType)
{
case MemberType.Personal:
lblUserType.Text = userLevel.ToString();
break;
case MemberType.Company:
lblUserType.Text = "鼎企会员";
break;
case MemberType.Famly:
lblUserType.Text = "鼎宅会员";
break;
case MemberType.School:
lblUserType.Text = "鼎校会员";
break;
default:
lblUserType.Text = userLevel.ToString();
break;
}
}
}
示例10: GridView1_RowDataBound1
protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((LinkButton)e.Row.Cells[0].Controls[0]).OnClientClick = "if(!confirm('確定要刪除嗎'))return false;";
}
}
示例11: gv_detalle_equipos_RowDataBound
protected void gv_detalle_equipos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.ControlStyle.BackColor = Color.LightGray;
}
}
开发者ID:jfberton,项目名称:SisEquiposBertoncini,代码行数:7,代码来源:planilla_resumen_valores_equipo_categoria.aspx.cs
示例12: GridView1_RowDataBound
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Set the hand mouse cursor for the selected row.
e.Row.Attributes.Add("OnMouseOver", "this.style.cursor = 'hand'; this.style.background = '#003366';");
e.Row.Attributes.Add("OnMouseOut", "this.style.background = '#F9F6F4';");
// The seelctButton exists for ensuring the selection functionality
// and bind it with the appropriate event hanlder.
LinkButton selectButton = new LinkButton()
{
CommandName = "Select",
Text = e.Row.Cells[0].Text
};
selectButton.Font.Underline = false;
selectButton.ForeColor = System.Drawing.Color.Black;
e.Row.Cells[0].Controls.Add(selectButton);
//e.Row.Attributes["OnClick"] =
// Page.ClientScript.GetPostBackClientHyperlink(selectButton, "");
e.Row.Attributes["OnClick"] = Page.ClientScript.GetPostBackClientHyperlink((Control)sender, "Select$" + e.Row.RowIndex);
}
}
示例13: demo_RowCreated
void demo_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.TableSection = TableRowSection.TableHeader;
}
}
示例14: gvPrivilegeList_RowDataBound
protected void gvPrivilegeList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["style"] = "Cursor:pointer";
}
}
示例15: CreateIntroText
public void CreateIntroText(object sender, GridViewRowEventArgs e)
{
string val = string.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRow dr = ((DataRowView)e.Row.DataItem).Row;
TextBox txtEditQuantity = (TextBox)e.Row.FindControl("txtEditQuantity");
txtEditQuantity.Attributes.Add("data-productnumber", dr["ProductNumber"].ToString());
txtEditQuantity.Attributes.Add("data-originalvalue", dr["Quantity"].ToString());
txtEditQuantity.Text = dr["Quantity"].ToString();
if (dataRowCount == 0)
{
// first text field
txtEditQuantity.Attributes.Add("data-intro", "When this value is changed, and you move on to another textbox, it will immediately be saved. A successful save is confirmed by the checkbox icon.");
txtEditQuantity.Attributes.Add("data-step", "3");
txtEditQuantity.Attributes.Add("data-position", "left");
// first product id link
HyperLink hlnkProduct = (HyperLink)e.Row.FindControl("hlnkProduct");
hlnkProduct.Attributes.Add("data-intro", "This loads the product page.");
hlnkProduct.Attributes.Add("data-step", "4");
}
dataRowCount++;
}
}