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

DataGridViewColumn EditingControl edited value not reflecting

I have a user control which I need to add as a column in a DataGridView. I followed the instructions as shown here. The control gets added correctly, and when I click on the cell, the user control shows up. However, now when I click elsewhere, the…
Fahad
  • 1,364
  • 3
  • 20
  • 40
2
votes
0 answers

Use ComponentModel attributes to auto generate DataGridView columns with custom DataGridViewColumn types?

I'm attempting to use the System.ComponentModel property attributes such as [Browsable(true)] to auto generate columns based on a Datasource defined as a BindingList but am having issues figuring out how to change the column types…
CoryG
  • 2,429
  • 3
  • 25
  • 60
2
votes
2 answers

How to get Column Header Text on double click

I want to take the ColumnHeader Text of the ColumnHeader that has been double clicked. This is what I've gotten so far. It doesn't work. Can anyone help? private void dataGridView1_ColumnHeaderMouseDoubleClick(object sender,…
Josh
  • 115
  • 1
  • 3
  • 17
2
votes
2 answers

delete some row based on cell value before importing to datagridview using c#

I am trying to import excel file to datagridview from stoarage. With the following code I can successfully uploaded two column from my excel file. But I want to modify my excel file progmamicaly before importing it. In my excel sheet one column…
user3193794
  • 105
  • 2
  • 12
2
votes
1 answer

Datagridview Format Column Issue

I am trying to format 2 columns in two different formats first column 4 digit width, i need the output to be 123.4 when the user types in 1234. i tried using __dgw.Columns["column"].DefaultCellStyle.Format = "N1"; but the output is 1,234.0 i dont…
user5130344
2
votes
2 answers

The property of user control always be false in C#?

I create a custom User Control which inherits from DataGridViewColumn. Moreover, I added some properties in the control, but I can't modify them in design-time. Even I set the default value as true, it's still false. code: public class…
Mystic Lin
  • 365
  • 4
  • 15
2
votes
1 answer

How to make custom DataGridViewComboBox dependent only on its DataGridViewComboBoxColumn?

Popular way (1, 2) for custom painting of items in DataGridViewComboBox is handling of event DataGridView1.EditingControlShowing and setting up DrawItem event handlers there: private void dataGridView1_EditingControlShowing( object sender, …
miroxlav
  • 11,796
  • 5
  • 58
  • 99
2
votes
0 answers

Get column value from GridView

I'm new to ASP.NET and I am using GridView to display data on a web page. I also added a button in Gridview called process orders.
MAK
  • 1,250
  • 21
  • 50
2
votes
3 answers

How can I get the sum total of a column in the gridview to a textbox outside the gridview?

In asp.net C#, How can I get the sum total of a column in the gridview to a textbox outside the gridview? Note: Gridview data is not coming from any database it is being entered manually by the user.
user3985746
2
votes
1 answer

Change the type of a DataGridViewColumn using AutoGenerateColumns

I have a query using a dynamic pivot table which will return me a different number of columns to bind to my DataGridView. I am using AutoGenerateColumns = true...which is the only way to display the pivot columns. How can I programmatically make…
2
votes
1 answer

WPF 4.0 - Datagrid column widths & margins with grouping

I've come across a problem related to grouping in the WPF Data Grid where the right hand side margin does not match the left hand side when using an expander control. This issue is more obvious when adding extra margin to the expander. My intention…
wez
  • 21
  • 2
2
votes
2 answers

Datagridview frozen columns on right side

I have a datagridview with the columns col A | col B | ... | col M | col N Now I want to freeze col N on the right side, so that when the user scrolls the datagridview horizontally the columns A,..., M can be scrolled horizontally, but col N…
Joe Vi
  • 473
  • 4
  • 10
2
votes
2 answers

filter datagirdview on input of two text box

this is what i am trying ...: DataView dv = new DataView(table); dv.RowFilter = String.Format("model like '%{0}%'", textBox2.Text); if (!String.IsNullOrEmpty(textBox1.Text)) { dv.RowFilter = String.Format("vendor like '%{0}%'",…
user2137186
  • 817
  • 6
  • 22
  • 39
2
votes
4 answers

How to set the background color for an entire column(indication for Readonly column) in datagridview in c#.net

I have a datagridview in which I want to set readonly to true for two columns. I want to change the color for those columns. Whenever I leave from the cell I'm able to make only the first cell and current cell change color. Remaining cells are not…
user1858718
  • 137
  • 2
  • 3
  • 12
2
votes
1 answer

How to populate DataGridView with textbox and combobox with comboboxcells having different value lists

I have three columns , textbox, combobox and textbox in that order: this.columnLocalName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnLocalAddress = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.columnLocalPort =…