예제 #1
0
        private void DoRowDoubleClick(GridView view, Point pt)
        {
            try
            {
                GridHitInfo info = view.CalcHitInfo(pt);
                if (info.InRow || info.InRowCell)
                {
                    if (info.Column == null)
                    {
                    }
                    else
                    {
                        if ((view.GetRowCellValue(info.RowHandle, "ID")) == DBNull.Value || Convert.ToInt32(view.GetRowCellValue(info.RowHandle, "ID")) <= 0)
                        {
                            return;
                        }

                        GridView1.ClearSelection();
                        GridView1.SelectRows(info.RowHandle, info.RowHandle);

                        roClient.Text     = String.Concat(view.GetRowCellValue(info.RowHandle, "Name").ToString(), " ", view.GetRowCellValue(info.RowHandle, "LastName").ToString());
                        roBDate.Text      = String.IsNullOrEmpty(view.GetRowCellValue(info.RowHandle, "BirdDate").ToString()) ? String.Empty : Convert.ToDateTime(view.GetRowCellValue(info.RowHandle, "BirdDate")).ToShortDateString();
                        roCity.Text       = view.GetRowCellValue(info.RowHandle, "City").ToString();
                        roContact.Text    = view.GetRowCellValue(info.RowHandle, "Contacts").ToString();
                        roPlace.Text      = view.GetRowCellValue(info.RowHandle, "Destination").ToString();
                        roTravelDate.Text = String.IsNullOrEmpty(view.GetRowCellValue(info.RowHandle, "TravelDate").ToString()) ? String.Empty : Convert.ToDateTime(view.GetRowCellValue(info.RowHandle, "TravelDate")).ToShortDateString();
                        roNumber.Text     = view.GetRowCellValue(info.RowHandle, "PersonsNumber").ToString();
                        roChild.Text      = view.GetRowCellValue(info.RowHandle, "Childs").ToString();
                        roComment.Text    = view.GetRowCellValue(info.RowHandle, "Comments").ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }