hed bisker
Member
- Joined
- Aug 5, 2018
- Messages
- 16
- Programming Experience
- 1-3
I think the best way to do so it only uses the MainWindow.xaml without write code in C# in that file.
So I opened a new class named HeaderGridView.cs and try to bind from there... I have no Idea what Am I doing wrong
I have no error this bind just to nothing...
And what it the best practice to use the filter (My Idea is to create one method in HeaderGridView.cs and to Attach to every TextBox and DatePicker by action every time the value change)
How can I do it?
MainWindow.xaml
HeaderGridView.cs
So I opened a new class named HeaderGridView.cs and try to bind from there... I have no Idea what Am I doing wrong
I have no error this bind just to nothing...
And what it the best practice to use the filter (My Idea is to create one method in HeaderGridView.cs and to Attach to every TextBox and DatePicker by action every time the value change)
How can I do it?
MainWindow.xaml
C#:
<Window x:Class="ReportGenerator.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ReportGenerator"
xmlns:model="clr-namespace:MilBatDBModels;assembly=MilBatDBModels"
xmlns:db="clr-namespace:DataBaseManager;assembly=DataBaseManager"
Title="MainWindow" Height="450" Width="800">
<Grid>
<StackPanel>
<StackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Label>???? ??? :</Label>
<TextBox MinWidth="50" ></TextBox>
</StackPanel>
<StackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Label>???? ????? :</Label>
<TextBox MinWidth="50"></TextBox>
</StackPanel>
<StackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Label>???? Batch :</Label>
<TextBox MinWidth="50" ></TextBox>
</StackPanel>
<StackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Label >????? ????? :</Label>
<DatePicker ></DatePicker>
<Label>????? ????? :</Label>
<DatePicker></DatePicker>
</StackPanel>
<DataGrid x:Name="HeaderDataGrid" IsReadOnly="True" SelectionMode="Single" ItemsSource="{Binding HeaderGridView.HeaderTable}">
</DataGrid>
</StackPanel>
</Grid>
</Window>
C#:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using FastMember;
using MilBatDBModels;
using static DataBaseManager.PulserBaseManager;
namespace ReportGenerator
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
HeaderGridView.cs
C#:
using FastMember;using MilBatDBModels;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using static DataBaseManager.PulserBaseManager;
namespace ReportGenerator
{
public class HeaderGridView
{
public DataTable HeaderTable { get; set; }
public HeaderGridView() {
HeaderTable = new System.Data.DataTable();
List<HeaderResult> headerList = PulserBaseManagerInstance.GetHeaderResults();
using (var reader = ObjectReader.Create(headerList))
{
HeaderTable.Load(reader);
}
//HeaderDataGrid.DataContext = headerTable;
}
public void RunFilterAction(object sender, SelectionChangedEventArgs e)
{
}
}
}