本文整理汇总了C#中GridViewSelectEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridViewSelectEventArgs类的具体用法?C# GridViewSelectEventArgs怎么用?C# GridViewSelectEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridViewSelectEventArgs类属于命名空间,在下文中一共展示了GridViewSelectEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SeatingGridView_SelectedIndexChanged
protected void SeatingGridView_SelectedIndexChanged(object sender, GridViewSelectEventArgs e)
{
//extarct the table number in the party and the awaiter ID from the grid view
//will also create the time from the mockDateTime contrtorls at the top of this form
//once the date uis collected then it will ne sent to the BLL for processeing
//the comman will be done under the control of the MessegeUserControll
//so if there is an error the MUS will handle it.
// we wll use the Inline MUC tryRun technique
MessageUserControl.TryRun(() =>
{
//obtain the selected grid view
GridViewRow agvrow = SeatingGridView.Rows[e.NewSelectedIndex];
//asscessing a wen control on the gridview row
//uses .FindControl("xxx") as a datatype
string tablenumber = (agvrow.FindControl("TableNumber") as Label).Text;
string numberinparty = (agvrow.FindControl("NumberInParty")as TextBox).Text;
string waiterID = (agvrow.FindControl("WaiterList") as DropDownList).SelectedValue;
DateTime when = Mocker.MockDate.Add(Mocker.MockTime);
//standerd call insert a record to the DB
AdminController sysmgr = new AdminController();
sysmgr.SeatCustomer(when, byte.Parse(tablenumber), int.Parse(numberinparty), int.Parse(waiterID));
//refresh the gridview
SeatingGridView.DataBind();
}, "Customer Seated", "New Wall-in Customer has been saved"
);
}
示例2: GridView1_SelectedIndexChanging
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
lbl.Text = "";
int id = Convert.ToInt16(ViewState["ind"]);
try
{
GridView1.Rows[id].BackColor = System.Drawing.Color.White;
}
catch (System.ArgumentOutOfRangeException)
{
GridView1.Rows[0].BackColor = System.Drawing.Color.White;
}
Session["id"] = Convert.ToInt16(GridView1.DataKeys[e.NewSelectedIndex].Value);
txtpos.Text = ((Label)GridView1.Rows[e.NewSelectedIndex].FindControl("Label2")).Text;
txtloc.Text = ((Label)GridView1.Rows[e.NewSelectedIndex].FindControl("Label3")).Text;
txtdet.Text = ((Label)GridView1.Rows[e.NewSelectedIndex].FindControl("Label4")).Text;
txtqual.Text = ((Label)GridView1.Rows[e.NewSelectedIndex].FindControl("Label5")).Text;
txtsal.Text = ((Label)GridView1.Rows[e.NewSelectedIndex].FindControl("Label6")).Text;
string sta = ((Label)GridView1.Rows[e.NewSelectedIndex].FindControl("Label7")).Text;
foreach (ListItem item in drpStatus.Items)
{
if (item.Text == sta)
{
drpStatus.SelectedItem.Text = sta;
}
}
btnAdd.Visible = false;
Button1.Visible = true;
ViewState["ind"]=e.NewSelectedIndex;
GridView1.Rows[e.NewSelectedIndex].BackColor = System.Drawing.Color.YellowGreen;
}
示例3: gvList_SelectedIndexChanging
protected void gvList_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
pid = (int)gvList.DataKeys[e.NewSelectedIndex][0];
BindData(pid);
dvBasePay.Visible = true;
btn_Add.Enabled = true;
}
示例4: gv_List_SelectedIndexChanging
protected void gv_List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
int id = (int)gv_List.DataKeys[e.NewSelectedIndex][0];
CM_ClientBLL bll = new CM_ClientBLL(id);
Response.Redirect("~/SubModule/SVM/SalesVolumeBatchInput.aspx?Type=2&ClientID=" + id.ToString());
}
示例5: SeatingGridView_SelectedIndexChanging
protected void SeatingGridView_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
// extract the table number, number in party and the waiter ID
// from the GridView.
// we will also create the time from the MockDateTime control at the top of this
// form. Typically, you would use DateTime.Today for current dateTime
//once the data is collected, then it will be sent to the BLL for processing
// the command will be done under the control of the MessageUserControl
// if there is an error, the MUC can handle it.
// We will use the inlinc MUC TryRun technique
MessageUserControl.TryRun(() =>
{
//obtain the selected gridview row
GridViewRow agvrow = SeatingGridView.Rows[e.NewSelectedIndex];
// accessing a web control on the gridview row uses.FindControl("xxx") as dataType
string tableNumber = (agvrow.FindControl("TableNumber") as Label).Text;
string numberinparty = (agvrow.FindControl("NumberInParty") as TextBox).Text;
string waiterid = (agvrow.FindControl("WaiterList") as DropDownList).SelectedValue;
DateTime when = //DateTime.Parse(SearchDate.Text).Add(TimeSpan.Parse(SearchTime.Text));
Mocker.MockDate.Add(Mocker.MockTime);
//standard call to insert a record into the database
AdminController sysmgr = new AdminController();
sysmgr.SeatCustomer(when, byte.Parse(tableNumber), int.Parse(numberinparty), int.Parse(waiterid));
//refresh the GridView
SeatingGridView.DataBind();
}, "Customer Seated", "New walk-in customer has been saved");
}
示例6: JobsGridView_SelectedIndexChanging
protected void JobsGridView_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
int jobID = int.Parse(JobsGridView.DataKeys[e.NewSelectedIndex].Value.ToString());
JobStatus status = Brentwood.GetJobStatusByJob(jobID);
Context.Items.Add("JobID", jobID);
Server.Transfer("Jobs/JobPage.aspx");
}
示例7: GridViewVillages_SelectedIndexChanging
protected void GridViewVillages_SelectedIndexChanging(object sender,
GridViewSelectEventArgs e)
{
GridViewRow row = GridViewVillages.Rows[e.NewSelectedIndex];
int villageId = Misc.String2Number(row.Cells[0].Text.Trim());
PanelStats.Visible = true;
TotalStats.Visible = true;
string srcTable = "Goods";
DataBase dataBase = new DataBase();
DataSet dataSet = dataBase.GetGoods(srcTable, villageId);
DataRow dataRow = dataSet.Tables[srcTable].Rows[0];
string inputWood = dataRow.ItemArray[0].ToString();
string inputClay = dataRow.ItemArray[1].ToString();
string inputIron = dataRow.ItemArray[2].ToString();
string inputCrop = dataRow.ItemArray[3].ToString();
string inputVillageName = dataRow.ItemArray[4].ToString();
LabelGoodsWood.Text = inputWood;
LabelGoodsClay.Text = inputClay;
LabelGoodsIron.Text = inputIron;
LabelGoodsCrop.Text = inputCrop;
int wood = Misc.String2Number(inputWood);
int clay = Misc.String2Number(inputClay);
int iron = Misc.String2Number(inputIron);
int crop = Misc.String2Number(inputIron);
int total = wood + clay + iron + crop;
LabelGoodsTotal.Text = total.ToString();
LabelVillageName.Text = inputVillageName;
srcTable = "Reports";
dataBase = new DataBase();
dataSet = dataBase.GetLast5Reports(srcTable, villageId);
RepeaterReports.DataSource = dataSet;
RepeaterReports.DataMember = srcTable;
RepeaterReports.DataBind();
}
示例8: gvUser_SelectedIndexChanging
protected void gvUser_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
//获取当前行用户的编号
string userName = gvUser.DataKeys[e.NewSelectedIndex].Value.ToString();
//编写SQL语句,查询当前行的用户锁定状态
string sqlSel = "select lock from userRegister where userName='" + userName+"'";
//获取锁定状态
string userLock = operateData.getTier(sqlSel);
//判读是否已被锁定
if (userLock == "False")
{
//打开锁定原因窗口
RegisterStartupScript("false", "<script>window.open('lockCause.aspx?userName=" +userName + "','','width=310,height=190')</script>");
//设置为锁定
userLock = "1";
}
else
{
//设置为未锁定
userLock = "0";
}
//编写SQL语句,更新当前用户的锁定状态
string sqlUpd = "update userRegister set lock='" + userLock + "' where userName='" + userName + "'";
operateData.execSql(sqlUpd);
//调用自定义方法显示用户信息
bindGvUser();
}
示例9: gvExclusion_SelectedIndexChanging
protected void gvExclusion_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
try
{
GridView gvSender = (GridView)sender;
int key = (int)gvSender.DataKeys[e.NewSelectedIndex].Value;
string name = "";
AccountContactSelectedTypes selectedType;
switch (gvSender.ID)
{
case "gvContacts":
selectedType = AccountContactSelectedTypes.Contact;
name = gvSender.Rows[e.NewSelectedIndex].Cells[0].Text + " (" + gvSender.Rows[e.NewSelectedIndex].Cells[1].Text + ")";
break;
default:
selectedType = AccountContactSelectedTypes.Account;
name = gvSender.Rows[e.NewSelectedIndex].Cells[1].Text + " (" + gvSender.Rows[e.NewSelectedIndex].Cells[0].Text + ")";
break;
}
Selection.Add(new AccountContactSelectedDetails(key, selectedType, name));
gvSelection.DataSource = Selection;
gvSelection.DataBind();
gvSender.DataBind();
}
catch (ApplicationException ex)
{
lblErrorMessage.Text = ex.Message;
}
}
示例10: gv_List_SelectedIndexChanging
protected void gv_List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
//Response.Redirect("DistributorDetail.aspx?ClientID=" + gv_List.DataKeys[e.NewSelectedIndex]["ID"].ToString());
int id = (int)gv_List.DataKeys[e.NewSelectedIndex][0];
Session["ClientID"] = id;
if (Request.QueryString["URL"] != null) Response.Redirect(Request.QueryString["URL"]);
}
示例11: GridView1_SelectedIndexChanging
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{//accept
try
{
DataTable dt,dt1;
string sql5 = "select * from policyrequest where status='pending' ;";
dt = d1.GetData(sql5);
string i = (dt.Rows[e.NewSelectedIndex][0]).ToString();
string cmd = "update policyrequest set status='accept' where id= " + i + ";";
string cmd2 = "select * from policyrequest where id='"+i+"'";
dt1 = d1.GetData(cmd2);
string sql1 = "Select max(id)+1 as count from emp_policy";
dt = d1.GetData(sql1);
string id_ = (dt.Rows[0][0]).ToString();
string cmd3 = "insert into emp_policy values("+id_ +",'"+dt1.Rows[0][1].ToString()+"','"+ dt1.Rows[0][2].ToString()+"',"+dt1.Rows[0][3]+");";
int b1 = d1.InsertData(cmd3);
int b = d1.Updatedata(cmd);
if (b > 0)
{
Label1.Text = "Request accepted successfully...";
Response.Redirect("admin_policyrequest.aspx");
}
else
Label1.Text = "Request accepting Failed...";
}
catch (Exception ex) {
Label1.Text = "Error in accepting the request..."+ex.ToString();
}
}
开发者ID:jithurjacob,项目名称:Semester-5-IT-.Net---Employee-Management-System,代码行数:34,代码来源:admin_policyrequest.aspx.cs
示例12: grvMasoVietGap_SelectedIndexChanging
protected void grvMasoVietGap_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
int iMasoVietGapID = Convert.ToInt32(grvMasoVietGap.DataKeys[e.NewSelectedIndex].Values["PK_iMasoVietGapID"].ToString());
MasovietgapEntity oMasoVietGap = MasovietgapBRL.GetOne(iMasoVietGapID);
if (oMasoVietGap != null)
{
txtMaso.Text = oMasoVietGap.sMaso;
txtNgaycap.Text = oMasoVietGap.dNgaycap.ToString("dd/MM/yyyy");
txtNgayhethan.Text = oMasoVietGap.dNgayhethan.ToString("dd/MM/yyyy");
txtThoihan.Text = oMasoVietGap.iThoihan.ToString();
CosonuoitrongEntity oCosonuoitrong = CosonuoitrongBRL.GetOne(oMasoVietGap.FK_iCosonuoitrongID);
txtDiachi.Text = oCosonuoitrong.sAp + ", " + oCosonuoitrong.sXa +", "+ QuanHuyenBRL.GetOne(oCosonuoitrong.FK_iQuanHuyenID).sTen + ", " + TinhBRL.GetOne(QuanHuyenBRL.GetOne(oCosonuoitrong.FK_iQuanHuyenID).FK_iTinhThanhID).sTentinh ;
pnlEdit.Visible = true;
if (Convert.ToInt16(Session["GroupID"].ToString()) == 4)
{
ddlTochucchungnhan.Visible = false;
txtTochucchungnhan.Text = TochucchungnhanBRL.GetOne(oMasoVietGap.FK_iTochucchungnhanID).sTochucchungnhan;
txtTochucchungnhan.Visible = true;
}
else if (Convert.ToInt16(Session["GroupID"].ToString()) == 1)
{
ddlTochucchungnhan.Visible = true;
napDllTochuccapphep();
if (ddlTochucchungnhan.Items.Count > 0)
ddlTochucchungnhan.SelectedValue = oMasoVietGap.FK_iTochucchungnhanID.ToString();
txtTochucchungnhan.Text = "";
txtTochucchungnhan.Visible = false;
}
if (ddlCosonuoitrong.Items.Count > 0)
ddlCosonuoitrong.SelectedValue = oMasoVietGap.FK_iCosonuoitrongID.ToString();
btnOk.CommandArgument = oMasoVietGap.PK_iMasoVietGapID.ToString();
}
}
示例13: gv_SelectedIndexChanging
protected void gv_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
StockAdjustHelper.RemoveVehicle(e.NewSelectedIndex);
StockAdjustHelper.SaveSession();
e.Cancel = true;
gv.DataBind();
}
示例14: BillItems_SelectedIndexChanging
protected void BillItems_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
e.Cancel = true; // to prevent any other processing in the GridView's default Select handling
GridView sendingGridView = sender as GridView;
GridView receivingGridView;
if (sendingGridView == OriginalBillItems)
receivingGridView = NewBillItems;
else
receivingGridView = OriginalBillItems;
GridViewRow row = sendingGridView.Rows[e.NewSelectedIndex];
// 1) get the info from the column
OrderItem item = GetOrderItem(row);
// 2) move it to the other gridview
List<OrderItem> newItems = GetRowsFrom(receivingGridView);
newItems.Add(item);
receivingGridView.DataSource = newItems;
receivingGridView.DataBind();
// 3) take it out of this list
List<OrderItem> myItems = GetRowsFrom(sendingGridView);
myItems.RemoveAt(e.NewSelectedIndex);
sendingGridView.DataSource = myItems;
sendingGridView.DataBind();
// 4) happy dance
}
示例15: SeatingGridView_SelectedIndexChanging
protected void SeatingGridView_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
//extract tablenumber, waiterid, numberinparty from the gridview
// we will also create a datetime variable using the mock clock at the top of
//the page. (Typically in real-time you use use DateTime.Today)
//once the data is collected it will be passed to the BLL from processing
//the command will be done under the control of the MessageUserControl
//we will use the MUC inline technique
MessageUserControl.TryRun(() =>
{
//obtain our data from the GridView row
GridViewRow agvrow = SeatingGridView.Rows[e.NewSelectedIndex];
//accessing a web control on thee gridview row
//the command to do this is .FindControl("xxxx") as datatype
//all data from the gridview is a string
string tablenumber = (agvrow.FindControl("TableNumber") as Label).Text;
string numberinparty = (agvrow.FindControl("NumberInParty") as TextBox).Text;
string waiterid = (agvrow.FindControl("WaiterList") as DropDownList).SelectedValue;
DateTime when = DateTime.Parse(SearchDate.Text).Add(TimeSpan.Parse(SearchTime.Text));
//standard typical call to your controller in the BLL
AdminController sysmgr = new AdminController();
sysmgr.SeatCustomer(when, byte.Parse(tablenumber),
int.Parse(numberinparty),
int.Parse(waiterid));
//refresh the gridview
SeatingGridView.DataBind();
},"Customer Seated","New walk-in customer has been saved");
}