Could you tell me how to implement xamGauge as a UserControl that can be load to a second SplitPane?
The example in the online documentation does not work for my case.
Hello,
Thank you for your post. I have created a sample application for you that demonstrates how you can create a UserControl with a XamRadialGauge in it and use it in a SplitPane of a XamDockManaged.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thank you very much.
A novice in your wonderful world of Infragistics.
I am very glad that the sample application that I have sent you was helpful. Please let me know if you need any further assistance on the matter.
Thank you very much. It is very helpful.
I have another question: how do you create color bars along with tickmarks for the gauge? It is that I have limits like from 0 to 40 it is in yellow zone, 40 to 80 it is in green zone and 80 to 100 it is in red zone.
Oh, I forgot one thing: I would like to put some label/text on the gauges, could you help me with that too?
Krasimir,
It's wonderful, thank you.
I am very glad that my reply was helpful for you. Please let me know if you need any further assistance on the matter.
Hello Khanh,
I am just checking if you require any further assistance on the matter.
Thank you for your reply. I have been looking into your requirement and I can suggest using UnboundColumns and when creating GroupColumns that contain columns that should display the same data. I have created a sample application for you that demonstrates how you can implement this approach using only C# code. Here is an example of the code that can implement this functionality:
Xaml:
<Window x:Class="GroupColumnsDynamicallyCreated.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ig="http://schemas.infragistics.com/xaml" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <DataTemplate x:Key="MinTemplate"> <Grid> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding RowData.Min}"/> </Grid> </DataTemplate> <DataTemplate x:Key="AvgTemplate"> <Grid> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding RowData.Avg}"/> </Grid> </DataTemplate> <DataTemplate x:Key="MaxTemplate"> <Grid> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding RowData.Max}"/> </Grid> </DataTemplate> </Window.Resources> <Grid> <ig:XamGrid x:Name="xamGrid1" ItemsSource="{Binding}" AutoGenerateColumns="False"/> <Button Content="Add Group" Height="23" HorizontalAlignment="Right" Margin="0,0,12,12" Name="button1" VerticalAlignment="Bottom" Width="75" Click="button1_Click" /> </Grid> </Window>
C#
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DataContext = new List<Data> { new Data { Min = 0, Max = 10 }, new Data { Min = 2, Max = 4 }, new Data { Min = 4, Max = 15 }, new Data { Min = 4, Max = 15 }, new Data { Min = 1, Max = 3 }, }; } int i = 0; private void button1_Click(object sender, RoutedEventArgs e) { i++; GroupColumn group = new GroupColumn { HeaderText = "Group " + i, Key = "group" + i }; //UnboundColumnDataContext asd;asd.RowData UnboundColumn min = new UnboundColumn { Key = "min" + i, HeaderText = "Min", ItemTemplate = Resources["MinTemplate"] as DataTemplate }; UnboundColumn avg = new UnboundColumn { Key = "avg" + i, HeaderText = "Avg", ItemTemplate = Resources["AvgTemplate"] as DataTemplate }; UnboundColumn max = new UnboundColumn { Key = "max" + i, HeaderText = "Max", ItemTemplate = Resources["MaxTemplate"] as DataTemplate }; group.Columns.Add(min); group.Columns.Add(avg); group.Columns.Add(max); xamGrid1.Columns.Add(group); } } public class Data { public int Min { get; set; } public double Avg { get { return (Max - Min) / 2; } } public int Max { get; set; } }
Hi Krasimir,
It's good to hear from you.
I'm having an urgent issue that is about dynamic XamGrid.
I see in the Infragistics example of XamGrid. It looks great but I don't know how to do it in C# codebehind.
That is, I would like to create C# codehind dynamic XamGrid that has group columns. Each group column has three fields. When I click a button, another group column will sit beside the first one and have a different HeaderText but the same three fields and their column header names too.
i.e.:
The first xamGrid's GroupColumn is this:
Temp (Group header)
Min | Avg | Max --> three fields
Then when I click a button, another group column will appear beside the first one, like this:
Temp1 (Group header, different HeaderText)
Min | Avg | Max --> the same as above
and so on and on.
Could you help me this issue with C# code only?
Best Regards and Thank you,
Khanh
Thank you for the provided feedback. Please let me know if you need any further assistance on the matter.
Thank you for your support. I was so busy with other component and did not check the forum lately.