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

DGV ComboBox Cell remain updateable

I have a DataGridView that I want users to be able to add records to directly. This is done by clicking a link beneath the DGV, at which point a new row is programmatically added, and the first visible cell is of ComboBoxCell type. Code excerpt for…
Niall
  • 1,551
  • 4
  • 23
  • 40
0
votes
1 answer

Why is my DGV.MinimumWidth being ignored?

With this code: const int COMMENTS_COLUMN_DESIRED_WIDTH = 412; ... dgv.Columns[COMMENTS_COLUMN].DefaultCellStyle.WrapMode = DataGridViewTriState.True; dgv.Columns[COMMENTS_COLUMN].MinimumWidth =…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
0
votes
2 answers

How can I remove "Column -1" from my DataGridView?

I'm dynamically creating the columns and rows of my DGV, and then populating the cells with the appropriate values. Even though at present the contents are too large for the DataGridView (I set ScrollBars to None), my first column is offset to the…
0
votes
2 answers

How can I fake an "AlternatingColumnsDefaultCellStyle" for the DataGridView?

DataGridView has an "AlternatingRowsDefaultCellStyle," which works like a champ. But I need the opposite sort of demarcation/decoration. Is there a property that can get the column backgrounds to be a different color than the default, or do I need…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
0
votes
4 answers

How to change datadridview columns width that are placed on different TabControl pages

I have a TabControl on my Form with two pages. Each of pages contains a datagridview. On the Form.Load event I am filling my datagridviews from SQL the database and changing some of the column widths for those grids. DataTable GLOBAL_TABLE = new…
mbigun
  • 1,304
  • 4
  • 19
  • 46
0
votes
1 answer

In a DataGridView one column has a filename I want a button in each row to allow the user to input/change the filename and path

The DataGridView is bound to a DataSet. Let's say there is only one column for this example. The 1 column is filename. For each row I need to open the FileOpenDialog to change or update the filename column. How do I add the button? does it have to…
Mike P
  • 1
0
votes
2 answers

Changing Format of column in Data grid view

I have a data grid view that I am populating with a database as its data source. However, the columns with a date as its data type show a date and time while I only want a time. How do I change the format of a data grid view table? Private Sub…
Pejman Poh
  • 493
  • 2
  • 8
  • 20
0
votes
2 answers

Create a simple DataGridView with List of objects and checkbox column (C#)

I have looked at a lot of places and I'm struggling to do this supposedly simple thing. I have a Windows form on which I've to show a simple DataGridView in this form: | (CheckBoxColumn) | FilePath | FileState | Now, there are a couple of problems.…
0
votes
1 answer

datagridvie refresh on save update or delete actions

I am working with datagrid in c#,i want that when i save,update or delete the database with the form the grid will should be refresh (updated) on these actions what should i do to achive this please help thanks
Mayank Mishra
  • 25
  • 1
  • 9
0
votes
1 answer

Why is the DataGridView columns stacked on top of each other?

On a winform, I have a DataGridView and columns within it. For some odd reason, when I run my program, the columns are stacked on top of each other during runtime. No matter what I do, it won't change. I don't know if I am setting certain properties…
ThN
  • 3,235
  • 3
  • 57
  • 115
0
votes
2 answers

Excel sheet cell dispalying Date and time using c#

I am importing Excel sheet into DataGridView.I have one of the cell has date as 05-06-2017.But while dispalyig under DataGridView it is showing 05-06-2017 AM 12:00:00. Can you please help me how can i display only Date. Thanks !
Kiran Reddy
  • 1,055
  • 3
  • 12
  • 19
-1
votes
1 answer

A column named [column name] already belongs to this DataTable in vb.net

I have the following code and I want to bind it to a DataGridView. Public Class Form1 Private _myTable As New DataTable() Private Sub LoadData() Dim item As New List(Of item()) Grid.Bind(item) End Sub Private Sub…
roy
  • 693
  • 2
  • 11
-1
votes
1 answer

Unsubscribe the event handler of textbox inside DatagridView And add again

I am dealing with a problem in which i got struck , which I asked at Events calling twice error on DataGridView . Now a respected member suggest me to remove the eventhandlers of the textbox inside of the datagridview before I add them again . But I…
-1
votes
1 answer

how to filter a datagridview by the current date without time?

I Really need your help guys , i created a table in sql and i displayed it in a datagridview that contains product and date(it's a datatime variable),but what i want is filter products by current date without time (i want products that refers just…
-1
votes
1 answer

Why we cannot delete datagridview columns with delete key in C# on default?

I am creating columns dynamically at runtime. I can delete rows with delete key but I cannot delete columns. Every method I find involves deleting column by column id or column name. In order to do that, I have to find the column name somehow when…
Usama Khan
  • 19
  • 6