<Grid.Resources> |
<DataTemplate DataType=""> |
<Border Background="LightSlateGray" Padding="10"> |
<Grid> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="60" /> |
<ColumnDefinition Width="*" /> |
</Grid.ColumnDefinitions> |
<Grid.RowDefinitions> |
<RowDefinition Height="20" /> |
<RowDefinition Height="*" /> |
</Grid.RowDefinitions> |
<TextBlock Grid.Column="0" Grid.Row="0" Text="DocumentMasterID"> |
<TextBlock.TextDecorations> |
<TextDecoration Location="Underline" /> |
</TextBlock.TextDecorations> |
</TextBlock> |
<TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding Path=Data[DocumentMasterID]}" /> |
<TextBlock Grid.Column="1" Grid.Row="0" Text="CleanLeadsID"> |
<TextBlock.TextDecorations> |
<TextDecoration Location="Underline" /> |
</TextBlock.TextDecorations> |
</TextBlock> |
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding Path=Data[CleanLeadsID]}" /> |
</Grid> |
</Border> |
</DataTemplate> |
</Grid.Resources> |
Hi, I've been confused by a problem. First, I set RadGridView.ItemSource with a ObservableCollection and selected a row. Then I removed an item from ObservableCollection, the RadGridView.SelectedItem changed to null and did't trigger SelectionChanged Event. Is that by desgin? Thanks.
Version: Q2 2009.2.813.35
RadGridView1_SelectionChanged
RadGridView1_MouseLeftButtonUp
RadGridView1_MouseUp
Because the "SelectionChanged" event, left click does not fire the other two events (only right click).
Is this by design ?
Thanks.
Hello,
I have a problem with exporting RadGridView using ToCsv() andToExcelML() methods.
While using AutoGenerateColumns property set to true everything works fine.
However, when I'm trying to create columns in code in such a way:
Telerik.Windows.Controls.GridViewDataColumn c1 = new Telerik.Windows.Controls.GridViewDataColumn(); |
c1.Header = "Name"; |
c1.CellTemplate = (DataTemplate)this.Resources["NameColumnTemplate"]; |
radGridView.Columns.Add(c1); |
with DataTemplate defined in XAML:
<DataTemplate x:Key="NameColumnTemplate"> |
<TextBlock Text="{Binding Path=Name}"/> |
</DataTemplate> |
In this case everything looks fine and RadGridView displays columns properly, but ToCsv() methods creates a string consist only of white spaces.
Is there any solution to this problem?
Regards
gvSystemTables.SelectedItem = gvSystemTables.Items[System.Convert.ToInt32(gvSystemTables.Items.Count) - 1]; |
gvSystemTables.BringDataItemIntoView(gvSystemTables.Items[System.Convert.ToInt32(gvSystemTables.Items.Count) - 1]); |
Remark:
my visual Studio show me a error "Type or property expected " for the Data when i write the Binding Path=Data.CarouselViewModel.Lib
DataTable
dt = new DataTable();
DataColumn dc = new DataColumn("Lib");
dt.Columns.Add(dc);
DataRow dr = dt.NewRow();
dr[
"Lib"] = "Item1";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[
"Lib"] = "Item2";
dt.Rows.Add(dr);
sampleRadCarousel.ItemsSource = dt;
In my Xaml :
<Style TargetType="{x:Type Controls:CarouselDataRecordPresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Controls:CarouselDataRecordPresenter}">
<StackPanel Margin="0,20,0,0" TextElement.FontWeight="Bold">
<Label Content="{Binding Path=Data[Lib]}"/>
<Label Content="test"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
2) BINDING MODELVIEW
Collection
<CarouselViewModel> ListeCarousel = new Collection<CarouselViewModel>();
CarouselViewModel carouselview = new CarouselViewModel("item1");
ListeCarousel.Add(carouselview);
CarouselViewModel carouselview1 = new CarouselViewModel("item2");
ListeCarousel.Add(carouselview1);
sampleRadCarousel.ItemsSource = ListeCarousel;
In xaml :
<Style TargetType="{x:Type Controls:CarouselDataRecordPresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Controls:CarouselDataRecordPresenter}">
<StackPanel Margin="0,20,0,0" TextElement.FontWeight="Bold">
<Label Content="{Binding Path=Data.CarouselViewModel.Lib}"/>
<Label Content="2"/>
<Label Content="3"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>