tags:

views:

55

answers:

2

I want my datacolumns in my Windows.Forms.Datagrid to show like Excel, red for negative numbers in brackets, and black for positive numbers.

Also i want to right align the cells, but left align the header. Is this possible?

+1  A: 

Something like this should work for alignment:

var cellStyle = new System.Windows.Forms.DataGridViewCellStyle()
cellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
dataGridColumn.DefaultCellStyle = cellStyle 

For coloring you should probably handle some datagrid paint event and select different DataGridViewCellStyle for negative numbers.

Mr. Brownstone
A: 

how to focus grid view rows ..please any one help me

Rajasekar
You need to ask this in your own question, and provide quite a lot more information if you expect answers.
ZombieSheep