Telerik Forums
UI for WPF Forum
3 answers
321 views
Hi,
     I am using MVVm pattern. I have a telrik radGridView which is bound to a datatable which has some uncertain columns and rows,and AutoGeneratedColumns property is true. Now I want to set CellStyle of GridView base on some condition,but I am not finding any CellStyle property in TelrikRdGridView. Is it possible to change the cellstyle of autogenerated columns using MVVM pattern?
Yoan
Telerik team
 answered on 25 Jan 2013
7 answers
387 views
This is our scenario:
  • We have a GridView in a RadPane.
  • We have the utility to add columns to the GridView separately as opposed to doing it thru the intrinsic GridView feature. There's just too much codebase that's why we continue with our current approach.
  • We add columns dynamically thru codes

If we add more columns and some of them go beyond the visible portion of the grid, the horizontal scrollbar does not show. It shows only if we resize the RadPane hosting it or during load.

I'm pretty sure what we're trying to achieve will involve some code-behind effort. Could you please provide a sensible starting point?

Yoan
Telerik team
 answered on 25 Jan 2013
2 answers
271 views
I have a radMap that is bound to a collection of data items. I have defined an ItemTemplate that draws some WPF elements on the map, for each item in the collection.

What I want is to draw an push-pin image at the location of the item, and to have, offset a bit, a info bubble - a visible element containing information about the item.

Currently, my template consists of a grid with one cell, and with two items drawn in that cell - an Image, with its source pointing to the Uri for the image file, and a Border, with borders and corner radius set to create the bubble look, and with content elements that display what I need, that I am shifting up and right using <Border.RenderTransform><TranslateTransform>.

The problem - the point of the image is not set to the proper location on the map.  The HotSpot property is being applied to the entire Grid, and not to just the Image.

With the Translate, I'm binding X to half the sum of the ActualHeights of the Border and the Image, and ditto Y using the ActualWidths, using a scaling converter I've written. But translating the Border doesn't change the size of the containing Grid.

And here's the thing - I can't just figure out appropriate HotSpot offsets, because the actual size of the Border bubble is dynamic, changing with its contents.

I think I could, with some work, develop another converter that would return the appropriate HotSpot values, using a multiple binding to the image and the border. But I'm wondering if I'm not missing something simple.

Is there not a way to draw an element in association with my Image, without affecting the layout of the container within which that Image is contained?  Normally, I'd be looking at Adorners, but AIUI they can only be applied in code, and I see no way to hook them to the Images, as they're being drawn on the map.

Is there some simpler way of adding an info button to a push-pin?

<telerik:RadMap>
    <telerik:RadMap.Resources>
        <DataTemplate x:Key="pointTemplate">
            <Grid
                    telerik:MapLayer.Location="{Binding location}"
                    telerik:MapLayer.HotSpot="{Binding imageHotSpot}"
                    Margin="0"
                    >
                <Image
                        x:Name="pointImage"
                        Source="{Binding imageUri}"
                        MouseLeftButtonDown="selectMapPoint"
                        Height="24"
                        Width="24"
                        Margin="0"
                        />
 
                <!-- We shift the bubble over a bit by half the size of the image -->
                <Border Margin="0">
                    <Border.RenderTransform>
                        <TranslateTransform
                                X="{Binding ElementName=pointImage, Path=ActualWidth, Converter={StaticResource scalingConverter}, ConverterParameter=0.5}"
                                Y="{Binding ElementName=pointImage, Path=ActualHeight, Converter={StaticResource scalingConverter}, ConverterParameter=-0.5}"
                                />
                    </Border.RenderTransform>
                    <!-- And then by half the size of the bubble -->
                    <Border
                            x:Name="bubbleBorder"
                            BorderBrush="Black"
                            BorderThickness="2"
                            CornerRadius="4"
                            Background="White"
                            Padding="2"
                            Margin="0"
                            MouseLeftButtonDown="selectBubble"
                            >
                        <Border.RenderTransform>
                            <TranslateTransform
                                    X="{Binding ElementName=bubbleBorder, Path=ActualWidth, Converter={StaticResource scalingConverter}, ConverterParameter=0.5}"
                                    Y="{Binding ElementName=bubbleBorder, Path=ActualHeight, Converter={StaticResource scalingConverter}, ConverterParameter=-0.5}"
                                    />
                        </Border.RenderTransform>
                        <Label Content="{Binding ticketVM.jobRec.jobid}" />
                    </Border>
                </Border>
 
            </Grid>
        </DataTemplate>
    </telerik:RadMap.Resources>
 
    <telerik:InformationLayer
            x:Name="informationLayer"
            ItemsSource="{Binding mapElements}"
            ItemTemplate="{StaticResource pointTemplate}"
            />
 
</telerik:RadMap>
Jeff
Top achievements
Rank 1
 answered on 25 Jan 2013
1 answer
173 views
in demo, set inputMode to DatePicker, it will show date only, but when binding DateTimeText to a c# DateTime value , the inputmode will auto change to DateTimePicker. I think it is a bug.

Georgi
Telerik team
 answered on 25 Jan 2013
