Telerik Forums
UI for WPF Forum
2 answers
409 views
I want to have a column wich contains values 1 - n and 'N/A'. I can use a nullable int and TargetNullValue.

DataMemberBinding="{Binding Difference, TargetNullValue=N/A}" 
but then i cant filter by writing 'N/A' i must write 'null' wich is not acceptable. Also the null value (N/A) is not listed in the select filter dialog.

I could also instead of a nullable int use a string, but then the sorting is done in ascii order and not natural order, so if i sort i will get a list with 1, 10, 127, 2 and so on. I would suggest that strings should be sorted in the natural order by default with a option to sort by ascii order. If i do a custom sort the filter dialog is not sorted the same way wich makes it look wierd.

so my question is, how can i make the column and the filter dialog sort the way i want?
Robert
Top achievements
Rank 1
 answered on 18 Dec 2009
3 answers
171 views
I built a simple app with only a grid with four columns (Id, Name, Gender and Active). After I got my app running I clicked on the Id column and the checkbox of the active column, wich is the GridViewSelectColumn, got selected too. Is this a bug or something? Can anyone provide an application that´s working so I can see what the problem is?

WPF version : I´m using the latest trial version of RadControls for WPF
OS: Win 7 Ultimate
Preferred programming language: C#

Thanks in advance.
Milan
Telerik team
 answered on 18 Dec 2009
1 answer
111 views
Due to some errors I was having in Q2, I thought I would upgrade to Q3. Now my Grid's hierarchy doesn't work anymore. I installed the update, removed my references from my project, then added the new ones. The plus signs load but they don't actually expand when clicked.

I looked at the examples and made one change to reflect the example but still no luck.

<Window x:Class="WTSCGCAppInterface.Header" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:TelerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
    Title="Header" Height="600" Width="800" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    <Grid> 
        <telerik:RadWrapPanel Height="60" Name="radPnlFilter" VerticalAlignment="Top"
            <Label Grid.Row="0" Grid.Column="0">Cust#:</Label> 
            <TextBox x:Name="txtCustNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Label Grid.Row="0" Grid.Column="0">Week Ending#:</Label> 
            <TelerikInput:RadMaskedTextBox x:Name="txtWeekEnding" Mask="##/##/####" Grid.Row="0" Grid.Column="0"></TelerikInput:RadMaskedTextBox> 
            <Label Grid.Row="0" Grid.Column="0">Job#:</Label> 
            <TextBox x:Name="txtJobNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Label Grid.Row="0" Grid.Column="0">Sub Job#:</Label> 
            <TextBox x:Name="txtSubJobNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Button x:Name="btnFilter" Click="btnFilter_Click">Apply Filter</Button> 
        </telerik:RadWrapPanel>        
        <telerik:RadGridView Margin="0,58,0,0" Name="radGrdVwHeader" AutoGenerateColumns="False" ColumnsWidthMode="Fill" RowLoaded="radGrdVwHeader_RowLoaded"
            <telerik:RadGridView.Columns>    
                <telerik:GridViewDataColumn Header="HSTAT" UniqueName="HSTAT" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HCONO" UniqueName="HCONO" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HDVNO" UniqueName="HDVNO" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HSEQ" UniqueName="HSEQ" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HCUST" UniqueName="HCUST" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="Job #" UniqueName="HJBNO" /> 
                <telerik:GridViewDataColumn Header="Sub Job #" UniqueName="HSJNO" /> 
                <telerik:GridViewDataColumn Header="Week Ending" UniqueName="HDTTK" /> 
                <telerik:GridViewDataColumn Header="HDSCD" UniqueName="HDSCD" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="Ticket#" UniqueName="HNUM0" /> 
                <telerik:GridViewDataColumn Header="Crew#" UniqueName="HDES0" /> 
                <telerik:GridViewDataColumn Header="District" UniqueName="HDES1" /> 
                <telerik:GridViewDataColumn Header="FMC#" UniqueName="HDES2" /> 
                <telerik:GridViewDataColumn Header="Division" UniqueName="HDES3" /> 
                <telerik:GridViewDataColumn Header="Local#" UniqueName="HDES4" /> 
                <telerik:GridViewDataColumn Header="Crew Type" UniqueName="HDES5" /> 
                <telerik:GridViewDataColumn Header="Zone" UniqueName="HDES6" />                                                                                                               
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.ChildTableDefinitions> 
                <telerik:GridViewTableDefinition/> 
            </telerik:RadGridView.ChildTableDefinitions> 
            <telerik:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <telerik:RadGridView x:Name="ProdData" AutoGenerateColumns="False"
                        <telerik:RadGridView.Columns> 
                            <telerik:GridViewDataColumn Header="PCWNO" UniqueName="PCWNO" /> 
                        </telerik:RadGridView.Columns> 
                    </telerik:RadGridView> 
                </DataTemplate> 
            </telerik:RadGridView.HierarchyChildTemplate> 
        </telerik:RadGridView>                
    </Grid> 
