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

Cell partial forecolor

1 Answer 44 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris Thierry
Top achievements
Rank 1
Chris Thierry asked on 30 Sep 2011, 02:29 PM
Hi, is there any way of change partial color of a cell? for example I have one cell with two words, I need one of them in red, is this possible?
Thanks.

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 30 Sep 2011, 02:49 PM
Hi Chris Thierry,

 
May you please share with us the source code you are currently using? In case you have predefined the CellTemplate of a column, you may place the first TextBlock in a Border and set its Background property as shown below:


<telerikGrid:GridViewDataColumn DataMemberBinding="{Binding Name)" Header="Name">
   <telerikGrid:GridViewDataColumn.CellTemplate>
       <DataTemplate>
           <StackPanel>
           <Border Background="Red">
             <TextBlock Text="Employee Name:"/>
         </Border>
               <TextBlock Text="{Binding Name}"
                          VerticalAlignment="Center" />
           </StackPanel>
       </DataTemplate>
   </telerikGrid:GridViewDataColumn.CellTemplate>
</telerikGrid:GridViewDataColumn>



All the best,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Chris Thierry
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or