Telerik Forums
UI for WPF Forum
4 answers
373 views

Hi! I use RadGridView in one of the views of my WPF MVVM Prism 6 application. The view was created on the base of Prism UserControl (WPF). The
solution of my application was created as empty Telerik project. After I had created the solution I added here RadWindow as Shell and also Prism 6
library for WPF via NuGet. I want to map RadGridView.AddingNewDataItem event to a command in viewmodel but unfortunately I can't. Below is RadGridView' XAML snippet from view' markup:

<telerik:RadGridView Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center"  Margin="8,5,0,0" VerticalAlignment="Top" AutoGenerateColumns="False"
            IsReadOnly="True" ItemsSource="{Binding DeviceRecords}" SelectedItem="{Binding SelectedDevice}">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding DeviceName}" Header="Name"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding SerialNumber}" Header="Serial Number"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding MountingLocation}" Header="Mounting place"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding CompanyOwnerOfDevice}" Header="Device' owner"/>
            </telerik:RadGridView.Columns>

            <telerik:EventToCommandBehavior.EventBindings>
                <telerik:EventBinding
                    Command="{Binding HandleAddingNewRecordToDevicesGridCommand}"
                    EventName="AddingNewDataItem"
                    PassEventArgsToCommand="True"/>
            </telerik:EventToCommandBehavior.EventBindings>
</telerik:RadGridView>

Below is HandleAddingNewRecordToDevicesGridCommand command that is in viewmodel:

public DelegateCommand<object> HandleAddingNewRecordToDevicesGridCommand { get; private set; }

private void handleAddingNewRecordToDevicesGrid(object parameter)
{
            // Get RadGridView that is sender.
            Telerik.Windows.Controls.RadGridView gridView =
                ((parameter as GridViewAddingNewEventArgs).OwnerGridViewItemsControl) as Telerik.Windows.Controls.RadGridView;
            // Get new item inserted in the RadGridView.
            Telerik.Windows.Controls.GridViewDataColumn newItem =
                ((parameter as GridViewAddingNewEventArgs).NewObject) as Telerik.Windows.Controls.GridViewDataColumn;
            // Prepair to select this new item in the RadGridView.
            Telerik.Windows.Controls.GridViewDataColumn[] aItem = { newItem };
            System.Collections.IEnumerable selectedItem = aItem;
            // Select the new item in the RadGridView.
            gridView.Select(selectedItem);
}

this.HandleAddingNewRecordToDevicesGridCommand = new DelegateCommand<object>(this.handleAddingNewRecordToDevicesGrid); // (in viewmodel constructor)

I'm in need of abovementioned code for selecting new inserted row in the RadGridView. So after new row has been inserted into RadGridView then this row is selected in the RadGridView. But HandleAddingNewRecordToDevicesGridCommand command doesn't fire at all! Why? Please help me.

Eugene
Top achievements
Rank 1
 answered on 13 Apr 2016
5 answers
65 views

My chart having logic which switching between Point and Line series at run time.Issue is after switching series chart not retain the selection with new series selected.

 

Please help to resolve this issue.

Sivakumar
Top achievements
Rank 1
 answered on 13 Apr 2016
21 answers
1.9K+ views
Hi Guys,

    I have made it to hide/show value column of a property individually, but does not make it work to show/hide the whole property row(not only the value column, but also the label column). What's more how to hide a whole group?

    You are really appreciated if you could share some code. Thank you very much.
Ivan Ivanov
Telerik team
 answered on 12 Apr 2016
1 answer
121 views

I can not understand how to solve the following problem: There is real-time chart of Security.