1 answer
215 views
How to bind to calendar's DisplayDateChanged event?
 or How to refresh blackout dates when change display from January to February? 

When I don't use telerik, I found a solution according to set the DatePicker.CalendarStyle, and rewrite the Calendar'sTemplate. In the Template, a new calendar is created, and so the new calendar's DisplayDateChanged event can be gained. But when using telerik radDateTimePicker, it will cause error.

<telerik:RadDateTimePicker>
            <telerik:RadDateTimePicker.CalendarStyle>
                <Style TargetType="telerik:RadCalendar">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>

                                <telerik:RadCalendar >
                                    <inter:Interaction.Triggers>
                                        <inter:EventTrigger EventName="DisplayDateChanged">
                                            <galaSoftMvvmLightCommand:EventToCommand PassEventArgsToCommand="True" Command="{Binding DisplayDateChangeCommand}" />
                                        </inter:EventTrigger>
                                    </inter:Interaction.Triggers>
                                </telerik:RadCalendar>

                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </telerik:RadDateTimePicker.CalendarStyle>
        </telerik:RadDateTimePicker>

NullReferenceException:
Object reference not set to an instance of an object.

   at Telerik.Windows.Controls.RadCalendar.UpdateRowsAndColumns() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\Calendar\RadCalendar.cs:line 3729
   at Telerik.Windows.Controls.RadCalendar.OnApplyTemplate() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\Calendar\RadCalendar.cs:line 2062
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Primitives.PopupRoot.MeasureOverride(Size constraint) 
Vladi
Telerik team
 answered on 25 Jan 2013
29 answers
347 views
Hi, just wanted to know when your pivot table (like done in radarsoft for example) will be available ?

I want a pivot grid conected to an OLAP cube with SSAS.

It's just a shame that this component is not available yet :(

Do you know when it'll be available? 

Regards,
Rosen Vladimirov
Telerik team
 answered on 25 Jan 2013
0 answers
198 views
Hi,

I initialize dragging by following code:

DragDropManager.AddDragInitializeHandler(xToolBar1, OnDragInitialize);
DragDropManager.AddGiveFeedbackHandler(xToolBar1, OnGiveFeedback);

In GiveFeedbackHandler and DropHandler  Mouse.GetPosition(xToolbarTray) gives negative numbers, which is incorrect. Is this bug?
I attached sample project to demonstrate this behaviour: https://skydrive.live.com/redir?resid=51A46BBA4E9EF07E!1312&authkey=!ALflFx7eswlzjic


Basically, I need distinguish between dragging or dropping on/before/after element in drop target.

I'm using reorder behaviour very often and just inserting element after the element under mouse gives very negative user experience. I cannot move element on the first position this way.
Daniel
Top achievements
Rank 1
 asked on 25 Jan 2013
1 answer
320 views
I have an application where multiple RadGridViews are being used as well as a RadTreeView. I would like to override the ScrollBar style for all RadControls in the application so that it uses the default Windows ScrollBar style instead of the RadControls own "shiny" version as it creates an inconsistent UI when other normal WPF ScrollViewers are used in the application. Here's an example: http://i.imgur.com/EXCRbey.png (the top is the default Windows 8 ScrollBar, bottom is a RadGridView ScrollBar).

I've tried adding the following in the application's ResourceDictionary, but it didn't work:

    <Style TargetType="ScrollBar" BasedOn="{StaticResource {x:Type ScrollBar}}"/>
Dimo Mitev
Telerik team
 answered on 25 Jan 2013
1 answer
328 views
hi:
 I have a question when use GridViewDataColumn.BindingGroup,my core code as follow:

<telerik:GridViewDataColumn Header="Time" IsReadOnly="True" SortMemberPath="ScheduledProcedureStepStartDateTime">                        
                        <telerik:GridViewDataColumn.BindingGroup>
                            <MultiBinding Converter="{StaticResource timeRangeConverter}" ConverterParameter="HH:mm">
                                <Binding Path="StartDateTime"></Binding>
                                <Binding Path="EndDateTime"></Binding>
                            </MultiBinding>
                      </telerik:GridViewDataColumn.BindingGroup>
</telerik:GridViewDataColumn>

Please confirm syntax of binding is right?

When execute 
 public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture){} function,
I found values[0] and values[1] are DependencyProperty.UnsetValue. So can't convert successfully.

Please provide the right telerik demo. Tahnks.
Pavel Pavlov
Telerik team
 answered on 25 Jan 2013
1 answer
223 views
It seems that the CurrentCell and CurrentRow are not kept in sync.

I think this is similar to what's mentioned in this post:
http://www.telerik.com/community/forums/wpf/gridview/radgridview-observablecollection-and-currentitem.aspx

We fixed it with this code:
private void ContractProxyGridView_CurrentCellChanged(object sender, GridViewCurrentCellChangedEventArgs e)
        {
            if (e.NewCell == null || e.NewCell.ParentRow == null) return;
            e.NewCell.ParentRow.IsCurrent = true;
        }

Is there a reason for this behavior?

Thanks,
Alex
Dimitrina
Telerik team
 answered on 25 Jan 2013
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?