What are you databinding, and what are you binding to it? I'll assume you're using a DataGridView, which exposes the following event that might be useful to you:
DataBindingComplete
What event you subscribe to kind of depends on what you're looking to do. I know that with web applications, it's pretty common to handle the ItemDataBound event to change the display text in a cell, which you could probably accomplish by handling the CellPainting event of the DataGridView.
You can obtain the value of the cell currently being painted via the DataGridViewCellPaintingEventArgs e.Value property. From there, you could probably take the Graphics property of the DataGridViewCellPaintingEventArgs argument and use the DrawString() method to write a custom string in the cell.
The CellFormatting event may also work if this is what you want to accomplish.
No comments:
Post a Comment