<
<telerik:RadCartesianChart x:Name="chart" Grid.Column="0"    >
                <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid MajorLinesVisibility="Y"/>
                </telerik:RadCartesianChart.Grid>
 
 
                <telerik:RadCartesianChart.Behaviors>
                    <telerik:ChartCrosshairBehavior/>
                    <telerik:ChartPanAndZoomBehavior DragToZoomThreshold="0" MouseWheelMode="Zoom" DragMode="Pan" ZoomMode="Both" PanMode="Both"/>
                </telerik:RadCartesianChart.Behaviors>
 
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeContinuousAxis x:Name="AxisX"  LabelFormat="HH:mm" LabelFitMode="Rotate" SmartLabelsMode="SmartStep" PlotMode="OnTicksPadded"  />
                </telerik:RadCartesianChart.HorizontalAxis>
 
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis MajorStep="1" LineThickness="1" SmartLabelsMode="SmartStepAndRange" />
                </telerik:RadCartesianChart.VerticalAxis>
 
               <telerik:CandlestickSeries  ItemsSource="{Binding Candls}" CategoryBinding="Time" CloseBinding="Close" HighBinding="High" LowBinding="Low" OpenBinding="Open" DefaultVisualStyle="{DynamicResource #CandleStickStyle}" />
 </telerik:RadCartesianChart>

public ObservableCollectionEx<Candle> Candls = new ObservableCollectionEx<Candle>();

 

New candles appear immediately. Change the "Close" is not displayed in the candle when changes occur between the extreme values of the "Close". in a stream of data received and the change correctly. This can be seen on the grid.

 I tried to delete data from the collection of the last candle and insert new data, not to make changes to existing ones. The result remained the same :(

How can I display all the changes in the closing candle?

 

Martin Ivanov
Telerik team
 answered on 12 Apr 2016
2 answers
83 views
Hi,



I use a RadGridView and when I click on a GridViewRow which is not entire visible, I scroll automatically.

This is an illustration with the GridViewRow number 0, and the GridViewRow number 4, before and after a click.
http://image.noelshack.com/fichiers/2016/14/1460041764-telerik2.png
http://image.noelshack.com/fichiers/2016/14/1460041552-telerik3.png

When I click on it, the ScrollViewer is called. And I don't want ! But impossible to prevent this comportment. Could you help me ?



Thank you.
Ludovic
Top achievements
Rank 1
 answered on 12 Apr 2016
0 answers
114 views

Hi All,

i am using the radgridview control, added the custom filters to it successfully and all the default styles are working great. i have a requirement of infinite scrollbar and display row number on thumb. so i implemented the Data Virtualization but that did not match my requirement, in this the VirtualItemCount has to be set initially(when i tried to set it dynamically all rows data is empty no data is visible in the grid) more over the VirtualQueryableCollectionView maintains its own collection and its like a copy which i don't want. so with the MVVM pattern via observablecollection iam populating the data into the grid and this collection has constant size. now while scrolling when i reach to end of the scroll in the scrollchanged event iam replacing the collection with new data. all this is working but w.r.t this i also need to change the scrollbar's thumb as like inifinite scroll. i had written code to adjust the scrollbar thumb position, length nothing is working. Another issue is like displaying the record number on the thumb i had added the xaml code in style but when i apply the style the gridview is gone, it is not displayed. not sure what is the correct way of displaying the data on the thumb without losing the all default radgridview style.

Anyone please guide me.

Naresh
Top achievements
Rank 1
 asked on 12 Apr 2016
0 answers
102 views
Hi,

At the moment I have an autocomplete box which opens another tab. The autocompletebox list overlaps Tiles, when a selection is selected that overlaps a tile, it'll trigger the selection event AND the tile event. May I ask how do I set it up such that it'll only trigger selection event.

 
Minh
Top achievements
Rank 1
 asked on 11 Apr 2016
0 answers
57 views
Hi,

I currently implemented an intercept, such that when the paste command is triggered, it'll create a stream of the image and upload to s3 and then delete that image and paste an inlineimage of that now resides on S3. The richtextbox is not then converted to html immediately upon paste action, if I hit any key strokes then it'll be converted. Is there any manual way of triggering the htmldataprovider, maybe call that function or do a dirty trick such as enter in key then delete key. 
 
Minh
Top achievements
Rank 1
 asked on 11 Apr 2016
2 answers
139 views

Hi,

I wonder if it is possible to have different distances between ticks when using Linear or Categorical axes.

I have attached an image to show what I would like to accomplish.

 

Thanks,

Alberto

Amige
Top achievements
Rank 1
Veteran
 answered on 11 Apr 2016
4 answers
318 views

Hi,

I'm trying to change the controlpanelitem RadDropdownButton into a RadButton. So far any luck. Does anybody know how this can be done?

Thanks in advance!

 

 

Dilyan Traykov
Telerik team
 answered on 11 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?