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
Hi,
I have a grid that i am populating Programmatically. I create the Columns and add them in code. I have changed the edit type of one of the columns to use a combo box. Everything works cool and the grid loads and the combo box on the cell is populated. The problem comes in when selecting a value in the combobox. That selected value updates not only the current cell, butt all cells of the column in the other rows.
P.S.
It seems like it updates all cell with a similar value before the change.
If anybody can help with this i would be every gratefull. I have been trying to sort this problem out for the last week.
Below is the code in my app.
DataGridResults.AutoGenerateColumns = false;
GridViewDataColumn columnID = new GridViewDataColumn();
columnID.DataType = typeof(string);
columnID.UniqueName = "ID";
columnID.DataMemberPath = "ID";
columnID.HeaderText = "ID";
columnID.IsVisible = false;
GridViewDataColumn columnBarcode = new GridViewDataColumn();
columnBarcode.DataType = typeof(string);
columnBarcode.UniqueName = "Barcode";
columnBarcode.DataMemberPath = "Barcode";
columnBarcode.HeaderText = "Barcode";
GridViewDataColumn columnStatus_ID = new GridViewDataColumn();
columnStatus_ID.DataType = typeof(string);
columnStatus_ID.UniqueName = "Status";
columnStatus_ID.DataMemberPath = "Status.Name";
columnStatus_ID.HeaderText = "Status";
columnStatus_ID.Width = new System.Windows.GridLength(200);
DataGridResults.Columns.Add(columnID);
DataGridResults.Columns.Add(columnBarcode);
DataGridResults.Columns.Add(columnName);
DataGridResults.Columns.Add(columnStatus_ID);
//Status Combo and Column
ComboBoxEditorSettings comboBoxEditorSettings = new ComboBoxEditorSettings();
Granite.Objects.Status _stat = new Granite.Objects.Status();
comboBoxEditorSettings.ItemsSource = _stat.GetAll(Granite.Objects.AppliesTo.LOCATION);
comboBoxEditorSettings.DisplayMemberPath = "Name";
comboBoxEditorSettings.SelectedValuePath = "Name";
((GridViewDataColumn)DataGridResults.Columns["Status"]).EditorSettings = comboBoxEditorSettings;
I am trying to figure out why I have a few bugs in using the WPF grid. I am open to the possibility that i have an old version of the GridView but since I did download the trail components fairly recently (within the last 4 weeks) im hoping im not too out-of-date.
Here are my three issues that need immediate attention:
Bug: Column Sorting
We have a bug that if we click to sort a column, click again to sort the other way, then click again to reset, it will break sort. Clicking after that will NOT sort anymore. It does nothing!
In your demo that we downloaded we also see this in the following sample of this bug, so we don’t think it sour code:
Populating with Data > Data Sources > Property Path
Online though, this works, so is this a bug that has been fixed and we simply need to get updated components?
Bug: Binding, then Rebinding
I have an application with a BackgroundWorker class that does some work, puts together a custom collection in a LIST<> and in the Worker completed method binds it to the grid. This works fine, but once i run the worker again, the new set of data is not visible. My original content vanishes, grid scrollbars change, but i dont see anything.
The code is VERY simple, MyGrid.Itemsource = e.Results
i've tried adding a .rebind and even setting Itemsource to NULL before assigning the new results, nothing fixes this issue.
I switched to use a LISTBOX standard .NET control instead and now things work perfectly using the same exact code.
Bug: Missing scrollbars
We have a large example that i simply am not allowed to post in full here, but it seems that for whatever reason us NOT auto generating columns and instead creating them manually is not turning on the scrollbars.
We generate the columns in code and add them to the grid.
I made sure its an issue with your control and not a XAML layout problem by putting a border around the grid that shows perfectly with right/bottom ending where I expected it to end visually, but still no scrollbars from your control that clearly has data in both directions that is not visible.
I can press keydown and go off screen!
Next Steps
For next steps and in general can you tell me how i can check if we have the latest build? Is there hot fixes we can apply?
I know we are still in "trial" mode but we need to finish this proof of concept before the work order can go ahead purchasing your control suite. Please help me fix my issues so i can help get you this sale.
w System.TimeSpan.Interval(Double value, Int32 scale) |
w System.TimeSpan.FromSeconds(Double value) |
w Telerik.Windows.Controls.Charting.DelayConverter.CalculateItemDelayBasedOnTotalDuration() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\DelayConverter.cs:wiersz 87 |
w System.TimeSpan.Interval(Double value, Int32 scale) |
w System.TimeSpan.FromSeconds(Double value) |
w Telerik.Windows.Controls.Charting.DelayConverter.CalculateItemDelayBasedOnTotalDuration() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\DelayConverter.cs:wiersz 87 |
w Telerik.Windows.Controls.Charting.DelayConverter.CalculateValue(Double[] delayCoefficients) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\DelayConverter.cs:wiersz 47 |
w Telerik.Windows.Controls.Charting.BaseAnimationConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Animations\BaseAnimationConverter.cs:wiersz 88 |
w Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter, CultureInfo culture) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Converters\StaticConverter.cs:wiersz 12 |
w Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Converters\StaticConverter.cs:wiersz 22 |
w Telerik.Windows.Controls.Charting.BaseChartItem.ConfigureAnimationSettings() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseChartItem.cs:wiersz 440 |
w Telerik.Windows.Controls.Charting.BaseChartItem.SetAnimationSettings() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseChartItem.cs:wiersz 775 |
w Telerik.Windows.Controls.Charting.BaseChartItem.OnApplyTemplate() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseChartItem.cs:wiersz 377 |
w Telerik.Windows.Controls.Charting.BaseLabelChartItem.OnApplyTemplate() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BaseLabelChartItem.cs:wiersz 164 |
w Telerik.Windows.Controls.Charting.BasePointMarkChartItem.OnApplyTemplate() w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\Base\BasePointMarkChartItem.cs:wiersz 359 |
w System.Windows.FrameworkElement.ApplyTemplate() |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w Telerik.Windows.Controls.Charting.LinearSeriesPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\Series\LinearSeriesPanel.cs:wiersz 139 |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) |
w System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w System.Windows.Controls.Control.MeasureOverride(Size constraint) |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w Telerik.Windows.Controls.Charting.ChartPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\ChartPanel.cs:wiersz 39 |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) |
w System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w Telerik.Windows.Controls.Charting.ClipPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\ClipPanel.cs:wiersz 30 |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w Telerik.Windows.Controls.Charting.PlotAreaPanel.MeasureOverride(Size availableSize) w c:\Builds\WPF_Scrum\Charting_CI_Build\Sources\Development\Charting\Telerik.Windows.Controls.Charting\Chart\ChartArea\PlotAreaPanel.cs:wiersz 63 |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) |
w System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) |
w System.Windows.Controls.Grid.MeasureOverride(Size constraint) |
w System.Windows.FrameworkElement.MeasureCore(Size availableSize) |
w System.Windows.UIElement.Measure(Size availableSize) |
w System.Windows.ContextLayoutManager.UpdateLayout() |
w System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) |
w System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() |
w System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() |
w System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) |
w System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) |
w System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) |
w System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) |
w System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) |
w System.Windows.Threading.DispatcherOperation.InvokeImpl() |
w System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) |
w System.Threading.ExecutionContext.runTryCode(Object userData) |
w System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) |
w System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) |
w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) |
w System.Windows.Threading.DispatcherOperation.Invoke() |
w System.Windows.Threading.Dispatcher.ProcessQueue() |
w System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) |
w MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) |
w MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) |
w System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) |
w System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) |
w System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) |
w System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) |
w System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) |
w MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) |
w MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) |
w System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) |
w System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) |
w System.Windows.Threading.Dispatcher.Run() |
w System.Windows.Application.RunDispatcher(Object ignore) |
w System.Windows.Application.RunInternal(Window window) |
w System.Windows.Application.Run(Window window) |
w System.Windows.Application.Run() |
w RHEAClient.App.Main() w F:\RHEAClient\obj\Release\App.g.cs:wiersz 0 |
w System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) |
w System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) |
w Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() |
w System.Threading.ThreadHelper.ThreadStart_Context(Object state) |
w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) |
w System.Threading.ThreadHelper.ThreadStart() |
Hi,
I am using version 2009.1.312.35.
The RadGridView is wrapped in a StackPanel which is in a column of a Grid with a splitter.
In the following code, The last column does not take up the remaining space. Are there additional tricks to get it to work? I read this post: http://www.telerik.com/community/forums/wpf/gridview/documentation-is-frustrating.aspx, and I think I did what it suggests, but it doesn't work.
Also, will the column resize when the splitter is moved?
<telerik:RadGridView |
HorizontalAlignment="Stretch" |
x:Name="uxLibraryView" |
MultipleSelect="True" |
AutoGenerateColumns="False" |
ColumnsWidthMode="Fill" |
AllowDrop="False" |
ShowGroupPanel="False" |
ItemsSource="{Binding Path=LibraryMembers,Diagnostics:PresentationTraceSources.TraceLevel=High}" |
IsFilteringAllowed="False" |
telerik:GridViewCell.EditEnded="uxLibraryView_EditEnded" |
SelectionChanged="uxLibraryView_SelectionChanged"> |
<telerik:RadGridView.Resources> |
...Context Menu Stuff ... |
</telerik:RadGridView.Resources> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn HeaderText="{x:Static properties:Resources.Common_Label_Type}" |
IsReadOnly="True" |
UniqueName="LibraryContentType" |
Width="23"> |
<telerik:GridViewColumn.CellStyle> |
<Style TargetType="{x:Type telerik:GridViewCell}"> |
<Setter Property="Template"> |
<Setter.Value> |
<ControlTemplate TargetType="{x:Type telerik:GridViewCell}"> |
<Image Stretch="None" Width="16" Height="16" |
Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content, Converter = {StaticResource ContentTypeToImageConverter}}" |
Margin="2,0,5,0"/> |
</ControlTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
</telerik:GridViewColumn.CellStyle> |
</telerik:GridViewDataColumn> |
<telerik:GridViewDataColumn HeaderText="{x:Static properties:Resources.Common_Label_Name}" |
UniqueName="Name" |
Width="*" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
Thank you