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

Selected Row Style

7 Answers 157 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Don
Top achievements
Rank 1
Don asked on 02 Dec 2009, 06:22 PM
How do I change the Selected row style? I want it to have a border around the row but not use any background fill. I tried following the tutorial in the help file by creating a control level resource definition but that doesn't seem to work. I want it to look like the in place edit of the row but without the fill. Thanks.

7 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 03 Dec 2009, 01:31 PM
Hello Don,

Attached I am sending you a sample which achieves the result you are describing.
The sample changes the both the template of the row and the cell to achieve the desired result.

I hope this fits your case.

All the best,
Kalin Milanov
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
Don
Top achievements
Rank 1
answered on 03 Dec 2009, 03:47 PM
That's pretty close thanks. I actually got it to do that but my issue is that I want the background color of the cell to show through and not be overwritten by the selected style. I tried setting the alph of the brushes but it just shows the background of the grid and not the row that is highlighted. I attached a screen capture so you can see what I mean.

Don
0
Accepted
Kalin Milanov
Telerik team
answered on 09 Dec 2009, 12:28 PM
Hi Don,

 I apologize for the late reply. In the solution I have sent you the current cell is not being highlighted and the row selection is organized in a way to allow the different row colors to show through.

Are you coloring the cells or the rows? There are different approaches for both cases and I have sent you the one for coloring the rows.

Maybe it is best if you can send me a sample so I can review the XAML and provide you with solution for the case you are having.

All the best,
Kalin Milanov
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
Don
Top achievements
Rank 1
answered on 09 Dec 2009, 02:06 PM
Well actually I am setting the cell background and foreground (text color) but there is only one column so from the users perspective it is essentially the same thing. If there is a way to do it on the row I'm open to that. Here is the code I am using.

        /// <summary> 
        /// Handles the RowLoaded event of the grdSwimLanes control.  
        /// </summary> 
        /// <param name="sender">The source of the event.</param> 
        /// <param name="e">The <see cref="Telerik.Windows.Controls.GridView.RowLoadedEventArgs"/> instance containing the event data.</param> 
        private void grdSwimLanes_RowLoaded(object sender, RowLoadedEventArgs e)  
        {  
            if (e.Row is GridViewHeaderRow || e.Row is GridViewNewRow || e.Row is GridViewFooterRow) return;  
            SwimLaneDefinition ld = (SwimLaneDefinition) e.DataElement;  
            Color c = DiagramHelper.ConvertToMediaColor(ld.BackgroundColor);  
            Color cText = DiagramHelper.ConvertToMediaColor(ld.TextColor);  
            e.Row.Cells[0].Background = new SolidColorBrush(c);  
            e.Row.Cells[0].Foreground = new SolidColorBrush(cText);  
        }  
 
 
0
Don
Top achievements
Rank 1
answered on 09 Dec 2009, 03:24 PM
I am now setting the background of the row and that works the way I want it using your example. Thanks for you help.

Don
0
J
Top achievements
Rank 1
answered on 09 Sep 2010, 05:38 AM
Hi,
 I am using telerik radcontrols for silverlight 4 Aug 12  2010 version and I tried to build the sample you provided in the attached zip file(
263625-rowselection.zip
 Please find the attachment in this thread). However I am gettting an error "AlignmentContentPresenter" not available in GridView namespace. It looks like  AlignmentContentPresenter is obsolete in SL4 version for telerik RadGridView. Could you please suggest me how to fix this error as I need to get this working in our application as soon as possible. Any help would be appreciated.

Thanks in advance,
Jo
0
Kalin Milanov
Telerik team
answered on 09 Sep 2010, 08:28 AM
Hi Don,

The solution you got from the forum was created almost an year ago. Since then the template was changed and it no longer uses the AlignmentContentPresenter among other changes.
If you would like to perform some styling I would suggest you read about it in our online help.

l the best,
Kalin Milanov
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.
Tags
GridView
Asked by
Don
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Don
Top achievements
Rank 1
J
Top achievements
Rank 1
Share this question
or