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

Change Radgridview RowFont to Bold

1 Answer 720 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Beatrice
Top achievements
Rank 1
Beatrice asked on 07 Nov 2014, 08:53 PM
Hi,

Is there a way to change a rowfont to Bold based on the criteria in the records?

Example: 
Where I have code "c2.RowFont.Bold = True", it gives me error that Property Bold is read only.

Private Sub SetConditions()
     Dim c1 As New ConditionalFormattingObject("Forecolor Black", ConditionTypes.Equal, "0", "20", True)
     c1.RowForeColor = Color.Black
     grd1.Columns("trd_typ").ConditionalFormattingObjectList.Add(c1)

     Dim c2 As New ConditionalFormattingObject("Forecolor Blue", ConditionTypes.Equal, "3", "", True)
     c2.RowForeColor = Color.Blue
     c2.RowFont.Bold = True
     grd1.Columns("trd_typ").ConditionalFormattingObjectList.Add(c2)

     grd1.TableElement.Update(False)
End Sub

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 10 Nov 2014, 12:09 PM
Hi Beatrice,

Thank you for contacting us.

In this case you the Bold property is indeed read only and in order to change the text style you should change the entire font:
ConditionalFormattingObject obj = new ConditionalFormattingObject("MyCondition", ConditionTypes.Greater, "30", "", true);
obj.RowFont = new Font("Segoe Script", 8, FontStyle.Bold);

Please let me know if there is something else I can help you with.

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Beatrice
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or