private void gridView1_ItemClick(object sender, GridViewCellItemEventArgs e) { decimal latitude = Convert.ToDecimal(e.Cell.Items["imageLocation"].Value); decimal longitude = Convert.ToDecimal(e.Cell.Items["labelAddress"].Value); switch (e.CellItem.Name) { case "imagePhone": this.TelCall(e.Cell.Items["labelPhone"].DefaultValue.ToString()); break; case "imageNavigation": this.gps1.GetGps((object sender1, GPSData GPSData) => { if (GPSData.ErrorInfo.Length <= 0 && !GPSData.Longitude.Equals(0)) { GeoPoint start = GeoPoint.Create(GPSData.Longitude, GPSData.Latitude); GeoPoint stop = GeoPoint.Create(longitude, latitude); this.ShowMapRoute(start, stop); } }); break; case "imageLocation": string Adressinfo = e.Cell.Items["labelAddress"].DefaultValue.ToString(); this.ShowMap(latitude, longitude, Adressinfo); break; } }
/// <summary> /// GridView事件 /// </summary> /// <param name="sender"></param> /// <param name="cell"></param> /// <param name="cellItem"></param> private void GridView1_ItemClick(object sender, GridViewCellItemEventArgs e) { try { switch (e.CellItem.Name) { case "imgUserAttention": if (e.Cell.Items["imgUserAttention"].DefaultValue.ToString().Length > 0) { if (e.Cell.Items["imgUserAttention"].DefaultValue.ToString() == ("Attention")) { e.Cell.Items["imgUserAttention"].DefaultValue = "unAttention"; } else { e.Cell.Items["imgUserAttention"].DefaultValue = "Attention"; } } break; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void GridView1_ItemClick(object sender, GridViewCellItemEventArgs e) { if (isGroup == true) { getGroupuserCount(); } else { string userid = e.Cell.Items["lblUSER_ID"].Text; if (string.IsNullOrEmpty(userid) == false) { //添加用户 string token = im.CreateUser(userid, userid, ".\\Image\\" + e.Cell.Items["imgPortraitUri"].DefaultValue + ".PNG"); if (im != null) { //添加联系人到数据库 MessageBox.Show("联系人已添加", (Object s, MessageBoxHandlerArgs args) => Bind()); } else { Toast("联系人添加失败"); } } } }
/// <summary> /// GridView1点击事件 /// </summary> /// <param name="sender"></param> /// <param name="cell"></param> /// <param name="cellItem"></param> private void GridView1_ItemClick(object sender, GridViewCellItemEventArgs e) { try { this.ShowResult = Smobiler.Core.ShowResult.Yes; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// GridView1事件 /// </summary> /// <param name="sender"></param> /// <param name="cell"></param> /// <param name="cellItem"></param> private void GridView1_ItemClick(object sender, GridViewCellItemEventArgs e) { try { switch (e.CellItem.Name) { case "Check": getAmount(); break; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void gridView1_ItemClick(object sender, GridViewCellItemEventArgs e) { decimal totalamount = 0; foreach (GridViewRow item in gridView1.Rows) { bool bo = Convert.ToBoolean(item.Cell.Items["checkBox1"].DefaultValue); if (bo == true) { string str = Convert.ToString(item.Cell.Items["textBox1"].DefaultValue); totalamount = totalamount + Convert.ToDecimal(str); } } label2.Text = totalamount.ToString(); contextMenu1.Show(); }
private void GridView1_ItemClick(object sender, GridViewCellItemEventArgs e) { STATE = e.Cell.Items["STATE"].Value.ToString(); this.ShowResult = Smobiler.Core.ShowResult.Yes; this.Close(); }