Telerik Forums
UI for WPF Forum
2 answers
223 views
Hi,

I have a RadGridView that has several columns with readonly set to false (ie. these can be edited). Predictably, when I edit a particular cell, the changes are changed in the relevant row in my Collection in my viewmodel when the user presses enter or clicks somewhere else.

When a change is made, I update my database.There is one or two checks I make and then the database update call itself could throw an exception so I also have a catch that reverts the values back to the original values (using e.OldValues).

Currently, similar to the example provided by Veselin in this thread, I use the RowEditEnded event handler. However, I would like to have all this logic in my ViewModel. What are my options? Do I have any? Ofcourse examples are a big help.

Thanks
Peter
Top achievements
Rank 1
 answered on 12 Jun 2012
0 answers
162 views
Hi telerk,

I have a table Customers which has 80000 records and my project use a grid to show them(not use Datapager). It can be showed correctly, but it load all data into memory and takes about 150 MB! I heard that RadGridView support data virtualization if its container like grid which have a fixed height.  I make a sample project to verify this,  but it still loaded all data and take amount memory.
How I can do this? Because I can not open the UIVirtulization sample on your WPF samples, Could you send me a sample project for this? Thanks very much
this is  MainWindow code:
<Grid>
       <Grid.RowDefinitions>
           <RowDefinition Height="500"/>
           <RowDefinition Height="50" />
       </Grid.RowDefinitions>
       <telerik:RadGridView ItemsSource="{Binding MyCollection}"  AutoGenerateColumns="False"
                         >
           <telerik:RadGridView.Columns>
               
               <telerik:GridViewDataColumn Header="CustommerNumber" DataMemberBinding="{Binding CustomerNumber}" IsGroupable="False" IsFilterable="False" />
               <telerik:GridViewDataColumn Header="CompanyName" DataMemberBinding="{Binding CompanyName}" IsSortable="False" />
               <telerik:GridViewDataColumn Header="Address" DataMemberBinding="{Binding Address}" />
               <telerik:GridViewDataColumn Header="PoBox" DataMemberBinding="{Binding POBox}" />
               <telerik:GridViewDataColumn Header="PostalCode" DataMemberBinding="{Binding PostalCode}" />
               <telerik:GridViewDataColumn Header="ContactName" DataMemberBinding="{Binding ContactName}" />
               <telerik:GridViewDataColumn Header="Phone" DataMemberBinding="{Binding Phone}" />
               <telerik:GridViewDataColumn Header="Fax" DataMemberBinding="{Binding Fax}" />
               <telerik:GridViewDataColumn Header="Country" DataMemberBinding="{Binding Country}" />
               <telerik:GridViewDataColumn Header="Mobile" DataMemberBinding="{Binding Mobile}" />
           </telerik:RadGridView.Columns>
       </telerik:RadGridView>
       <ScrollViewer x:Name="LogScrollViewer" VerticalAlignment="Stretch" Grid.Row="1" >
           <!--<Button Click="Button_Click" Content="Load"/>-->
           <TextBox x:Name="tbMemory" Width="200" Height="30"></TextBox>
           <!--<TextBlock x:Name="Log" TextWrapping="Wrap" FontSize="10" />-->
       </ScrollViewer>
 
   </Grid>
public MainWindow()
       {
           //MessageBox.Show("loading main window");
 
           InitializeComponent();
           DispatcherTimer timer = new DispatcherTimer();
           timer.Interval = new TimeSpan(0, 0, 1);
           timer.Tick += timer_Tick;
           timer.Start();
           //MessageBox.Show("2");
           this.DataContext = new MyViewModel();
            
       }


