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

i have a working RadGridView with an XML-File which is bind by XMLDataProvider. I want to use a Telerik RadButton with a Command to insert, delete or edit Rows. But it does not work:

CODE:
                                                        <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="left" Margin="0,5,0,0">
                                                            <telerik:RadButton Width="100" Content="Delete selected rows" Margin="0,0,5,0"
                                                                                Command="telerikGrid:RadGridViewCommands.Delete" CommandTarget="{Binding ElementName=radGridView2}"  />
                                                            <telerik:RadButton Width="100" Content="Add new row" Margin="0,0,5,0"
                                                                                Command="telerikGrid:RadGridViewCommands.BeginInsert" CommandTarget="{Binding ElementName=radGridView2}"  />
                                                            <telerik:RadButton Width="100" Content="Save insert/edit" Margin="0,0,5,0"
                                                                                Command="telerikGrid:RadGridViewCommands.CommitEdit" CommandTarget="{Binding ElementName=radGridView2}"  />
                                                            <telerik:RadButton Width="100" Content="Cancel insert/edit"
                                                                                Command="telerikGrid:RadGridViewCommands.CancelRowEdit" CommandTarget="{Binding ElementName=radGridView2}"  />
                                                        </StackPanel>
                                                        <Grid Grid.Row="1">                                                           
                                                            <Grid.Resources>
                                                                <XmlDataProvider x:Key="MADSource" Source="settings\mandanten.xml" XPath="//Attributes/Attribute[@AttributeGroup='Mandant']"></XmlDataProvider>
                                                            </Grid.Resources>
                                                            <telerik:RadGridView Visibility="Visible" x:Name="radGridView2" AutoGenerateColumns="False" ItemsSource="{Binding Source={StaticResource MADSource}}"
                                                                                 CanUserDeleteRows="True" CanUserInsertRows="True" IsReadOnly="False" ShowGroupPanel="False" SelectionMode="Extended">
                                                                <telerik:RadGridView.Columns>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding XPath=ContentAttribute[@AttributeName\=\Name] }" Header="Name" Width="120">
                                                                        <telerik:GridViewDataColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <ContentControl Content="{Binding XPath=ContentAttribute[@AttributeName\=\'Name\']}">
                                                                                </ContentControl>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewDataColumn.CellTemplate>
                                                                    </telerik:GridViewDataColumn>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding XPath=ContentAttribute[@AttributeName\=\Host] }" Header="Host" Width="100">
                                                                        <telerik:GridViewDataColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <ContentControl Content="{Binding XPath=ContentAttribute[@AttributeName\=\'Host\']}">
                                                                                </ContentControl>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewDataColumn.CellTemplate>
                                                                    </telerik:GridViewDataColumn>
                                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding XPath=ContentAttribute[@AttributeName\=\Port] }" Header="Port" Width="50">
                                                                        <telerik:GridViewDataColumn.CellTemplate>
                                                                            <DataTemplate>
                                                                                <ContentControl Content="{Binding XPath=ContentAttribute[@AttributeName\=\'Port\']}">
                                                                                </ContentControl>
                                                                            </DataTemplate>
                                                                        </telerik:GridViewDataColumn.CellTemplate>
                                                                    </telerik:GridViewDataColumn>
                                                                </telerik:RadGridView.Columns>
                                                            </telerik:RadGridView>
CODEBEHIND:
    Public Sub New()

        Dim deleteCommand As ICommand = RadGridViewCommands.Delete
        Dim beginInsertCommand As ICommand = RadGridViewCommands.BeginInsert
        Dim cancelRowEditCommand As ICommand = RadGridViewCommands.CancelRowEdit
        Dim commitEditCommand As ICommand = RadGridViewCommands.CommitEdit

        InitializeComponent()
    End Sub

I get no errors, but the buttons do not work and i can't edit the Columns. HELP!!!
Rene
ITA
Top achievements
Rank 1
 asked on 28 Jun 2011
4 answers
231 views
Hi,

How can I format time to display it in 24 format ?
ThomasJ
Top achievements
Rank 2
 answered on 28 Jun 2011
1 answer
150 views
Hello All,

I use Schedule view. After creating an appointment when I want to resize it using the mouse, the resize animation is not visible, say I dont see till which point I dragged it. But  in examples it is available. Can any one help me getting this particular behaviour

Dheena
Konstantina
Telerik team
 answered on 28 Jun 2011
3 answers
132 views
Searching for a WPF property grid I found this forum. I'm implementing a solution, where I need a property grid soon.

How long will it take until you release it?

Greets
Rossen Hristov
Telerik team
 answered on 28 Jun 2011
4 answers
188 views
Where is the documentation for how to build expressions in the editor?

the functions that I need are not working properly or I'm using it in a wrong way

Yavor Georgiev
Telerik team
 answered on 28 Jun 2011
2 answers
268 views

Hy,

When moving our application window or resizing it then we get an ArgumentNullException in the DataItemAutomationPeer class.

We are currently on the binaries RadControls for WPF Q1 2011.
I looked at the currently available source code "01348RadControls_for_WPF_40_2011_1_0613_DEV_hotfix".

