private void dataGridEh1_DataCellValuePush(object sender, DataGridDataValuePushEventArgs e) { int colNum = int.Parse(e.Column.Title.Text); int newRowNum = e.Row.VisibleIndex + 1; ColRowCheckedData colRowData = FindColRowDataByCol(colNum); if (colRowData != null) { int oldRowNum = colRowData.RowNum; colRowData.RowNum = newRowNum; foreach (ColRowCheckedData crd in colRowCheckedList) { if (crd != colRowData && crd.RowNum == newRowNum) { crd.RowNum = oldRowNum; break; } } } dataGridEh1.Invalidate(); gridBaseList.Invalidate(); e.Handled = true; }
private void dataGridTextColumn2_DataCellValuePush(object sender, DataGridDataValuePushEventArgs e) { DataRowView row = (DataRowView)e.Row.SourceItem; TypeConverter converter = TypeDescriptor.GetConverter((Type)row[2]); e.Value = converter.ConvertFrom(e.Value); }