this is MyViewModel code:
class MyViewModel : INotifyPropertyChanged
    {
         #region INotifyPropertyChanged Members
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        protected void OnPropertyChanged(string propertyName)
        {
                         
            PropertyChangedEventHandler handler = PropertyChanged;
 
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
 
        #endregion
 
        private RXOfficeEntities context = null;
 
        private ObservableCollection<Customer> _MyCollection = null;
        public ObservableCollection<Customer> MyCollection
        {
            get { return _MyCollection; }
            set { _MyCollection = value; OnPropertyChanged("MyCollection"); }
        }
         
        public MyViewModel()
        {
            context = new RXOfficeEntities();
            MyCollection = new ObservableCollection<Customer>(context.Customers);
        }



Deng
Top achievements
Rank 1
 asked on 12 Jun 2012
6 answers
86 views
Hi there,

RadListBox is missing in 2011 Q3 , how to get it as i required to use it or is there any alternative of it.
Usman
Top achievements
Rank 1
 answered on 12 Jun 2012
2 answers
194 views
Hello!

I have an ImageEditor with custom UI and everything is working great, I just want to change some functionality of the Open button. When the user clicks on it, the OpenFileDialog open but the pre-defined file type is *.PNG and every time he need's to change it to .JPG.

Is there a way to override the OpenCommand and change the default file type of the Dialog window?

Here's the code of the button:

<telerik:RadImageEditorButton Grid.Column="0"
                              Image="/Telerik.Windows.Controls.ImageEditor;Component/Images/open.png"
                              Command="{Binding Commands.Open, ElementName=imageEditor}" />

Thanks!
Iva Toteva
Telerik team
 answered on 12 Jun 2012
1 answer
126 views
Is there a plan to update the release notes? Am I just looking in the wrong place?

http://www.telerik.com/versionnotes.aspx?id=2843 

Greg
Dimitrina
Telerik team
 answered on 12 Jun 2012
5 answers
213 views
Hi,

I.m using WPF and Telerik 2012.1.326.35 and I remark a translation problem with the RadDatePicker. All my environment is in french but when I manually enter a wrong date in the control, a tooltip appear in english with the word "Error".

How I can fix this???

Thank's
Vladi
Telerik team
 answered on 12 Jun 2012
3 answers
147 views
Looking through the code of the 2012 Q2 release it appears if I can register my own IRoutingService I would be able to control the lines drawn for my connections. 

First is that true statement?  And if so is there a sample on how to do that?

Thanks
Donovan
donovan
Top achievements
Rank 1
 answered on 12 Jun 2012
8 answers
488 views
Hi guys, 

Can you please help me on how to insert RadGrid and RadButton inside a RadTabItem of the RadControl?
Pretty please. Thanks.


Y
Hristo
Telerik team
 answered on 12 Jun 2012
6 answers
546 views
Telerik file version: 2010.3.1110.40
Preferred Language C#

I apologize if this has been asked somewhere, but I could not find it.

I have a a GridView with several auto generated check boxes.  I am trying to apply the following style in the resources to enable one click editing:

<Style TargetType="{x:Type telerik:GridViewCheckBoxColumn}">        
       <Setter Property="EditTriggers" Value="CellClick"/>
       <Setter Property="AutoSelectOnEdit" Value="True"/>
</Style>

Aside from the style not applying to the generated checkbox columns, the AutoSelectOnEdit property is is saying “Exception thrown by the target of the invocation”.  

Is there a way to apply these properties to the entire page?
May
Top achievements
Rank 1
 answered on 12 Jun 2012
1 answer
948 views
The silverlight forums have this exact same question and a great solution for it: http://www.telerik.com/community/forums/silverlight/window/handle-click-outside-window-in-showdialog.aspx#0
However, the solution doesn't work in WPF.

Basically I need to be able to close the RadWindow if the user clicks outside of it. For the silverlight version, the canvas that covers the application is exposed and I can attach a MouseLeftButtonDown event handler to it. I haven't been able to do this for the WPF version because none of the accessible parents are the background where a user would click. The parents of the RadWindow are ContentPresenter, AdornerPresenter, Border, and then InternalWindow (I can't access InternalWindow).

Thanks in advance!
Ivo
Telerik team
 answered on 12 Jun 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?