Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Not able to append a red * at the end of a text of a bound data on a grid view during runtime.

What I have tried:

Tried to add a user control with two different label on which first one contains actual grid cell data and second one contains red *. However, not able to replace grid cell's text with user control during runtime.
Posted
Updated 12-Jul-18 8:05am

1 solution

The only way to do that is you handle the DataGridView.CellPainting Event (System.Windows.Forms)[^] and draw both parts of the text yourself.

This may help with some of the structure, but you'll need to use Graphics.DrawString Method (System.Drawing)[^] twice to draw the text and your star.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900