</Window> 
 

private void btnFilter_Click(object sender, RoutedEventArgs e) 
        { 
            string sWeekEnding = txtWeekEnding.MaskedText; 
            string sAlteredFormat = sWeekEnding.Substring(6, 4) + sWeekEnding.Substring(0, 2) + sWeekEnding.Substring(3, 2); 
             
            radGrdVwHeader.ItemsSource = _headerRecs.GetHeaderRecs(1, 0, Convert.ToDecimal(txtCustNum.Text), Convert.ToDecimal(sAlteredFormat), txtJobNum.Text, txtSubJobNum.Text, nullnull"");             
 
            radGrdVwHeader.ChildTableDefinitions.Clear(); 
            GridViewTableDefinition proddataDefinition = new GridViewTableDefinition(); 
            proddataDefinition.Relation = new PropertyRelation("ProddataRecs"); 
            //this.radGrdVwHeader.TableDefinition.ChildTableDefinitions.Add(proddataDefinition); 
            this.radGrdVwHeader.ChildTableDefinitions.Add(proddataDefinition); 
                      
        } 






Vlad
Telerik team
 answered on 18 Dec 2009
4 answers
289 views
Is it possible to display the grid contents in column-row format instead of row-column format without programmatically loading the data in column-row format? What I am looking for is a setting (property) in the grid that I can change that will switch the rows and columns around. 
Jorge Gonzalez
Top achievements
Rank 1
 answered on 18 Dec 2009
6 answers
120 views
 CellRequestBringIntoView says its obsolete.  What is its replacement?  I'm using it to automatically enter edit mode.
Sean O'Dea
Top achievements
Rank 1
 answered on 17 Dec 2009
3 answers
260 views
Hi, I'm facing some problems with the RadGridView hierarchy. Any help would be greatly appreciated.

1. Nested DataTable works, but anyway to do it without loading the data of all child tables?

The following is an XML representation of the structure for the DataTable object used:
<CustomerTable> 
  <Customer> 
    <Name>John</Name> 
    <Sex>Male</Sex> 
    <AccountTable> 
      <Account> 
        <AccountNo>0001</AccountNo> 
        <Status>Active</Status> 
      </Account> 
    </AccountTable> 
  </Customer> 
  <Customer> 
    <Name>Lily</Name> 
    <Sex>Female</Sex> 
    <AccountTable> 
      <Account> 
        <AccountNo>0002</AccountNo> 
        <Status>Active</Status> 
      </Account> 
      <Account> 
        <AccountNo>0003</AccountNo> 
        <Status>Terminated</Status> 
      </Account> 
    </AccountTable> 
  </Customer> 
</CustomerTable> 

I've managed to get the hierarchy to work using this DataTable object, but I would have to load the data of all child tables (in this case

the AccountTable) before binding to the ItemsSource of the RadGridView control. Is there anyway to load the child table data only when a row is expanded?
Also, for my case I cannot hard code the structure in class files  (ie: creating Customer and Account classes) as shown in the examples in the demo.

2. Is there an event fired when a row is expanded to display child tables  (ie: + sign clicked)?

3. Can anyone provide an example on how to use the BuildHierachyFromDataSet method in the RadGridView?

Jeffrey
Top achievements
Rank 1
 answered on 17 Dec 2009
