private void listGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string content = e.ToString(); int column = e.ColumnIndex; int row = e.RowIndex; if (listGrid.Columns[column].Name == "Address") { string address1 = listGrid.Rows[row].Cells["Address1"].Value.ToString(); string address2 = listGrid.Rows[row].Cells["Address2"].Value.ToString(); string address3 = listGrid.Rows[row].Cells["Address3"].Value.ToString(); getDataFromServer(address1, address2, address3); } else { string id = listGrid.Rows[row].Cells["codegrid"].Value.ToString(); GlobalVariable.RowIDList.Clear(); for (int i = 0; i < listGrid.Rows.Count; i++) { GlobalVariable.RowIDList.Add(listGrid.Rows[i].Cells["codegrid"].Value.ToString()); } item selecteditem = manager.getitem(Convert.ToInt32(id)); string srt = JsonConvert.SerializeObject(selecteditem); ItemDetail detail = new ItemDetail(srt, "field"); detail.Show(); } }
private void detail_Click(object sender, EventArgs e) { List <string> lst = GlobalVariable.temporaryOwnList.Split(',').ToList(); lst.RemoveAt(lst.Count - 1); foreach (var item in lst) { item selecteditem = manager.getitem(Convert.ToInt32(item)); string srt = JsonConvert.SerializeObject(selecteditem); ItemDetail detail = new ItemDetail(srt, "field"); detail.Show(); } }
private void listGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string content = e.ToString(); int column = e.ColumnIndex; int row = e.RowIndex; string id = listGrid.Rows[row].Cells["codegrid"].Value.ToString(); GlobalVariable.RowIDList.Clear(); for (int i = 0; i < listGrid.Rows.Count; i++) { GlobalVariable.RowIDList.Add(listGrid.Rows[i].Cells["codegrid"].Value.ToString()); } item selecteditem = manager.getitem(Convert.ToInt32(id)); string srt = JsonConvert.SerializeObject(selecteditem); ItemDetail detail = new ItemDetail(srt, "archive"); detail.Show(); }