Questions tagged [datagridviewcellstyle]

Represents a Style for DataGridViewCell

Learn more about DataGridViewCellStyle on MSDN.

44 questions
0
votes
1 answer

DataGrid cellstyle depending on datatype

I am trying to create a DataGrid CellStyle that changes control depending on what datatype is in the cell. I have tried many ways for Template/ContentTemplate, with ContentControl/ItemsControl and others, but nothing reacts to anything other than…
Smorkster
  • 322
  • 3
  • 10
0
votes
1 answer

Ag-grid: Change the color of cell only on value change

I want to pass two use cases , Suppose the value of cell is initially 1 If I changed it 2 then color of cell should get changed. If again I, changed back to 1 then color of the cell should not get changed. Here, my 1st use case can successfully…
0
votes
1 answer

ag-grid: highlight duplicated cell values

I am using ag-grid and I would like to highlight cells in a column if the cell values for a particular column are duplicated. The duplicated cells should be highlighted using a red border.
0
votes
1 answer

C# Winforms DataGridView selected cell is clearing cell value

I'm developing a booking system. I'm using multiple DGVs to visually display booked slots for different rooms based on 30 minute slot cells in a DGV, each room has its own DGV. I used a foreach statement on each room to create a new DGV, change the…
0
votes
1 answer

How to pass a value to DGV Cell when its formatted to C2 format

I'm struggling find a specific answer to this question, therefore asking it myself... I have a DataGridView with columns which has the following formatting applied to it: DGV.Columns(3).DefaultCellStyle.Format = "C2" On the form there is a text box…
Pawel
  • 141
  • 1
  • 10
0
votes
2 answers

How to add red border to edited cell in DataGridView after CellValueChanged Event

I have a CellValueChanged event where I add any updated records into an audit table, and I'd like to change the cell border to red to indicate the cell has been updated, within this event: Private Sub PL_DGV_CellValueChanged(sender As Object, e As…
Pawel
  • 141
  • 1
  • 10
0
votes
1 answer

Datagridview Cellformating slows form and causes flicker

I have looked everywhere to try and find a fix for this. I have a datagridview for showing estimates, my organization wanted some formatting based on the estimator and the estimate progress. Below is my code the issue I am having is that the other…
0
votes
0 answers

Is it possible to change the cell.value in a WinFormCore DataGridViewCell

EDIT: As György Kőszeg commented, the way to fi my problem ws to override the ToString() value on my Station class, now its returning the desired value I am populating a DataGridView with a list. My List contains strings, datetime and classes. the…
0
votes
1 answer

Get cell range/location based on value at excel sheet and colour the cell datagridview in c#

I'm displaying the imported excel sheet in data grid view. based on the row name, I'm replacing the specific cell strings. Now I want to colour the specific cells based on their values. private void Replace_strings() { TextInfo textInfo…
hauto3
  • 101
  • 1
  • 3
0
votes
0 answers

C# DataGridView ColumnDefaultCellStyleChanged Don't work

I've tried to catch ColumnDefaultCellStyleChanged event but is not fired when DefaultCellStyle.Format is changed i read this…
0
votes
1 answer

WPF: How to override PART_CellBorder style of GridViewCell?

I have a RadGridView and for one column/Cell of Grid, I want to change it's default "Part_CellBorder" style. I tried many things but I am not getting the proper way to do that. Can anyone suggest what would be the proper way to dynamically change…
user3848036
  • 169
  • 2
  • 6
  • 17
0
votes
1 answer

Change DefaultCellStyle when using a DataTable in Datagridview

*Using Powershell studio but I could work with a C# answer since it's mostly the same except for syntax. Here is the context: I was previously using: $datagridviewInfo.Rows.Add("123", "456") To populate a DataGridView, but I noticed afterwards I…
Rakha
  • 1,874
  • 3
  • 26
  • 60
0
votes
1 answer

asp.net change gridview cell if two table columns got the same value

so i got this little issue with my gridview in asp.net and mysql: I have two tables with several columns. In both tables i have a Column ("Name"). I wanted to Show the whole Table 1 in my gridview and mark the rows that match the values in the…
0
votes
0 answers

How to add multiple controls in datagridview cell in winforms

I want to add a two buttons in a datagridview cell in Winforms, and add click events to both of them. How can I do it?
Raju Vadnala
  • 70
  • 1
  • 12
0
votes
1 answer

Format string value datagridview c#

I am looking to format a value in a datagridview. These values are a string containing a decimal number. (Like "3000" I want to display it with a thousand separator (space), like this: "3,000". I know it can be done by assigning format of…