Telerik Forums
UI for WPF Forum
0 answers
114 views
Hi,

I have a simple RadGridView with some setting but this grid is not editable. 

This gridview is filled thanks to a dataset product from a sql database.....

Through code behind I have the folloginw code:

        Dim currentDataRow As DataRow = Me.MyDataGrid.SelectedItem
        If currentDataRow IsNot Nothing Then
            currentDataRow.Item("STATUS") = status
        End If

This code works fine....so far, so good....but what is the right event in RadGridView to capture the time when the value of the cell is modified?

Thanks
Romell
Top achievements
Rank 1
 asked on 16 Aug 2012
0 answers
333 views
Is there a way to programmically remove the focus on a radgridview or one of the rows.


I have tried using the Focusable property which functionally works but it leaves the row still highlighted.

I have a couple of grids in panels where the visibiliy is toggled. They have keyboard commands and when I go to a new panel its possible to active commands on the invisible grid.

Thanks in advance

Arthur
Arthur
Top achievements
Rank 1
 asked on 16 Aug 2012
2 answers
170 views
Currently the "Members DropDown" is a list of available members, which can serve as a filter criteria.

In our application, we provide the users, hundreds of members that they can filter. So, it would be nice to categorize the dropdown and show members under the categories, or even better, use a different UI control instead of a dropdown.

How flexible is this feature supported in your API? 
Shankar
Top achievements
Rank 1
 answered on 16 Aug 2012
2 answers
105 views
Hi,
I have a PanelBar that is templated by a HierarchicalDataTemplate.  The PanelBar also includes a ContextMenu, and when I select "Rename" in the ContextMenu I would like the selected List Item to switch to an ItemEditTemplate.  However, the HierarchicalDataTemplate doesn't provide that option and putting an ItemEditTemplate in the PanelBar doesn't seem to do anything when I switch the item IsInEditMode = true.  What do I have to do to switch to my EditItemListTemplate?  Thank you for your help!!

Edit: I am developing in .Net 3.5 C#, using Telerik WPF 2011.03.1219.0.

<HierarchicalDataTemplate x:Key="ItemListTemplate"   >
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Path=ThumbnailFile}" Height="20" Width="20"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </HierarchicalDataTemplate>
        <DataTemplate x:Key="EditItemListTemplate">
            <StackPanel Orientation="Horizontal" Background="Green">
                <Image Source="{Binding Path=ThumbnailFile}" Height="20" Width="20"/>
                <TextBox Text="{Binding Name, Mode=TwoWay}"/>
            </StackPanel>
        </DataTemplate>
        <HierarchicalDataTemplate x:Key="NavListTemplate"
                                  ItemsSource="{Binding ItemLists}"
                                  ItemTemplate="{StaticResource ResourceKey=ItemListTemplate}"
                                  >
            <TextBlock Text="{Binding Name}" />
        </HierarchicalDataTemplate>
 
...
 
<telerik:RadPanelBar  ItemsSource="{Binding NavSections}"  ItemTemplate="{StaticResource ResourceKey=NavListTemplate}"
                              ExpandMode="Multiple" HorizontalAlignment="Stretch"   VerticalAlignment="Top"
                              SelectedItem="{Binding Path=SelectedItemList, Mode=TwoWay}"  Margin="1"
                              IsEditable="True" ItemEditTemplate="{StaticResource ResourceKey=EditItemListTemplate}">
            <telerikNavigation:RadContextMenu.ContextMenu>
                <telerikNavigation:RadContextMenu x:Name="ContextMenu" Opened="ContextMenu_Opened" ItemClick="ContextMenu_ItemClick">
                    <telerikNavigation:RadMenuItem Header="Rename"/>
                    <telerikNavigation:RadMenuItem Header="Delete"/>
                    <telerikNavigation:RadMenuItem Header="Select" FontWeight="Bold"/>
 
                </telerikNavigation:RadContextMenu>
            </telerikNavigation:RadContextMenu.ContextMenu>
 
        </telerik:RadPanelBar>

Will
Top achievements
Rank 1
 answered on 16 Aug 2012
10 answers
382 views
I am building multi-axes line graphs using the RADCartesianChart control.
If I fill in the control using XAML, I get PanZoomBars as expected.  See sample XAML below

<UserControl x:Class="TestTelerik.ChartViewUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:TestTelerik="clr-namespace:TestTelerik"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
<UserControl.DataContext>
<TestTelerik:ViewModel/>
</UserControl.DataContext>
<Grid>
<telerik:RadCartesianChart Name="Chart" Zoom="{Binding Path=Zoom, Mode=TwoWay}" PanOffset="{Binding Path=PanOffset, Mode=TwoWay}">
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:LinearAxis Name="Time" Title="Time (sec)"/>
</telerik:RadCartesianChart.HorizontalAxis>


<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Name="Speed" Title="Speed (km/h)"/>
</telerik:RadCartesianChart.VerticalAxis>


<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Both" PanMode="Both"/>
<telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" ShowTrackInfo="False"/>
</telerik:RadCartesianChart.Behaviors>

