Datagrid questions

  • Thread starter Thread starter news.microsoft.com.br
  • Start date Start date
N

news.microsoft.com.br

Hi all,

I have two doubts about datagrid in winapp

1 how know when a cell change to edit state and to navigate state?

2) how align the caption text to center?

Thanks a lot

André
 
Andre,

There is no event to determine when a cell is being edited. If you want
to see if something has changed, then upon entry into the cell, you will
have to store the old value, and then compare it with the value of the cell
after the cell is navigated off of.

I don't believe you can center the caption text as well. I believe that
you will have to custom paint the control in order to do this.

Hope this helps.
 
Nicholas,

Speaking of System.Windows.Forms.DataGrid control, it is still possible to
determine when a cell is being edited. This, however, will require
implementing custom DataGridColumnStyles most likely inheriting from
DataGridTextBoxColumn/DataGridBoolColumn and overriding their
Edit/Commit/Abort methods to track the state of cells in these columns.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Nicholas Paldino said:
Andre,

There is no event to determine when a cell is being edited. If you want
to see if something has changed, then upon entry into the cell, you will
have to store the old value, and then compare it with the value of the cell
after the cell is navigated off of.

I don't believe you can center the caption text as well. I believe that
you will have to custom paint the control in order to do this.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

news.microsoft.com.br said:
Hi all,

I have two doubts about datagrid in winapp

1 how know when a cell change to edit state and to navigate state?

2) how align the caption text to center?

Thanks a lot

André
 
Back
Top