Telerik Forums
UI for WPF Forum
3 answers
223 views

I am using a heirarchical grid and there are times the childGrid could be null. how to check that condition?

 

GridViewRow

 

grdRow = (GridViewRow)grdCell.ParentRow;

 

 

RadGridView

 

childGrid = grdRow.ChildrenOfType<RadGridView>().FirstOrDefault();


Please let me know

Thanks
Sathish.K

 

Milan
Telerik team
 answered on 23 Aug 2010
4 answers
227 views

I currently have a Loop going through a cube which returns the name (Caption) of its items.
However as this is an OLAP cube I want to distinguish between user defined and attribute hierarchies. I thought the best way to do this would be to give each one a different color (so give User Defined Hierarchies a blue font and Attribute Hierarchies a red font for example).

I thought this would be simple but the method I tried below threw alot of errors, while other methods turned all of the items a particular colour rather than just the items I wanted.

Has anyone got an idea of how I could change an items colour depending on its value??


Window1.xaml.cs

foreach (Hierarchy hierarchy in dimension.Hierarchies)
                {

                    Dimension HierarchyItem = new Dimension();
                    HierarchyItem.Caption = hierarchy.Caption;
                    DimensionItem.SubDimensions.Add(HierarchyItem);
                    HierarchyItem.IsDraggable = true;

              
if (HierarchyItem.Caption == "Account Number")
                        HierarchyItem.Caption = Brushes.Red)
                        else if (HierarchyItem.Caption == "Customer Number")
                        HierarchyItem.Caption = Brushes.Blue)

James
Top achievements
Rank 1
 answered on 23 Aug 2010
1 answer
138 views
I am using percentages in my graphs but the y-axis label as well as the item labels show 100% as 100.00% or 95% as 95.00%. Is there a way to make it show only whole numbers?

Thanks,

Billy Jacobs
Sia
Telerik team
 answered on 23 Aug 2010
0 answers
192 views
Well, my question is not related with the radwindow but I hope you guys can help :)

I have a windowless WPF application and I want it to be draggable by the users.

I can make it dragglabe by returning HTCAPTION in the WM_NCHITTEST message like this:

protected override void OnSourceInitialized(EventArgs e)
    {
        HwndSource hwndSource = (HwndSource)HwndSource.FromVisual(this);
        hwndSource.AddHook(WndProcHook);
        base.OnSourceInitialized(e);
    }
 
private static IntPtr WndProcHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handeled)
    {
        if (msg == 0x0084) // WM_NCHITTEST
        {
            handeled = true;
            return (IntPtr)2; // HTCAPTION
        }
        return IntPtr.Zero;
    }

But then, the click event of the buttons inside the application doesn't work...

-----

When I add "DragMove" to the "MouseLeftButtonDown":

this.MouseLeftButtonDown += delegate { DragMove(); };

Then the problem is, if I click one of the buttons, I get an InvalidOperationException.

User interface :)

Does anyone have something in mind for this?
koray
Top achievements
Rank 1
 asked on 23 Aug 2010
3 answers
753 views

Good morning, afternoon, evening,

I am having trouble figuring out how I can center a RadWindow using WindowStartupLocation.CenterOwner when I open it from a non-wpf application.

I used the following code in my winform app to open a dialog that is a System.Windows.Window.  When I convert it to a RadWindow, it doesn't work and I am at a loss as to how to duplicate functionality.

 

 

 

var dlg = new MyDialog();

 

System.Windows.Interop.

 

WindowInteropHelper hwndHelper = new System.Windows.Interop.WindowInteropHelper(dlg);

 

hwndHelper.Owner =

 

new IntPtr(Globals.ThisAddIn.Application.Hwnd);

 

dlg.ShowDialog();

How can I center the window?

Please assist.

Thanks,
Alan

PS.  I have a support agreement but decided to post here so that others might benefit from response.

Konstantina
Telerik team
 answered on 23 Aug 2010
1 answer
142 views
I have a the following column definition:  I want to be able to sort this column on the Sailor.Name property. How do I accomplish this?

Thanks in advance,

<telerik:GridViewColumn Width="*" Header="Sailor" IsSortable="True" >
  <telerik:GridViewColumn.CellTemplate>
    <DataTemplate>
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <TextBlock Text="{Binding Name}" />
        <Image Source="{DynamicResource User_Man_Padlock}" Grid.Column="1" Margin="0,0,10,0" ToolTip="{Binding DetailRequisitionAssignedTo, Converter={StaticResource DetailRequisitionConverter}}" Height="15"  >
          <Image.Visibility>
            <MultiBinding Converter="{StaticResource SailorLockVisibilityConverter}" ConverterParameter="Left">
              <Binding Path="DetailRequisitionAssignedTo" />
              <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SailorsOnLeft" />
              <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SelectedJobInformation" />
            </MultiBinding>
          </Image.Visibility>
        </Image>
        <Image Source="{DynamicResource Padlock}" Grid.Column="1" Margin="0,0,10,0" ToolTip="{Binding DetailRequisitionAssignedTo, Converter={StaticResource DetailRequisitionConverter}}" Height="15"  >
          <Image.Visibility>
            <MultiBinding Converter="{StaticResource SailorLockVisibilityConverter}" ConverterParameter="Right">
              <Binding Path="DetailRequisitionAssignedTo" />
              <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SailorsOnLeft" />
              <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SelectedJobInformation" />
            </MultiBinding>
          </Image.Visibility>
        </Image>
        <Image Source="{DynamicResource User_Man_Padlock}" Grid.Column="1" Margin="0,0,10,0" ToolTip="{Binding DetailRequisitionAssignedTo, Converter={StaticResource DetailRequisitionConverter}}" Height="15"  >
          <Image.Visibility>
            <MultiBinding Converter="{StaticResource SailorLockVisibilityConverter}" ConverterParameter="AssignedTo">
              <Binding Path="DetailRequisitionAssignedTo" />
              <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SailorsOnLeft" />
              <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SelectedJobInformation" />
            </MultiBinding>
          </Image.Visibility>
        </Image>
      </Grid>
    </DataTemplate>
  </telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>