<telerik:ScatterLineSeries ItemsSource="{Binding Data}" YValueBinding="vCar" XValueBinding="Time" Stroke="Black" DisplayName="vCar"/>
<telerik:ScatterLineSeries ItemsSource="{Binding Data}" YValueBinding="sLap" XValueBinding="Time" Stroke="Blue">
<telerik:ScatterLineSeries.VerticalAxis>
<telerik:LinearAxis Name="sLap" Title="Distance (m)"/>
</telerik:ScatterLineSeries.VerticalAxis>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries ItemsSource="{Binding Data}" YValueBinding="ETyreTotalFL" XValueBinding="Time" Stroke="Red">
<telerik:ScatterLineSeries.VerticalAxis>
<telerik:LinearAxis Name="ETyreTotalFL" Title="Energy (kJ)"/>
</telerik:ScatterLineSeries.VerticalAxis>
</telerik:ScatterLineSeries>


<telerik:RadCartesianChart.Grid>
<telerik:CartesianChartGrid MajorLinesVisibility="XY"  />
</telerik:RadCartesianChart.Grid>


</telerik:RadCartesianChart>
</Grid>
</UserControl>

If I attempt the same thing in code, then the graphs appear correctly, but the PanZoomBars are missing! 
Code extract from a user control code behind file showing how I am filling in the control is shown below  (NOTE chart is a RadCartesianChart control specified in XAML of the UserControl).  

private void UpdateFromCollection()
{
if ((XAxes != null) && XAxes.Any() && (YAxes != null) && YAxes.Any())
{
var xAxis = XAxes.First();
this.Chart.HorizontalAxis = new LinearAxis
                            {Name = xAxis.Name, Title = string.Format("{0} ({1})", xAxis.Name, xAxis.Units)};


this.Chart.Behaviors.Clear();
var panAndZoomBehavior = new ChartPanAndZoomBehavior();
panAndZoomBehavior.ZoomMode = ChartPanZoomMode.Both;
panAndZoomBehavior.PanMode = ChartPanZoomMode.Both;
this.Chart.Behaviors.Add(panAndZoomBehavior);


var trackBallBehaviour = new ChartTrackBallBehavior();
trackBallBehaviour.ShowIntersectionPoints = true;
trackBallBehaviour.ShowTrackInfo = false;
this.Chart.Behaviors.Add(trackBallBehaviour);


this.Chart.Series.Clear();
bool firstYAxis = true;
foreach (var yAxis in YAxes)
{
var scatterLineSeries = new ScatterLineSeries {DisplayName = yAxis.Name};
scatterLineSeries.Stroke = new SolidColorBrush(yAxis.Colour);

for (var i = 0; i < xAxis.Data.Count; i++)
{
var sp = new ScatterDataPoint { XValue = xAxis.Data[i], YValue = yAxis.Data[i] };
scatterLineSeries.DataPoints.Add(sp);
}
if (firstYAxis)
{
this.Chart.VerticalAxis = new LinearAxis() { Name = yAxis.Name, Title = string.Format("{0} ({1})", yAxis.Name, yAxis.Units) };
firstYAxis = false;
}
else
{
scatterLineSeries.VerticalAxis = new LinearAxis() { Name = yAxis.Name, Title = string.Format("{0} ({1})", yAxis.Name, yAxis.Units) };
}
this.Chart.Series.Add(scatterLineSeries);
}
}
}


Is there something else I have to specify in order to get the PanZoomBars included?

Regards
Craig Littlewood





Ves
Telerik team
 answered on 16 Aug 2012
7 answers
143 views
Hi all,

I am using a custom min/max value for my x-axis (mainly to simulate the live data feel by scrolling the x-axis on every data update). However, it seems that when I run for the graph for a long period of time, the data points that should be out of the graph display range are being displayed on the edge of the graph instead of being omitted completely. Attached is a screenshot of the issue. 

I read somewhere else that this is a known issue. If so, are there any workarounds for omitting the data that won't fit in the current x-axis?

Furthermore, I also tried the workaround of having two separate data sets (one for storing all past values and another for holding the actual displayed data, which is a subset of the previous). However, when I change the ItemsSource from one to the other, the graph displays some strange behavior (erratic line drawings, etc.), which is why I am hoping to find a workaround without having to switch my data source.

Thanks,
Jin
Yavor
Telerik team
 answered on 16 Aug 2012
3 answers
175 views
Hi,
Is it possible to get the X and Y values of the point, where user right clicked on the Stacked Area to open the context Menu?
Or any nearby DataPoint  X,Y Values.

Please Reply as soon as possible.

Thanks in Advance.
Petar Kirov
Telerik team
 answered on 16 Aug 2012
2 answers
315 views

Hello,

I am looking for some sample code for raddiagramcontrols loading asynchronously using a background worker. Please share if you have any

Francois Vanderseypen
Top achievements
Rank 2
 answered on 16 Aug 2012
1 answer
152 views
Hello,

