This is a migrated thread and some comments may be shown as answers.

Adding red font to literal control in grid

1 Answer 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 04 Jan 2013, 12:57 PM
Hi,
In the insert command, i am cancelling the insert event on a condition. However i would like to show the message in red color and different font. I have used the code as below:

radgrid1.Controls.Add(new LiteralControl("Please enter the Data before Inserting the data"));
               e.Canceled = true;
               return;


How to achieve this?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Jan 2013, 05:14 AM
Hi Venkatesh,

Try the following code snippet to achieve your scenario.

C#:
radgrid1.Controls.Add(new LiteralControl("<font style='color:Red;'>Please enter the Data before Inserting the data</font>"));

Hope this helps.

Regards,
Princy.
Tags
Grid
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or