Profile Picture

NDataGridView ignores cell styles

Posted By Pavel Kozak 15 Years Ago
Author
Message
Pavel Kozak
Posted 15 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 10, Visits: 1
Thank you!! Thanks!! Thank you!!

Angel Chorbadzhiev
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hi Pavel,

Fortunately, the solution is simple.

All you need is to setup EnableCellCustomDraw property of the NDataGridView to false.

By doing this you will be able to set Style of the cell.

 

Regards,

Angel.



Pavel Kozak
cry Posted 15 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 10, Visits: 1
Good day. Have a problem. NDataGridView ignores cell styles, all displays with white background. Even such a trivial example:
NDataGridView dataGridView;
dataGridView = new NDataGridView ();
Controls.Add (dataGridView);

dataGridView.Size = new Size (300, 200);
dataGridView.ColumnCount = 2;

DataGridViewRow row = new DataGridViewRow ();
DataGridViewCell cell = new DataGridViewTextBoxCell ();
cell.Value = "asdasda";
cell.Style.BackColor = Color.Red;
row.Cells.Add (cell);
dataGridView.Rows.Add (row);
Although if you enter into edit mode data in the cell then the background changes to a query. Help please, or else lose my job for the choice of components: (



Similar Topics


Reading This Topic