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
0
votes
1 answer

How to set a data grid column to be a drop down when binding to a table

I am able to create a data table and bind it to a datagridview. If possible I want something more sophisticated. I want to limit the first column to values 1 to 12 and the 2nd column to either AM or PM. Thanks in advance. mDataTable =…
0
votes
1 answer

Change value type of bound datagridview

I am binding data to a datagridview from a MSSQL database, there are mixed datatypes and I think vb.net by default sets the valuetype of the column/cell based on the data. My requirement is that I want all the columns to have the value type of…
codeGEN
  • 686
  • 2
  • 18
  • 45
0
votes
1 answer

Prevent dataGridView.ReadOnly setting from overriding DataGridViewColumn.ReadOnly setting

I have a datagridview added to my form via the designer, some of the columns in it has their read-only state set to true. The problem is when I try to toggle the datagridviews read-only state the columns read-only state also changes. How do I…
codeGEN
  • 686
  • 2
  • 18
  • 45
0
votes
0 answers

BindingSource Cannot perform 'Like' operation on System.DateTime and System.String

I want to filtre a datagridview using a searchbox , I have a function that works great with strings but I don't know why I get an exception when I use this function with a column that contains int/date values : public void SearchTable(TextBox…
Kimmy
  • 3
  • 2
0
votes
2 answers

CustomDataGridViewColumn vs DataGridViewTextBoxColumn with custom sort

Hi I currently have a DataGridView where the first column contains the name of a person which until now I've been manually setting the value as a string which represents the Person object. The rest of the columns contain other classes/strings. I've…
Notts90
  • 254
  • 2
  • 20
0
votes
0 answers

How to make 1row to 2rows GridView in asp.net?

I have GridView with 5 items like this. I want to make this GridView as below big red square. How can I make 2rows in one GridView? ASP Code :
naanace
  • 363
  • 1
  • 4
  • 17
0
votes
1 answer

maskedEditColumn datagridview how to use class? is it what i need?

I am trying to mask user's input in a datagridview column and i found this ready class Masked edit column Class that adds a 'mask edit column' option in the column types list. When i select this column type a mask field is being added in the list of…
poloapolo
  • 97
  • 2
  • 12
0
votes
1 answer

Unexplainable Column swap on datagridview

I have the following datatable: DataTable dt4 = new DataTable(); dt4.Columns.Add(new DataColumn("Fupcpe10", typeof(double))); dt4.Columns.Add(new DataColumn("Fupcpe1", typeof(double))); …
ng80092b
  • 621
  • 1
  • 9
  • 24
0
votes
1 answer

Convert String to DataGridViewTextBoxColumn using VB.Net and Access

Can't find anything on the internet, I'm thinking I'm missing something small. I've got a list of column names in an access database, which should match DataGridViewTextBoxColumn I've created in my vb.net project. I want to use the column names in…
Jarron
  • 1,049
  • 2
  • 13
  • 29
0
votes
0 answers

DataGridViewColumnSortMode - removing characters appearing in name then sorting alphabetically

My code below brings up a list as shown below the code .Columns(0).SortMode = DataGridViewColumnSortMode.NotSortable The list is fetched from a database so it will be different each time Apples Oranges Pears Cherries Two things i'd like to…
bobbi
  • 1
  • 1
0
votes
0 answers

Datagridview Auto Reording after Add/ Remove

I'm using a vb.net datagridview table for displaying several different types of data. When I need to load new data, I remove the rows and then remove the columns of the current data and then add the columns and rows of the new data. However, when I…
Jarron
  • 1,049
  • 2
  • 13
  • 29
0
votes
1 answer

Adding information to dataGridView's column

I have a cycle for (j = 1; j <= x; j ++) in my programme. In it, if the variable x>1, then dataGridView adds a column, there is a certain element of the array a[j]. How to add a[j] to the new column? for (j = 1; j <= x; j++) { a[j] = (f - z) /…
0
votes
2 answers

How to create custom property of DataGridViewTextBoxColumn in c# win. form

How can i create a property named IsCheck (value true/false) in DataGridViewTextBoxColumn? i searched the internet but cannot find a solution to create property. Please help me with a code snippet or so.
0
votes
1 answer

VB.NET: DataGridView ColumnHeader Text Indent Value

Is it possible to get the DataGridViewColumn Header Text-margin (text-indent) value in VB.NET? I need this to calculate the correct text width with the TextRenderer. Because column width is always larger than the allowed space for column header…
LowLevel
  • 1,085
  • 1
  • 13
  • 34