Callstack on Exception:
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.Automation.DataItemAutomationPeer.DataItemAutomationPeer(object dataItem, Telerik.Windows.Controls.GridView.Automation.GridViewDataControlAutomationPeer dataControlAutomationPeer) Line 78 C#
> Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.Automation.GridViewDataItemAutomationPeer.GridViewDataItemAutomationPeer(object dataItem, Telerik.Windows.Controls.GridView.Automation.GridViewDataControlAutomationPeer dataControlAutomationPeer) Line 25 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.Automation.RadGridViewAutomationPeer.CreateDataItemAutomationPeer(object dataItem) Line 97 + 0x2f bytes C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.Automation.GridViewDataControlAutomationPeer.GeneratePeersForDataItems(System.Collections.Generic.List<System.Windows.Automation.Peers.AutomationPeer> newPeerList, Telerik.Windows.Controls.GridView.Automation.AutomationPeerStorage<object,Telerik.Windows.Controls.GridView.Automation.DataItemAutomationPeer> oldCachedPeers) Line 111 + 0x1c bytes C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.Automation.GridViewDataControlAutomationPeer.GetItemPeers() Line 101 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.Automation.GridViewVirtualizingPanelAutomationPeer.GetChildrenCore() Line 79 + 0x21 bytes C#

What I saw in the source is:

In class GridViewDataControlAutomationPeer a check is done for (dataitem == null), see below:

        private void GeneratePeersForDataItems(List<AutomationPeer> newPeerList, AutomationPeerStorage<object, DataItemAutomationPeer> oldCachedPeers)
        {
            foreach (object dataItem in this.Items)
            {
                DataItemAutomationPeer dataItemPeer = oldCachedPeers.FindPeer(dataItem);

                if (dataItemPeer == null)
                    dataItemPeer = this.CreateDataItemAutomationPeer(dataItem);

                SetUpOwnerRowEventsSource(dataItemPeer);

                this.cachedPeers[dataItem] = dataItemPeer;
                newPeerList.Add(dataItemPeer);
            }
        }

Then later in the ctor of DataItemAutomationPeer I saw the following code:
        protected DataItemAutomationPeer(object dataItem, GridViewDataControlAutomationPeer dataControlAutomationPeer)
            : base(dataControlAutomationPeer.OwnerGridViewDataControl)
        {
            if (dataItem == null)
                throw new ArgumentNullException("dataItem");
            if (dataControlAutomationPeer == null)
                throw new ArgumentNullException("dataControlAutomationPeer");

            this.dataItem = dataItem;
            this.dataControlAutomationPeer = dataControlAutomationPeer;
        }

In my case I get the exception from this check in the ctor.

Kind regards,
Yvonne

Yvonne
Top achievements
Rank 1
 answered on 28 Jun 2011
3 answers
241 views
Hi,

I was trying to apply filter on DataGridView column(IsFilterable =True). But not able to show icon on column header. My column is bounded with ObservalCollection<MyType> and a am showing values in a Listbox.

Is it possible to show filtering on collection type column, also i want to show custom control(FilterControl) when user click on filter icon.
For example suppose my RadGridView bounded to a collection "ClaimList"
Collection ClaimList includes:
- Claim Number(int)
- Vehicle(String)
- Contact(String)
- Inspection date(DateTime)
- Next Actions (ObservalCollection<IClaimActions>)

The problem is with column Next Action which shows a list of possible actions on a particular Claim Number.

Thanks,
Umesh Kumar
Rossen Hristov
Telerik team
 answered on 28 Jun 2011
3 answers
76 views
Hi,
There is a problem with the forum's server when i try to acces to my post at http://www.telerik.com/community/forums/wpf/gridview/invalidoperationexception-when-group-sort-one-of-the-two-grids-binded-on-one-listcollectionview.aspx :

Oops...

It seems there was a problem with our server.

Cedric
Top achievements
Rank 1
 answered on 28 Jun 2011
1 answer
331 views
I have a Dell laptop running Windows 7 and Chrome 12.0 (most current version).  Here's what happens when I try to run the WPF demo:

1) I click "Click to Open" on the demo webpage
2) The XBAP downloads to my Downloads folder.
3) Chrome displays "This type of file can harm your computer.  Are you sure you want to download Telerik...amples.xbap?" on the downloads bar at the bottom of the Chrome window, with "Save" and "Discard" buttons.
4) I click "Save".
5) Return to step 2.

I stopped after I had 6 copies of the XBAP.

The demo runs on IE9 on the same laptop.  I would love to run the demo on Chrome, which appears to significantly faster on my laptop.
Dimitrina
Telerik team
 answered on 28 Jun 2011
1 answer
121 views

I am setting the itemsource of my radgridview using the code
WireInstructionDGV.ItemsSource = obj.GetWireInstruction("BNYBD", "MST", "CPTY", "USD")

To add a new row, i have a button who's click event has
Me.WireInstructionDGV.BeginInsert()

Clicking on the button does not add a new row in the datagrid. any ideas ?

(I do not have IsReadOnly = True or CanUserInsertRows  = False)
Tarun
Top achievements
Rank 1
 answered on 27 Jun 2011
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?