Hi, Can you help me to define a style in app.xaml RowSelectorSettings like: <Style x:Key="RowSelector" TargetType="igGrid:RowSelectorCellControl"> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="Margin" Value="0,0,0,0"/> <Setter Property="Foreground" Value="#FF000000"/> <Setter Property="FontFamily" Value="Impact"/> <Setter Property="FontSize" Value="12"/> <Setter Property="BorderBrush" Value="Gray"></Setter> <Setter Property="BorderThickness" Value="1"></Setter>--> <Setter Property="Background" Value="Transparent"></Setter> </Style>
and to be used in page like: <igGrid:XamWebGrid.RowSelectorSettings> <igGrid:RowSelectorSettings Visibility="Visible" EnableRowNumbering="True" Style="{StaticResource RowSelector}"> </igGrid:RowSelectorSettings> </igGrid:XamWebGrid.RowSelectorSettings>
I tried a lot but failed to find any detailed example or reference to accuplish this.
I also tried following in code but it only works with alternate rows:
Style s = new Style(typeof(Infragistics.Silverlight.Controls.Primitives.RowSelectorCellControl));s.Setters.Add(new Setter(Infragistics.Silverlight.Controls.Primitives.RowSelectorCellControl.BackgroundProperty, new SolidColorBrush(Colors.LightGray)));myGrid.RowSelectorSettings.Style = s;
I specifically wants to apply Grid Header Style to RowSelector. Is it possible?
Thanks
Hi,
The following help article explains how to update the Style properties of our controls in blend. And it actually even explains how to do this for the RowSelectorCellControl:
http://help.infragistics.com/Help/NetAdvantage/Silverlight/2009.2/CLR3.5/html/SL_DesignersGuide_Editing_Style_Properties_Using_Expression_Blend.html
This next help article outlines all of the visual elements in the xamWebGrid, and the style properties that you can use to update them:
http://help.infragistics.com/Help/NetAdvantage/Silverlight/2009.2/CLR3.5/html/SL_DesignersGuide_Styling_Points_for_xamWebGrid.html
As for the alternate row problem you're seeing, that's b/c there is a visual state for Alternate rows. You can remove the alternate state from the row selector, or if you don't want alternate rows at all on the grid, even on normal cells, you can switch off the IsAlternateRowsEnabled of the xamWebGrid.
Hope this helps,
-SteveZ
Thanks for immediate reply,
In deed this very good link but it do not provide style level details like what properties are available. and http://help.infragistics.com/Help/NetAdvantage/Silverlight/2009.2/CLR3.5/html/SL_DesignersGuide_Editing_Style_Properties_Using_Expression_Blend.html is possible with Expression Blend only and unfortunately I don't have that. can you provide me example code of this link?
So, if you don't have blend, then you can simply go to your install directory, and access the "Default Styles" folder. I believe you can also access this folder from the StartMenu under the product.
In there you'll find a "XamWebGrid.xaml" file which has all of the default control styles for everything in the xamWebGrid.
You can grab the control you're looking for and paste it into your app.xaml.
Note: to find out what properties exist on the Control for you to modify, you should use the API docs:
http://help.infragistics.com/Help/NetAdvantage/Silverlight/2009.2/CLR3.5/html/Infragistics.Silverlight.XamWebGrid.v9.2.html
Here's a link to the RowSelectorCellControl API:http://help.infragistics.com/Help/NetAdvantage/Silverlight/2009.2/CLR3.5/html/Infragistics.Silverlight.XamWebGrid.v9.2~Infragistics.Silverlight.Controls.Primitives.RowSelectorCellControl_members.html
Hi Stephen,
Your feeds were of great help.In final touch, I was getting error to find related controls in following style (there is incomplete/partial include in XamWebGrid.xaml without assembly directive)
<Style TargetType="igPrim:RowSelectorCellControl">...</Style>as I was using following include by mistakexmlns:igPrim="clr-namespace:Infragistics.Silverlight.Controls.Primitives;assembly=Infragistics.Silverlight.v9.1"
but the correct include is:xmlns:igPrim="clr-namespace:Infragistics.Silverlight.Controls.Primitives;assembly=Infragistics.Silverlight.XamWebGrid.v9.1"
To Summarize:
I used default style from XamWebGrid.xaml and then modified igPrim:RowSelectorCellControl to change the style and also changed there Alternate Item Template. to get required format. By the way we can do the same by code.
Thanks and Regards, Imran Javed Zia