<Style x:Key="{x:Type telerik:GridViewIndicatorCell}" TargetType="telerik:GridViewIndicatorCell"> |
<Setter Property="Background" Value="{StaticResource GridViewHeaderCellBackgroundBrush}" /> |
</Style> |
2) How can I change the height of the columns header? This is not working correctly:
<Style TargetType="telerik:GridViewHeaderCell"> |
<Setter Property="Height" Value="50" /> |
</Style> |
3) I've tried this:
<Style TargetType="{x:Type telerik:GridViewCell}"> |
<Setter Property="OverridesDefaultStyle" Value="False" /> |
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" /> |
<Style.Triggers> |
<Trigger Property="Validation.HasError" Value="True"> |
<Setter Property="BorderThickness" Value="1" /> |
<Setter Property="BorderBrush" Value="Red" /> |
<Setter Property="ToolTip" Value="{Binding RelativeSource= {RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" /> |
</Trigger> |
</Style.Triggers> |
</Style> |
but this column doesn't work anymore after that (Cell is empty):
<telerik:GridViewColumn> |
<telerik:GridViewColumn.CellStyle> |
<Style TargetType="{x:Type telerik:GridViewCell}"> |
<Setter Property="Template"> |
<Setter.Value> |
<ControlTemplate TargetType="{x:Type telerik:GridViewCell}"> |
<Border Background="{TemplateBinding Background}" |
BorderBrush="{TemplateBinding BorderBrush}" |
BorderThickness="{TemplateBinding BorderThickness}"> |
<Button Style="{StaticResource GridImageButton}" |
Click="Delete_Click"> |
<Image Source="{StaticResource Delete}" /> |
</Button> |
</Border> |
</ControlTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
</telerik:GridViewColumn.CellStyle> |
</telerik:GridViewColumn> |
Do you know why?
Thanks,
Xavier.
<Window x:Class="GraphTest.Window2" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="Window2" Height="300" Width="300" Loaded="Window_Loaded"> |
<Grid> |
<telerik:RadGridView AutoGenerateColumns="True" telerik:GridViewCell.EditEnded="gridview_EditEnded" telerik:GridViewRow.EditEnded="gridview_RowEditEnded" x:Name="gridview" Grid.Column="0" Grid.Row="0" > |
</telerik:RadGridView> |
</Grid> |
</Window> |
using System.Windows; |
using System.Collections.ObjectModel; |
namespace GraphTest |
{ |
/// <summary> |
/// Interaction logic for Window2.xaml |
/// </summary> |
/// |
public partial class Window2 : Window |
{ |
public Window2() |
{ |
InitializeComponent(); |
} |
private void Window_Loaded(object sender, RoutedEventArgs e) |
{ |
gridview.ItemsSource = new TestList(); |
} |
private void gridview_RowEditEnded(object sender, Telerik.Windows.Controls.GridView.Rows.RecordRoutedEventArgs e) |
{ |
// Never gets called |
MessageBox.Show("Row edit"); |
} |
private void gridview_EditEnded(object sender, Telerik.Windows.Controls.GridView.Cells.CellRoutedEventArgs e) |
{ |
// Never gets called |
MessageBox.Show("Cell edit"); |
} |
} |
public class TestDataEntry |
{ |
public int id { get; set; } |
public string value { get; set; } |
} |
public class TestList : ObservableCollection<TestDataEntry> |
{ |
public TestList() |
{ |
Add(new TestDataEntry() { id = 1, value = "something" }); |
Add(new TestDataEntry() { id = 2, value = "something else" }); |
} |
} |
} |
protected void StartUpdatingCharts(object dummy)
{
foreach (object currentGraph in ActiveGraphs)
{
Thread t = new Thread(UpdateChartInBackground);
t.Start(currentGraph);
}
}
public void UpdateChartInBackground(Object threadContext)
{
GraphControl currentGraph = threadContext as GraphControl;
FillChartWithData(currentGraph);
}
protected override void FillChartWithData(GraphControl graphControl)
{
Dictionary<string, double> returnValues = Msi.GetReservoirData(graphControl.Arguments);
DataSeries series = new DataSeries();
series.Definition.ShowItemLabels = false;
LineSeriesDefinition definition = new LineSeriesDefinition();
definition.ShowItemLabels = false;
definition.ShowPointMarks = false;
//series.Definition = definition; //THIS IS THE LINE THAT CAUSES ALL OF THE PROBLEMS!
foreach (string sectionName in returnValues.Keys)
{
series.Add(new DataPoint(returnValues[sectionName]));
}
ChartArea chartArea = graphControl.RadChart.DefaultView.ChartArea;
chartArea.Dispatcher.BeginInvoke(new UpdateChart(BindDataToChart), chartArea, series);
}
private static void BindDataToChart(ChartArea chartArea, DataSeries series)
{
chartArea.DataSeries.Clear();
chartArea.DataSeries.Add(series);
}
Telerik.Windows.Controls.
RadGridView grid = new Telerik.Windows.Controls.RadGridView();
grid.ItemsSource = e.Result;
grid.IsReadOnly =
true;
grid.SelectionChanged +=
new EventHandler<Telerik.Windows.Controls.SelectionChangeEventArgs>(grid_SelectionChanged);
grid.CanUserSortColumns =
true;
grid.CanUserReorderColumns =
true;
Telerik.Windows.Controls.
RadWindow window = new Telerik.Windows.Controls.RadWindow();
window.Header =
"Product Listing";
window.Content =
null;
window.Content = grid;
window.ShowDialog();
window.Closed +=
new EventHandler<Telerik.Windows.Controls.WindowClosedEventArgs>(window_Closed);
In this example the window's content contains the grid that was pieced together at runtime but the user cannot group by any of the columns.
Is this a bug or am I doing something wrong here?
Thanks