This question is locked. New answers and comments are not allowed.
Jon Bergquist
Top achievements
Rank 1
Jon Bergquist
asked on 21 Feb 2009, 04:04 AM
I'm trying to style the first row in my grid so that it is non-selectable and has a different background than the other rows. Do you have an example of how to do that?
Thanks
Jon
Thanks
Jon
11 Answers, 1 is accepted
0
Hi Jon Bergquist,
With our latest beta release this can't be done. But you will be able to style individual rows in our next official release Q1 2009. The release is planned for the early March.
If this feature is a showstopper for you, let me know and we'll send you a private build. To send you a private build you should open a support ticket.
Kind regards,
Jordan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
With our latest beta release this can't be done. But you will be able to style individual rows in our next official release Q1 2009. The release is planned for the early March.
If this feature is a showstopper for you, let me know and we'll send you a private build. To send you a private build you should open a support ticket.
Kind regards,
Jordan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon Bergquist
Top achievements
Rank 1
answered on 24 Feb 2009, 02:31 PM
We'll probably just wait for the Q1 release - I wouldn't want to release a private build anyway. Is there a hard date for that release?
Also - is it possible with the beta version to even select an individual row programatically? Also, how do you turn off the mouseover highlighting? I'm looking to remove the option of row level selection by the user.
Thanks
Also - is it possible with the beta version to even select an individual row programatically? Also, how do you turn off the mouseover highlighting? I'm looking to remove the option of row level selection by the user.
Thanks
0
Hi Jon,
We are planning to release in the second week of March.
About selection you can see this post. You can use the SelectionChanged event and clear the selected items.
To turn off the mouse over highlighting you should predefine the template of the row. This will be possible in the upcoming release.
Regards,
Jordan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
We are planning to release in the second week of March.
About selection you can see this post. You can use the SelectionChanged event and clear the selected items.
To turn off the mouse over highlighting you should predefine the template of the row. This will be possible in the upcoming release.
Regards,
Jordan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon Bergquist
Top achievements
Rank 1
answered on 03 Mar 2009, 01:35 AM
Hi - I cannot set the SelectedRecord property. The compiler is telling me there is no setter. I know you guys are rolling Q1 soon but I'm running into some deadlines with my customers and need to get some basic functionality working with the GridView. Is there anyway you can toss me a build? Thanks.
Also - I'm wanting to set the same style for multiple column headers like this:
However I want to bind to different fields. How do I set a staticresource but specify different bindings. thanks.
Jon
Also - I'm wanting to set the same style for multiple column headers like this:
| <UserControl.Resources> |
| <Style x:Key="GridHyperLink" TargetType="telerikGridView:GridViewCell"> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate TargetType="telerikGridView:GridViewCell"> |
| <HyperlinkButton Foreground="Navy" Content="{Binding field1}" HorizontalAlignment="Center" VerticalAlignment="Center" Click="HyperlinkButton_Click"/> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| </UserControl.Resources> |
Jon
0
Hi Jon Bergquist,
Until we release the version that has a SelectedRecord property setter, you can use the record IsSelected property. The line in the example Jordan linked to can be changed to:
this.gridView.Records[0].IsSelected = true;
Unfortunately, we are not quite ready with the custom row styling feature yet -- we had three things that had to happen in order to consider it complete:
Regarding your style/template reuse question, I don't think it is possible to reuse the template and specify different bindings. There may be a way to achieve what you want though by binding to the GridViewCell.Content property in your HyperLinkButton control instance:
<HyperlinkButton Foreground="Navy" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Click="HyperlinkButton_Click"/>
This way the cell content will get set to the value specified by your column binding, and your template won't vary because of your column settings.
All the best,
Hristo Deshev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Until we release the version that has a SelectedRecord property setter, you can use the record IsSelected property. The line in the example Jordan linked to can be changed to:
this.gridView.Records[0].IsSelected = true;
Unfortunately, we are not quite ready with the custom row styling feature yet -- we had three things that had to happen in order to consider it complete:
- a RowLoaded event that would let you manipulate rows as they are created and added to the visual tree;
- a "RowPrepared" event that would let you manipulate rows on each scroll and fire for rows that have already been loaded, but are now being reused by the UI virtualization logic;
- a set of public Style properties for setting custom row styles for the different types of rows.
Regarding your style/template reuse question, I don't think it is possible to reuse the template and specify different bindings. There may be a way to achieve what you want though by binding to the GridViewCell.Content property in your HyperLinkButton control instance:
<HyperlinkButton Foreground="Navy" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Click="HyperlinkButton_Click"/>
This way the cell content will get set to the value specified by your column binding, and your template won't vary because of your column settings.
All the best,
Hristo Deshev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon Bergquist
Top achievements
Rank 1
answered on 05 Mar 2009, 03:16 PM
Thanks for that. The TemplateBinding worked as suggested. With your new release will it be possible to not only style an individual row but also an individual cell? I realize that I will need to conditionally make some grids cells appear blacked out. Also, how does one applying styling to simple silverlight controls like textboxes and buttons. Since those types of controls are not included in your offering (I don't think) I don't get the styling on them when I apply your themes in App.xaml. However, I have seen it work in your demo's so curious how you do that.
Thanks
Jon
Thanks
Jon
0
Hi Jon Bergquist,
Straight to your questions:
Sincerely yours,
Hristo Deshev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Straight to your questions:
- With the new release the RowLoaded event can be used to find a cell in the row and style it as needed.
- Styling text boxes and buttons inside the grid in Silverlight will not be very easy. The best approach I can think of is by assigning cell styles to your columns and modifying the cell templates, so that they contain styled text boxes and controls. The controls styled in our demos are styled in the examples and the demo app as well. They are not a part of the suite, but I you can use those styles in your app if you wish to.
Sincerely yours,
Hristo Deshev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon Bergquist
Top achievements
Rank 1
answered on 06 Mar 2009, 03:23 PM
Sorry - I don't think I was clear. Great news about the individual styling. All I'm wanting to do is make certain cells "grayed out" and disabled. What I was asking re: the buttons and text boxes is how to style them (not within the gridview). I want to apply the theme I defined in App.xaml to non telerik controls like stand-alone buttons and text boxes. I'm defining my style like this:
Telerik.Windows.Controls.Theme.ApplicationTheme = "Telerik.Windows.Themes.Office_Black";
Thanks
Telerik.Windows.Controls.Theme.ApplicationTheme = "Telerik.Windows.Themes.Office_Black";
Thanks
0
Hi Jon Bergquist,
I think I got you now. Our Silverlight themes, at the moment contain styles for the standard controls, but they won't be applied from App.xaml automatically. You will have to set an attached property to every control in order to style it with our theme styles. The syntax will look like this:
<Button telerik:StyleManager.Theme="Office_Black" ... />
Greetings,
Hristo Deshev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I think I got you now. Our Silverlight themes, at the moment contain styles for the standard controls, but they won't be applied from App.xaml automatically. You will have to set an attached property to every control in order to style it with our theme styles. The syntax will look like this:
<Button telerik:StyleManager.Theme="Office_Black" ... />
Greetings,
Hristo Deshev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon Bergquist
Top achievements
Rank 1
answered on 20 Mar 2009, 09:25 PM
Can't get this to work. I've tried:
<RadioButton telerik:Theming.Theme="Telerik.Windows.Themes.Office_Black" />
and I get parsing errors when I load the page.
and the following will not compile. I'm assuming telerik = xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" ?
<RadioButton telerik:StyleManager.Theme="Office_Black"/>
Thanks
<RadioButton telerik:Theming.Theme="Telerik.Windows.Themes.Office_Black" />
and I get parsing errors when I load the page.
and the following will not compile. I'm assuming telerik = xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" ?
<RadioButton telerik:StyleManager.Theme="Office_Black"/>
Thanks
0
Hello Jon Bergquist,
Sorry for the late response,
Setting Office_Black is done different from the other themes. This is because you already have the resource in the assembly (no need to add reference to Office_Black assembly).
This is how you can do it:
The project have reference only to Telerik.Windows.Controls assembly.
Let me know if you need more information.
Best wishes,
Hristo
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Sorry for the late response,
Setting Office_Black is done different from the other themes. This is because you already have the resource in the assembly (no need to add reference to Office_Black assembly).
This is how you can do it:
| <UserControl x:Class="SilverlightApplication26.Page" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" |
| Width="400" Height="300"> |
| <UserControl.Resources> |
| <telerik:Theme x:Key="defaultTheme" |
| Source="/Telerik.Windows.Controls;component/Themes/generic.xaml" /> |
| </UserControl.Resources> |
| <StackPanel x:Name="LayoutRoot" Background="White"> |
| <RadioButton Content="I have Theme" |
| telerik:StyleManager.Theme="{StaticResource defaultTheme}" /> |
| <RadioButton Content="I don't have Theme" /> |
| </StackPanel> |
| </UserControl> |
The project have reference only to Telerik.Windows.Controls assembly.
Let me know if you need more information.
Best wishes,
Hristo
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.