or
<telerik:RadGridView Margin="0,0,0,0" Name="grdGeneralPayments" SelectionMode="Extended" ShowGroupPanel="False" ShowColumnFooters="False" CanUserSelect="False" CanUserInsertRows="False" CanUserDeleteRows="False" IsSynchronizedWithCurrentItem ="False" MouseDoubleClick="grdGeneralPayments_MouseDoubleClick" SelectionChanged="grdGeneralPayments_SelectionChanged" Filtering="grdGeneralPayments_Filtering" Filtered="grdGeneralPayments_Filtered" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" DockPanel.Dock="Top"></telerik:RadGridView><telerik:RadDataPager Name="radDataPager" Margin="0,0,0,0" DockPanel.Dock="Bottom" PageSize="10" Source="{Binding Items, ElementName=grdGeneralPayments}" PageIndexChanging="radDataPager_PageIndexChanging" />//Because grid columns are auto generated we need to add the select row checkbox column ourselves.GridViewSelectColumn selectCol = new GridViewSelectColumn();selectCol.Name = "Select";//Put select row checkbox column on LHS of the grid.this.grdGeneralPayments.Columns.Insert(0, selectCol);public ApproveGeneralPayments(){ InitializeComponent(); this.grdGeneralPayments.Items.PageChanged += new EventHandler<EventArgs>(Items_PageChanged);
private void Items_PageChanged(object sender, EventArgs e)
{
this.SelectGloballySelectedItems();
this.changingPage = false;
}<ControlTemplate x:Key="OtherWorkEditTemplate">
<Grid x:Name="LayoutRoot">
<GroupBox Header="Something" BorderBrush="{DynamicResource SolidColorBlueBrush}">
<Grid>
...
<telerik:RadDatePicker SelectedValue="{Binding OtherWork.InvoiceDate}" VerticalAlignment="Top" Margin="88.787,98.458,8,0" DateTimeWatermarkContent="Enter" telerik:StyleManager.Theme="Metro" />
</Grid>
</GroupBox>
</Grid>
</ControlTemplate>
How can i solve this?
Thanks a lot,
Attila

public DataTable CurrentDataTable { get { return dataGridView.ItemsSource != null ? ((BindingSource) dataGridView.ItemsSource).DataSource as DataTable : null; } set { CurrentSelectedTableName = value.TableName; //BindingSource to sync DataTable and DataGridView var bSource = new BindingSource {DataSource = value}; //set the DataGridView DataSource dataGridView.DataContext = bSource; } }public void LoadExtraRow() { var itemSourceDataTable = CurrentDataTable; if (itemSourceDataTable == null) return; var newRow = itemSourceDataTable.NewRow(); newRow.RowError = "NEW_ROW"; itemSourceDataTable.Rows.Add(newRow); dataGridView.Rebind(); } public void UnloadExtraRow(){ var itemSourceDataTable = CurrentDataTable; if (itemSourceDataTable == null) return; if (itemSourceDataTable.Rows.Count > 0) { var emptyRowToRemove = itemSourceDataTable.Rows[itemSourceDataTable.Rows.Count - 1]; if (emptyRowToRemove.RowError == "NEW_ROW") { itemSourceDataTable.Rows.Remove(emptyRowToRemove); } } }