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
1
vote
2 answers

how to copy custom properties when making clone

i am working on a "DataGridView" in C# 3.5, in "winforms" application. I have a custom column is "MaskTextColumn", i have some custom properties in it like : Mask, "PromptChar" etc. When i am making clone of "MaskTextColumn" my customer properties…
Haider Ali Wajihi
  • 2,756
  • 7
  • 51
  • 82
1
vote
0 answers

Adding a control to Cells of a datagridview column

Just a quick question about adding a control to a Datagridview cell when the user clicks it. I want to add either a button or an open dialog button to a cell once the user clicks it. I have the column headers populated from a string array and the…
Dr.Bunny
  • 117
  • 2
  • 3
  • 9
1
vote
1 answer

How to make a specific row in one column editable in datagridview when cellcontentclick in edit column in vb.net

I try it has not succeeded if I uncomment for the code DataGridView2.Columns("Qty").ReadOnly = True then it can be editable but all rows in one column but I want to be editable in the row I select after I click edit and if I move another row then it…
roy
  • 693
  • 2
  • 11
1
vote
2 answers

How to change or remove the null image in a DataGridViewImageColumn including the new Row

How to remove null image in datagridview column image in vb.net? Is there a way to remove null image in datagridview column image? Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar =…
1
vote
0 answers

Datagridview : Make checkbox column read-only

I am using a Datagrid view control to display data. I am using datasource binding to load data. Datagridview column structure is defined and it has one DataGridViewCheckBoxColumn, which I have made readonly at design time. However, this property…
VJOY
  • 3,752
  • 12
  • 57
  • 90
1
vote
1 answer

DataGridView column of arbitrary controls per row (or replicate that appearance)

I have a DataGridView which contains, among other things, a "Feature" column and a "Value" column. The "Feature" column is a DataGridViewComboBoxColumn. What I would like to do, is manipulate the "Value" column, such that it can be one of a number…
Alan O'Brien
  • 151
  • 1
  • 13
1
vote
0 answers

Custom class. Datagridview column text with image

Good afternoon! There is a custom class that adds a text column with an image to the DataGridView. Public Class DataGridViewTextAndImageColumn Inherits DataGridViewTextBoxColumn Private imageValue As Image Private imageSize_Renamed As…
Lider13
  • 47
  • 7
1
vote
2 answers

adding button column to datagrid view causing problems

I have a datagridview binding with data coming from database that works fine. It is loaded with data when the form loads. As per client requirement I have added new button column to datagrid view by using the following code private void…
Glory Raj
  • 17,397
  • 27
  • 100
  • 203
1
vote
1 answer

Datagridview column sorting when clicking on the column header

I have a datagridview with two columns name and price. If I click on the column header, the corresponding column will be sorted in alphabetical order. Do I need to add any event handler for sorting the datagrid view column? Or is there any property…
Glory Raj
  • 17,397
  • 27
  • 100
  • 203
1
vote
0 answers

Text Box values chabged but the binding see it as null

I have a DataGridView that has binding with user class and text boxses the has a binding with each property of the class. My problem is that after clicking on cell the textboxes shows the row values but when I try to save the class has all the…
den is
  • 11
  • 4
1
vote
0 answers

NULLReferenceException for DataGridView when checking for Duplicate Value

I am in the process of making a sample app where the user inputs their information which should be displayed in the datagridview. I am trying to prevent duplicate records from being inputted into the program. However, I am receving this…
CoinBank
  • 47
  • 6
1
vote
1 answer

How to refactor the programmatically building of some DataGridViews columns?

I am trying to build some datagridviews. I am currently using the code shown below. Im wondering if there is a more efficient way to build the columns. I tried this method post, but cant seem to make it work. Does anyone have any suggestions? …
1
vote
1 answer

Limit User input and remove special character in a DataGridView Cell

I have a DataGridView with one DataGridTextBoxColumn. It is a bound to a datasource. The user can enter values such as -$12,345,678.90 (formatting is applied when tabbing out). So what I am trying to achieve is when a user types a value like this: …
Nithin Paul
  • 2,169
  • 3
  • 33
  • 55
1
vote
1 answer

Changing the width of all columns in a DataGridView

We have a DataGridView which has 2048 columns. We must provide a way for the user to increase and decrease the width of all columns in the DataGridView. Currently, we do the following in a button click handler: for (int i = 0; i < dgv.Columns.Count;…
SomethingBetter
  • 1,294
  • 3
  • 16
  • 32
1
vote
1 answer

How to set DataGridView's column name and headertext separately from a single SQL statement?

When I use SQL statement such as select ID as ID, Name as CustomerName, Day1 as BirthDay, Day2 as MemberDay from [Customer] to populate a DataGridView (Named poorly for demonstration purpose), It will name the columns' Name AND…
PiggyChu001
  • 440
  • 6
  • 20