<
telerik:GridViewComboBoxColumn
Header
=
"Location"
DataMemberBinding
=
"{Binding LocationId}"
UniqueName
=
"LocationId"
ItemsSourceBinding
=
"{Binding Path=Locations,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
SelectedValueMemberPath
=
"Id"
DisplayMemberPath
=
"Name"
/>
public class MyViewModel{
public BindingList<
Employee
> Employees { //The grid binds to this list}
}
public class Employee{
public string Name{...}
public int SelectedLocationId {...}
public BindingList<
Location
> Locations {...} //Binds to combobox in grid.
//Location class has Name and Id property
}
private RadDocument CreateHeaderDocument(List<
GridViewBoundColumnBase
> columns)
{
RadDocument document = new RadDocument();
Section section = new Section();
Paragraph paragraph = new Paragraph();
paragraph.FontSize = fontSize;
PageField pageField = new PageField()
{
DisplayMode = FieldDisplayMode.Result
};
FieldRangeStart pageFieldStart = new FieldRangeStart();
pageFieldStart.Field = pageField;
FieldRangeEnd pageFieldEnd = new FieldRangeEnd();
pageFieldEnd.Start = pageFieldStart;
paragraph.Inlines.Add(pageFieldStart);
paragraph.Inlines.Add(pageFieldEnd);
FieldRangeStart numPagesFieldStart = new FieldRangeStart();
numPagesFieldStart.Field = new NumPagesField()
{
DisplayMode = FieldDisplayMode.Result
};
FieldRangeEnd numPagesFieldEnd = new FieldRangeEnd();
numPagesFieldEnd.Start = numPagesFieldStart;
var ofSpan = new Span(" of ");
ofSpan.FontFamily = fontFamily;
ofSpan.FontSize = fontSize;
ofSpan.FontWeight = FontWeights.Bold;
ofSpan.ForeColor = Color.FromArgb(255, 0, 0, 0);
paragraph.Inlines.Add(ofSpan);
paragraph.Inlines.Add(numPagesFieldStart);
paragraph.Inlines.Add(numPagesFieldEnd);
section.Blocks.Add(paragraph);
var hdrPara = new Telerik.Windows.Documents.Model.Paragraph();
hdrPara.Background = _headerBackground;
var spaceWidth = GetScreenSize("i", fontFamily, fontSize, FontWeights.Bold, FontStyles.Normal, FontStretches.Normal).Width;
foreach (GridViewBoundColumnBase col in columns)
{
String s = String.Empty;
if (col.Header != null)
{
s = col.Header as String;
}
var span = new Telerik.Windows.Documents.Model.Span(s);
span.FontFamily = fontFamily;
span.FontSize = fontSize;
span.FontWeight = FontWeights.Bold;
span.ForeColor = Color.FromArgb(255, 0, 0, 0);
var hdrWidth = GetScreenSize(span.Text, span.FontFamily, span.FontSize, span.FontWeight, FontStyles.Normal, FontStretches.Normal).Width;
var spaces = (col.ActualWidth - hdrWidth) / spaceWidth;
for (int i = 0; i < spaces; i++)
{
span.Text += " ";
}
hdrPara.Inlines.Add(span);
}
section.Blocks.Add(hdrPara);
document.Sections.Add(section);
return document;
}
<Window x:Class="GalleryView3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525" MinWidth="350"> <Grid> <Border BorderThickness="3" MinWidth="100" MinHeight="100"> <ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Name="TabGalleryListView" ItemsSource="{Binding Source}" SelectionChanged="SelectionChanged"> <ListView.ItemsPanel> <ItemsPanelTemplate> <telerik:VirtualizingWrapPanel IsItemsHost="True" Orientation="Horizontal" /> <!--<WrapPanel IsItemsHost="True" Orientation="Horizontal" />--> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate> <StackPanel Margin="10,10,10,10" Orientation="Vertical"> <Border BorderThickness="3" BorderBrush="Black"> <Image Width="128" Height="128" Source="{Binding ImageSource}" Stretch="Uniform" /> </Border> <StackPanel Orientation="Horizontal" Margin="0,10,0,0" > <CheckBox Margin="0,0,5,0" VerticalAlignment="Center"/> <TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Text="{Binding DisplayText}" Foreground="Red"/> </StackPanel> </StackPanel> </DataTemplate> </ListView.ItemTemplate> </ListView> </Border> </Grid> </Window>
Hi,
We had a RadGrid on a form and we are changing cell background of cells manually depending on values in the cells. ANd it works fine but when we scroll down and then back to up then applied colors are meshed up and applied incorrectly
We are using 2011.2.920.40 version of WPF controls.
Thanks
<
telerik:RadGridView
Name
=
"ExceptionsListBox"
IsReadOnly
=
"True"
ReorderColumnsMode
=
"Interactive"
UseLayoutRounding
=
"False"
EnableRowVirtualization
=
"True"
AutoGenerateColumns
=
"False"
RowIndicatorVisibility
=
"Collapsed"
Background
=
"#FF202020"
RowHeight
=
"20"
GroupPanelBackground
=
"#FF202020"
GroupPanelForeground
=
"white"
telerik:StyleManager.Theme
=
"Expression_Dark"
Grouped
=
"ExceptionsListBox_Grouped"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Key}"
Header
=
"Type"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding TypeText}"
Header
=
"Error"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Message}"
Header
=
"Error Message"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.Resources
>
<
Style
TargetType
=
"telerik:GridViewHeaderRow"
>
<
Setter
Property
=
"MinHeight"
Value
=
"15"
/>
</
Style
>
<
Style
TargetType
=
"telerik:GridViewGroupPanel"
>
<
Setter
Property
=
"MinHeight"
Value
=
"10"
/>
<
Setter
Property
=
"Height"
Value
=
"10"
/>
</
Style
>
</
telerik:RadGridView.Resources
>
</
telerik:RadGridView
>
Hi Team Telerik,
My Code to list spell Check Suggestions in the Context Menu upon right clicking
on the wrongly added text in the RichTextBox is n't working any more.
Actually what I did is
:-
1. Enabled Richtextbox spell check property.
2) Enabled Richtextbox ContextMenu Enabled Property
3) Read * .tdf file as
stream and load dictionary directly from the tdf stream
Private Sub LoadDictionary(ByVal tdfFileStream As Stream)
Dim dictionary As New RadDictionary()
dictionary.Load(tdfFileStream)
CType(Me.radRichTextBox.SpellChecker, DocumentSpellChecker).AddDictionary(dictionary, CultureInfo.CurrentCulture)
End Sub
RadRichtextBox
property IsContextMenuEnabled is set to True ,but it is not working.
Is there any property to show spell
Check Suggestions apart from customizing the Context menu ?
Will it show the spell Check Suggestions in the Context Menu by adding the
Reference to Telerik.Windows.Documents.Proofing.Dictionaries.En-US.dll
assembly by default ?
Does anyone have any suggestions why this may be?
Thank you for your time,
Lakshmi