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

GridViewRowDetailTemp

4 Answers 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Piyush Patel
Top achievements
Rank 1
Piyush Patel asked on 05 Nov 2009, 01:41 PM

I have a RadGridview with itemsource as list. with certain content.

now depending on new content in the list i need to display as bold in RadGridview.

like i need to display the mails in Inbox in a RadGridview... which has both read and unread mails ..if the mail is unread i need to display that Row content  as Bold ..Is this possible?????
In my each record contain "status" field, its contain "False" or "True" value, False-mean unread msg and True-mean read msg

as anyone explain this to me.

 


4 Answers, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 05 Nov 2009, 03:09 PM
Hi Piyush Patel,

Here is how to do it:

using System.Windows;
using System.Windows.Controls;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Data;
 
namespace TicketID_256061_ConditionalRowFormatting
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
 
            this.playersGrid.RowLoaded += new System.EventHandler<Telerik.Windows.Controls.GridView.RowLoadedEventArgs>(playersGrid_RowLoaded);
             
            this.playersGrid.ItemsSource = Club.GetPlayers();
        }
 
        void playersGrid_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            GridViewRow row = e.Row as GridViewRow;
            if (row != null)
            {
                Player player = (Player)e.DataElement;
 
                // Dummy logic -- your will be the real one.
                if (player.Number > 10)
                {
                    row.FontWeight = System.Windows.FontWeights.ExtraBold;
                }
            }
        }
    }
}

I have attached the sample project. I hope it helps.

Sincerely yours,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Piyush Patel
Top achievements
Rank 1
answered on 06 Nov 2009, 08:01 AM
Thank You sir!
I get my answer.
0
Shankar
Top achievements
Rank 1
answered on 16 May 2013, 11:31 PM
@Rossen Hristov,How would this work with Bindings? I have a command which changes some of the property values of the selected rows in the treelist control. Even though I Notify the UI on the entire collection, it does not invoke the rowloaded or dataloaded calls.

Is there any workaround for this?
0
Rossen Hristov
Telerik team
answered on 17 May 2013, 07:19 AM
Hi,

You can use either a CellStyleSelector or a RowStyleSelector to achieve the functionality that Piyush Patel asked about in 2009. You can even change the template of the cell based on certain conditions by using a CellTemplateSelector.

If that is not what you want to achieve, could you please elaborate on your exact problem/question?

Regards,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Piyush Patel
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Piyush Patel
Top achievements
Rank 1
Shankar
Top achievements
Rank 1
Share this question
or