Questions tagged [datagridviewcolumn]

In WinForms DataGridViewColumn class represents a column in a DataGridView control.

In WinForms DataGridViewColumn class represents a column in a DataGridView control.

516 questions
2
votes
0 answers

Search data in DataGridView using FilterDataRow VB.Net

DV = New DataView(ds.Tables("CustomerList")) FlxCustomerList.DataSource = ds.Tables("CustomerList").DefaultView myDataTable = CType(FlxCustomerList.DataSource, DataView).ToTable drToAdd = myDataTable.NewRow() …
Osama Rizwan
  • 615
  • 1
  • 7
  • 19
2
votes
2 answers

Select only one checkbox from multiple checkbox columns in questionnaire style DataGridView

I've create an application which displays a DataGridView with a series of questions. The dgv structure consists of one string column for the question text and three bool/checkbox columns for the answers (yes, no, N/A). Each single question is…
Paul Alexander
  • 2,686
  • 4
  • 33
  • 69
2
votes
2 answers

How can we make a regular button disabled until the entire dataGridView is completely filled with valid values in C#

I have a datagridview for which I have included couple of validations like cell value not empty and cell value should be in the range of (1,9). I also wanted to make sure a compute button is enabled only after the entire datagridview is filled with…
2
votes
1 answer

FormattedType issue with custom DGV Column/Cell

I've created a custom DataGridView Cell and Column that displays animated images. It's really simple and works fine except that it's throwing a "DataError" event from the DGV: "Formatted value of the cell has a wrong type" I have removed all of the…
scubasteve
  • 2,718
  • 4
  • 38
  • 49
2
votes
2 answers

Formatting Cells in DataGridViewColumn

How can I display the string with value: 12345678 to the user in a datagridview cell as: 1234/56/78. I think I should use the DefaultCellStyle.Format property of the DataGridViewColumn, But I don't know what the appropriate value is. I'm using .NET…
Kamyar
  • 18,639
  • 9
  • 97
  • 171
2
votes
1 answer

What is The difference Between ColumnCount and Columns.Count in DataGridView

I am using datagridview for a lot of things and I think it's a really strong data viewer tool. My Problem is, I am using this code: for (int i = 0; i < dataGridView1.**Columns.Count** - 1; i++) { .... } My question is, what is the…
2
votes
1 answer

How to format a specific item in the ComboBox in a DataGridViewComboBoxColumn?

I have code similar to this in a method that (re)creates the columns in the DataGridView: MyColumn = new DataGridViewComboBoxColumn() { Name = "..", HeaderText = "..", SortMode = DataGridViewColumnSortMode.NotSortable }; …
silviubogan
  • 3,343
  • 3
  • 31
  • 57
2
votes
2 answers

Concatenate value of 2 columns in datagridview (winform)

I have a datagridview that contains bound and unbound column and i want to combine the value of 2 desired bound column (a and b) so the column c (which is unbound) is contained value from a and b Is it possible? Nb : sorry i cant post photos for…
Toletolet
  • 21
  • 2
2
votes
1 answer

DataGridViewCheckBox row returns null until checkbox is clicked

I've created a windows form with a DataGridView and added a column that will contain a checkbox for each row. A DataTable is bound to the DataGridView and then a DataGridViewCheckBoxColumn is added. When my form is closed I attempt to get the value…
2
votes
2 answers

Is there a way to have a WinForms DataGridView with a column displaying multiple values from a record

I am trying to display 2 or 3 values from a record into a single cell row of a DataGridView. Below is a class representing a record to databind to: Class Book { public int BookId {get;set;} public string Title {get;set;} public string…
Robertcode
  • 911
  • 1
  • 13
  • 26
2
votes
1 answer

Windows Forms: Cell Wrapping mode to display adaptive ellipsis

I'm using a Windows Forms Datagridview to diplay some (long) text. (The code is PowerShell, but the problem is related to the Cell Wrapping mode) $TestGridView = New-Object System.Windows.Forms.DataGridView -Property @{ Name="TestDataGridView" …
Aldo
  • 303
  • 1
  • 4
  • 14
2
votes
2 answers

Weird character 'q' problem with DataGridView Custom DataGridViewColumn cell

I've created a custom column for the datagridview deriving it from DataGridViewColumn, DataGridViewTextBoxCell and implementing the IDataGridViewEditingControl. I've created a user control which contains a simple TextBox and I used this control as…
JPReddy
  • 63,233
  • 16
  • 64
  • 93
2
votes
3 answers

C# - How to pass the data from dataGridView1 to another using a button click?

I have a dataGridView1, dataGridView2 and a ButtonAdd in one Form. The user will: 1- select any one "Cell" or the "entire Row". 2-select multiple Rows Then: the data selected will be moved from dataGridView1 to dataGridView2 when the button clicked.…
Mahmoud Ayman
  • 1,157
  • 1
  • 17
  • 27
2
votes
1 answer

Custom DataGridViewCheckBoxCell visual update doesn't work in edit mode

I have the following DataGridViewCheckBoxCell. the problem is the visual update doesn't take place immediately in the edit mode, only when i quit it public class CustomDataGridViewCell : DataGridViewCheckBoxCell { protected override void…
2
votes
1 answer

How can I paint selected rows in a DataGridView based on the values in two of the cells?

I am populating a DataGridView with a semicolon-delimited text file like so: private void ExistingAppntmntRecs_Load(object sender, EventArgs e) { DataTable dt = SeparatedValsFileToDataTable(APPOINTMENTS_FILE_NAME, ";"); …