Billy Jacobs
Milan
Telerik team
 answered on 23 Aug 2010
3 answers
134 views
Hi, I am recieving following error while trying to reorder columns in RAD TreeListView
I m using the control inside VS plugin window, inside  UserControl.

I have found that simmilar error was already resolved for GridView.

System.InvalidOperationException was unhandled
  Message=Root AdornerLayer Not Found. Please make sure that your root visual is Window or other element that has an adorner layer. Alternatively, wrap your root panel in an <AdornerDecorator> element.
  Source=Telerik.Windows.Controls
  StackTrace:
       at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OpenPopup()
       at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.StartDragging()
       at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.TryStartDrag(IMouseEventArgs e)
       at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnTrackedElementMouseMoveInternal(IMouseEventArgs e)
       at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnCoverRectangleMouseMove(Object sender, MouseEventArgs e)
       at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
  InnerException:
Ivo
Top achievements
Rank 1
 answered on 22 Aug 2010
1 answer
162 views
Hello!

I want to export from a RadGridView to Csv format. The ToCsv() method work fine, the only problem is that I get to much information since I have objects in my columns. And what is displayed to the user is controlled by the DisplayMemberPath or a CellTemplate.

So the question is, how can I filter the export so it only takes the displayed values? Do I have to loop through all the rows and if so how do I fetch the displayed value?

Best regards/
Anna
Veselin Vasilev
Telerik team
 answered on 20 Aug 2010
7 answers
215 views
Hi.. I have the following. The autocomplete does not work unless the Combo dropdown is open. Any ideas why. How can get the autocomplete to work when the Combo has focus.. thanks again for your help.

  <telerikPresentation:RadComboBox  TabIndex="4" Height="54"  Name="cmbCustomer" TextSearch.TextPath="cust_name" Style="{StaticResource requiredFieldValidationStyle}"  SelectedIndex="0" SelectedItem="{Binding cust_name, Mode=TwoWay}" SelectedValue="{Binding Path=cust_name}" SelectedValuePath="cust_name" Width="332" >

                    <telerikPresentation:RadComboBox.Effect>

                        <DropShadowEffect BlurRadius="0" ShadowDepth="2" />

                    </telerikPresentation:RadComboBox.Effect>

                    <telerikPresentation:RadComboBox.ItemTemplate>

                        <DataTemplate>

                            <Grid Margin="5" Width="300">

                                <Grid.ColumnDefinitions>

                                    <ColumnDefinition />

                                    <ColumnDefinition />

                                    <ColumnDefinition />

                                </Grid.ColumnDefinitions>

                                <Grid.RowDefinitions>

                                    <RowDefinition />

                                    <RowDefinition />

                                    <RowDefinition />

                                </Grid.RowDefinitions>

                                <TextBlock FontWeight="Bold" x:Name="txtCUST_NAME" Grid.ColumnSpan="2" Text="{Binding cust_name}" />

                                <TextBlock Foreground="Navy" Grid.ColumnSpan="3" Grid.Row="1" Margin="10,0,0,0" Text="{Binding address}" />

                                <TextBlock Foreground="Navy" Grid.Column="0" Grid.Row="2" Margin="10,0,0,0" Text="{Binding city}" />

                                <TextBlock Foreground="Navy" Grid.Column="1" Grid.Row="2" Margin="0" Text="{Binding state}" />

                                <TextBlock Foreground="Navy" Grid.Column="2" Grid.Row="2" Margin="-20,0,0,0" Text="{Binding zipcode}" />

                            </Grid>

                        </DataTemplate>

                    </telerikPresentation:RadComboBox.ItemTemplate>

                </telerikPresentation:RadComboBox>

Ashish
Top achievements
Rank 1
 answered on 20 Aug 2010
2 answers
308 views
Hi,

I am using the datafilter in the mvvm pattern, with the filter collection data stored in the viewmodel, which is then used to build a query to run against a WCF Data Services / OData IQueryable entity.  I'm not connecting the datafilter to another itemscontrol to be populated with ItemProperties, but rather creating my own item properties via reflection and linq off the entity type.

One issue is that I cannot bind to the FilterDescriptors property of the datafilter as it is readonly, so instead I am using a bit of code-behind code to persist this collection between the view and viewmodel when the datacontext changes.

The inability to bind to FilterDescriptors is causing one problem, which is why I am posting here.  I am saving/loading the filter data to/from a database, and would like to know when the data becomes 'dirty' (so that i can indicate visually that the data should be saved).  This is ok for filters being added or removed (via the CollectionChanged event) or for the logical operator being changed (via the PropertyChanged event), but I cannot find any way of detecting when the value of any of the simple filter properties (Member, Operator or MemberValue) have changed.

I've tried adding handlers for all sorts of events on the datafilter and on its viewmodel, but none of the handlers are hit when editing the filters.  I have even looped through the RadDataFilter.ViewModel.CompositeFilter.Filters collection, adding handlers for each item's PropertyChanged event, but still nothing.

So, is there something I can do that I have missed - or - can an event be added when these simple filter values are changed, or can the FilterDescriptors property on the control be made bindable?

Thanks.
ianr
Top achievements
Rank 1
 answered on 20 Aug 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?