I need to hide minimize and maximize buttons in my radwindow.
I used your example on http://www.telerik.com/community/forums/wpf/window/window-style-and-template.aspx and modified ControlTemplate to hide the buttons, its works fine.
But I use a Style Manager in my Application
            StyleManager.ApplicationTheme = new Expression_DarkTheme();

After adding the ControlTemplate I can't style Radwindow header anymore.
Can you please help me ?









Lancelot
Top achievements
Rank 1
 answered on 15 Aug 2012
3 answers
492 views
i need 2 clarification

1.


i need to give notification using popup window instead of alert. is there any control to implement popup.

2.

i am having a Business Object Named Customer. i am binding the customer collection to RadGridView. i need to add the new row on top of the gridview. i have given the code

<Grid>
       <telerik:RadGridView AutoGenerateColumns="False" EditTriggers="F2" HorizontalAlignment="Left" Name="rgrdCustomer" RowIndicatorVisibility="Visible" VerticalAlignment="Top" AddingNewDataItem="rgrdCustomer_AddingNewDataItem" Deleting="rgrdCustomer_Deleting" RowEditEnded="rgrdCustomer_RowEditEnded" RowValidating="rgrdCustomer_RowValidating" ActionOnLostFocus="CancelEdit">
           <telerik:RadGridView.Columns>
               <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerID}" Header="ID" IsReadOnly="True" Width="50" IsFilterable="False" IsGroupable="False" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerName}" Header="CustomerName*" Width="250" IsFilterable="False" IsGroupable="False" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding OpeningBalance}" Header="OpeningBalance" DataFormatString="{} {0:##,##,##0.00}" Width="100" TextAlignment="Right" IsResizable="False" IsFilterable="False" IsGroupable="False" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding ContactNumber}" Header="ContactNumber" Width="100" IsResizable="False" IsFilterable="False" IsGroupable="False" />
 
           </telerik:RadGridView.Columns>
       </telerik:RadGridView>
   </Grid>

class CustomerBO
   {
 
       #region Fields
               
       private int _CustomerID;
       private string _CustomerName;
       private decimal _OpeningBalance;
       private string _ContactNumber;
 
       #endregion
 
       #region Properties
 
       public int CustomerID
       {
           get { return _CustomerID; }
           set { _CustomerID = value; }
       }       
 
       public string CustomerName
       {
           get { return _CustomerName; }
           set { _CustomerName = value; }
       }       
 
       public decimal OpeningBalance
       {
           get { return _OpeningBalance; }
           set { _OpeningBalance = value; }
       }
 
 
       public string ContactNumber
       {
           get { return _ContactNumber; }
           set { _ContactNumber = value; }
       }
 
       #endregion
 
   }

public partial class CustomerView : UserControl
 {
     public CustomerView()
     {
         InitializeComponent();
     }
 
     private void rgrdCustomer_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
     {
         e.NewObject = new CustomerBO();
     }
 
     private void rgrdCustomer_Deleting(object sender, Telerik.Windows.Controls.GridViewDeletingEventArgs e)
     {
         CustomerDAL customerdata = new CustomerDAL();
 
         if (e.Items.Count() != 1)
         {
             Notification.ErrorMessage("More than one Customer Selected");
         }
 
         else
         {
             foreach (CustomerBO customer in e.Items)
             {
                 customerdata.Delete(customer.CustomerID);
                 Notification.InformationMessage("Deleted Sucessfully");
             }
         }
     }
 
     private void rgrdCustomer_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
     {
         if (e.EditAction == GridViewEditAction.Cancel)
         {
             return;
         }
 
         try
         {
             if (e.EditOperationType == GridViewEditOperationType.Insert)
             {
                 CustomerDAL customerdata = new CustomerDAL();
                 CustomerBO customerentity = (CustomerBO)e.NewData;
                 customerdata.Insert(customerentity);
                 this.LoadData();
                 Notification.InformationMessage("Added Successfully");
             }
 
             if (e.EditOperationType == GridViewEditOperationType.Edit)
             {
                 CustomerDAL customerdata = new CustomerDAL();
                 customerdata.Update((CustomerBO)e.NewData);
                 Notification.InformationMessage("Updated Successfully");
             }
             this.LoadData();
         }
         catch (Exception ex)
         {
             Notification.ErrorMessage(ex.Message);
         }
     }
 
     private void rgrdCustomer_RowValidating(object sender, Telerik.Windows.Controls.GridViewRowValidatingEventArgs e)
     {
 
         CustomerBO customer = e.Row.DataContext as CustomerBO;
 
         if (String.IsNullOrEmpty(customer.CustomerName) || customer.CustomerName.Length > 50)
         {
             RowValidation.Validate("CustomerName", "Fill the Customer Name", e);
         }
 
     }
 
     private void UserControl_Loaded(object sender, RoutedEventArgs e)
     {
         this.LoadData();
         this.rgrdCustomer.Focus();
     }
 
     private void LoadData()
     {
         CustomerDAL customerdata = new CustomerDAL();
         this.rgrdCustomer.ItemsSource = customerdata.FetchAll();
     }
 
      
 }

Dimitrina
Telerik team
 answered on 15 Aug 2012
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?