2 answers
126 views
Opening any .xaml files in the C# or VB demo's provided via the trial install causes Visual Studio 2008 to crash without warning.

Opening the same xaml files from the same solution in Blend 3, however, causes no issues.

I'd prefer to be able to browse the xaml in Visual Studio. Any insight into what may be causing this behaviour?

The event viewer shows the following application event which coincides with the visual studio crash:

.NET Runtime version 2.0.50727.3082 - Fatal Execution Engine Error (7A2E1132) (0)
David Romanchuk
Top achievements
Rank 1
 answered on 17 Dec 2009
1 answer
141 views
Hi,

I am facing a problem while deleting a record from the GridView, after clicking on the delete button, methods get executed and record is successfully deleted from the XML File and from the Observable collection property but the grid is not getting refreshed.  
could you please suggest me asap.

File Code:

Binding to grid using MVVM pattern i.e. datasource list is observable collection which assign to the view datacontext.

View Model Class:

public class ScenerioViewModel : ViewModelBase
    {
        private IScenerioRepository _repository;
        ObservableCollection<Scenerio> scenerio = new ObservableCollection<Scenerio>();
        #region Constructor
        public ScenerioViewModel (): this(new ScenerioRepository())
        {
            // Blank
        }
        public ScenerioViewModel(IScenerioRepository repository)
        {
            _repository = repository;
            GetAllRecords();
        }
        #endregion Constructor
        public ObservableCollection<Scenerio> OCScenario
        {
            get { return scenerio; }
        }
        
        private void GetAllRecords()
        {
            scenerio.Clear();
            List<Scenerio> scenerioList = _repository.GetAllRecords();
            foreach (Scenerio sce in scenerioList)
            {
                scenerio.Add(sce);
            }
        }

        private RelayCommand deleteData;
        public ICommand ICDeleteData
        {
            get
            {
                if (deleteData == null)
                {
                    deleteData = new RelayCommand(param => DeleteData());
                }
                return deleteData;
            }
        }

        private void DeleteData()
        {
            _repository.DeleteRecord(scenerio.FirstOrDefault());
            GetAllRecords();
        } 

XAML File code:
<telerik:RadGridView x:Name="YeildCurveGrid"  ItemsSource="{Binding Path=OCScenario/ListYeildCurve}" AutoGenerateColumns="False" DataLoadMode="Asynchronous"  ColumnWidth="*" RowIndicatorVisibility="Collapsed" IsFilteringAllowed="False" ShowGroupPanel="False" >
<telerik:GridViewDataControl.Columns>
 <telerik:GridViewDataColumn Header="Select" DataMemberBinding="{Binding IsSelected}" IsFilterable="False" IsSortable="False">
    <telerik:GridViewDataColumn.CellTemplate>
          <DataTemplate>
               <CheckBox IsChecked="{Binding IsSelected}"/>
         </DataTemplate>
   </telerik:GridViewDataColumn.CellTemplate>
 </telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="GUID" IsVisible="False" IsFilterable="False" DataMemberBinding="{Binding GUID}" IsReadOnly="True" IsSortable="False" ></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="Code" IsFilterable="False" DataMemberBinding="{Binding CrncyCode}" IsReadOnly="True" IsSortable="False"  Background="BlanchedAlmond" ></telerik:GridViewDataColumn>
</telerik:GridViewDataColumn>
</telerik:GridViewDataControl.Columns>
</grid:RadGridView>

<Button x:Name="btnDelete" Command="{Binding ICDeleteData}" Content="Delete" ></Button>


Thanks,
Gorakhnath Choudhary
Milan
Telerik team
 answered on 17 Dec 2009
3 answers
184 views
I'm working on application using Prism and yours Q3 WPF controls. Unfortunately when I'm trying to dock control in another dock region the InvalidOperationException is thrown. Exception message says I should use ItemsControl.ItemsSource instead of ItemsSource and I really don`t known how to solve this.

Below you'll find my region adapter class, dockable view class and docking container declaration in main window

Region adapter
namespace LTD.Desktop.Common 
    public class RadPaneGroupRegionAdapter : RegionAdapterBase<RadPaneGroup> 
    { 
        public RadPaneGroupRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory) 
            : base(regionBehaviorFactory) 
        { 
        } 
 
        protected override void Adapt(IRegion region, RadPaneGroup regionTarget) 
        { 
            region.Views.CollectionChanged += (s, e) => 
            { 
                switch (e.Action) 
                { 
                    case NotifyCollectionChangedAction.Add: 
                        foreach (var item in e.NewItems.OfType<RadPane>()) 
                        { 
                            regionTarget.AddItem(item, Telerik.Windows.Controls.Docking.DockPosition.Center); 
                        } 
                        break
                    case NotifyCollectionChangedAction.Remove: 
                        foreach (var item in e.OldItems.OfType<RadPane>()) 
                        { 
                            item.RemoveFromParent(); 
                        } 
                        break
                    case NotifyCollectionChangedAction.Replace: 
                        { 
                            var oldItems = e.OldItems.OfType<RadPane>(); 
                            var newItems = e.NewItems.OfType<RadPane>(); 
                            var newItemsEnumerator = newItems.GetEnumerator(); 
                            foreach (var oldItem in oldItems) 
                            { 
                                var parent = oldItem.Parent as ItemsControl; 
                                if (parent != null && parent.Items.Contains(oldItem)) 
                                { 
                                    parent.Items[parent.Items.IndexOf(oldItem)] = newItemsEnumerator.Current; 
                                    if (!newItemsEnumerator.MoveNext()) 
                                    { 
                                        break
                                    } 
                                } 
                                else 
                                { 
                                    oldItem.RemoveFromParent(); 
                                    regionTarget.Items.Add(newItemsEnumerator.Current); 
                                } 
                            } 
                        } 
                        break
                    case NotifyCollectionChangedAction.Reset: 
                        regionTarget 
                            .EnumeratePanes() 
                            .ToList() 
                            .ForEach(p => p.RemoveFromParent()); 
                        break
                    default
                        break
                } 
            }; 
 
            foreach (var view in region.Views.OfType<RadPane>()) 
            { 
                regionTarget.Items.Add(view); 
            } 
        } 
 
        protected override IRegion CreateRegion() 
        { 
            return new AllActiveRegion(); 
        } 
    } 

Dockable view
namespace LTD.Examples.Modularity.Views 
    /// <summary> 
    /// Interaction logic for ExampleView.xaml 
    /// </summary> 
    public partial class ExampleView : RadDocumentPane 
    { 
        public ExampleView() 
        { 
            InitializeComponent(); 
        } 
    } 

<telerik:RadDocumentPane x:Class="LTD.Examples.Modularity.Views.ExampleView" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    Header="Example panel"/> 
 

ExampleView class in design time also generate en error: Could not create an instance of type 'RadDocumentPane'

Views container:
<!-- Workspaces container --> 
        <telerik:RadDocking Name="Workspaces" DockPanel.Dock="Bottom" cal:RegionManager.RegionName="Workspaces"
            <telerik:RadDocking.DocumentHost> 
                <telerik:RadSplitContainer> 
                    <telerik:RadPaneGroup cal:RegionManager.RegionName="MainRegion" /> 
                </telerik:RadSplitContainer> 
            </telerik:RadDocking.DocumentHost> 
        </telerik:RadDocking> 

It's critical for me, so I'll be appreciate for any help.

Regards,
MC.
Maciej Czerwiakowski
Top achievements
Rank 1
 answered on 17 Dec 2009
1 answer
189 views
How do we commit the changes made to data in a datagrid when using a dataset as a datasource.?

Ive tried using the tableapapter.update()
and
the radgridview.commitchanges()
methods but the changes are not persisted to the database.

Do we need to use the Telereik ORM (which I have never looked at)..will ORM work with access MDB's?

or should I work towards updating my access to sql and use entity models. (of which I have spent some time working so I'm familiar with it) ??
then just use the context.save() and let entity framework handle the plumbing

Suggestions, advice..Success/horror stories? 
Nedyalko Nikolov
Telerik team
 answered on 17 Dec 2009
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
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?