This question is locked. New answers and comments are not allowed.
Hi,
I am using a radgridview control and binding it via c# code like this....
The grid gets loaded with data but the add button does not work. I click it but nothing happens. Can someone pls. help to get this function running.
Thanks
Ole
I am using a radgridview control and binding it via c# code like this....
<navigation:Page xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="PriceBank.Views.ChapterSetup" mc:Ignorable="d" xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" d:DesignWidth="640" d:DesignHeight="480" Title="ChapterSetup Page"> <Grid x:Name="LayoutRoot"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,0,0"> <telerik:RadButton Width="150" Content="Delete selected rows" Margin="0,0,5,0" Command="telerikGrid:RadGridViewCommands.Delete" CommandTarget="{Binding ElementName=CostPlanInfoGridView}" /> <telerik:RadButton Width="150" Content="Add new row" Margin="0,0,5,0" Command="telerikGrid:RadGridViewCommands.BeginInsert" CommandTarget="{Binding ElementName=CostPlanInfoGridView}" /> <telerik:RadButton Width="150" Content="Save insert/edit" Margin="0,0,5,0" Command="telerikGrid:RadGridViewCommands.CommitEdit" CommandTarget="{Binding ElementName=CostPlanInfoGridView}" /> <telerik:RadButton Width="150" Content="Cancel insert/edit" Command="telerikGrid:RadGridViewCommands.CancelRowEdit" CommandTarget="{Binding ElementName=CostPlanInfoGridView}" /> </StackPanel> <telerik:RadGridView x:Name="CostPlanInfoGridView" AutoGenerateColumns="False" SelectionMode="Extended" Margin="0,5,0,0" Grid.Row="1"> <telerik:RadGridView.Columns> <telerik:GridViewToggleRowDetailsColumn></telerik:GridViewToggleRowDetailsColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding Audkenni}" SortMemberPath="Audkenni"></telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding Heiti}" SortMemberPath="Heiti"></telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding Heiti_E}" SortMemberPath="Heiti_E"></telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding Hofundur}" SortMemberPath="Hofundur"></telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding Verkkaupi}" SortMemberPath="Verkkaupi"></telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding Stofndagur}" SortMemberPath="Stofndagur"></telerik:GridViewDataColumn> <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding Template}"></telerik:GridViewCheckBoxColumn> <telerik:GridViewComboBoxColumn></telerik:GridViewComboBoxColumn> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid> </navigation:Page> using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Windows.Navigation; using PriceBank.Web.Services; using Telerik.Windows.Controls; namespace PriceBank.Views { public partial class ChapterSetup : Page { BuildingCostDomainContext basicContext; public ChapterSetup() { ICommand deleteCommand = RadGridViewCommands.Delete; ICommand beginInsertCommand = RadGridViewCommands.BeginInsert; ICommand cancelRowEditCommand = RadGridViewCommands.CancelRowEdit; ICommand commitEditCommand = RadGridViewCommands.CommitEdit; InitializeComponent(); basicContext = new BuildingCostDomainContext(); CostPlanInfoGridView.ItemsSource = basicContext.tbl_KostAaetluns; basicContext.Load(basicContext.GetTbl_KostAaetlunQuery()); } // Executes when the user navigates to this page. protected override void OnNavigatedTo(NavigationEventArgs e) { } } }The grid gets loaded with data but the add button does not work. I click it but nothing happens. Can someone pls. help to get this function running.
Thanks
Ole
