dcsimg
Results 1 to 4 of 4

Thread: Bind Datagrid colunm width to another Datagrid

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2013
    Posts
    60

    Bind Datagrid colunm width to another Datagrid

    New to Xaml and having a bit of trouble getting my head around binding and how to use it (love it just struggling with it).
    I have 2 datagrids. dgTop and dgBottom. Both are set CanUserResizeColumns="True". I would like to be able to adjust to column width using the mouse in dgTop and have the dgBottom column adjust to the same without using back code.

    My question is – How do I bind the column widths of dgBottom to adjust to changes in column widths of dgTop?

    <code>
    <Window x:Class="DatagridToDatagridBinding.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:DatagridToDatagridBinding"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    </Grid.RowDefinitions>


    <DataGrid x:Name="dgTop" Grid.Column="1" Grid.ColumnSpan="8" Grid.Row="2" Grid.RowSpan="3" AutoGenerateColumns="False" CanUserAddRows="True" CanUserResizeColumns="True" CanUserDeleteRows="False" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Hidden" FontSize="6" RowHeaderWidth="0">
    <!--Column SEQ Type Integer-->
    <DataGrid.Columns>
    <DataGridTemplateColumn Header="Seq" Width="50*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtSeq" Text="{Binding SEQ, Mode=OneWay}" FontSize="08" IsReadOnly="True" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column LOCAL_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Local Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopLocalCode" Text="{Binding LOCAL_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SUPLIERS_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Suppliers Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopSuppliersCode" Text="{Binding SUPPLIERS_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column BAR_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Bar Code" Width="96*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopBarCode" Text="{Binding BAR_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SHORT_DESC VARCHAR(250)-->
    <DataGridTemplateColumn Header="Product Description" Width="400*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopProductdesc" Text="{Binding SHORT_DESC, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column UNITOF_MEASURE VARCHar(5)-->
    <DataGridTextColumn Header="Unit" Binding="{Binding UNITOF_MEASURE}" Width="50*" FontSize="8" IsReadOnly="True" />
    <!--Column SALES_TAX VARCHAR(25)-->
    <DataGridTextColumn Header="Tax" Binding="{Binding SALES_TAX}" Width="40*" FontSize="8" IsReadOnly="True" />
    <!--Column COST VARCHAR(25)-->
    <DataGridTemplateColumn Header="Cost" Width="60*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtCost" Text="{Binding COST , Mode=OneWay}" FontSize="8" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column Qty Calculated needs to be decimal for saving-->
    <DataGridTemplateColumn Header="Qty" Width="60*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtQty" Text="{Binding QTY, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column TOTEX Calculated needs to be decimal for saving as TOTALEX-->
    <DataGridTextColumn Header="Tot Ex" Binding="{Binding TOTALEX}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column GST Calculated needs to be decimal for saving as GST-->
    <DataGridTextColumn Header="Gst" Binding="{Binding GST}" IsReadOnly="True" Width="60*" FontSize="8"/>
    <!--Column TOTALINC Calculated needs to be decimal for saving as TOTALINC-->
    <DataGridTextColumn Header="Tot Inc" Binding="{Binding TOTALINC}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column NOTES inputed needs to be VARCHAR(100) for saving as NOTES-->
    <DataGridTemplateColumn Header="Notes" Width="150*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtNotes" Text="{Binding NOTES, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    </DataGrid.Columns>
    </DataGrid>

    <DataGrid x:Name="dgBottom" Grid.Column="1" Grid.ColumnSpan="8" Grid.Row="5" Grid.RowSpan="3" AutoGenerateColumns="False" CanUserAddRows="True" CanUserResizeColumns="True" CanUserDeleteRows="False" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Hidden" FontSize="6" RowHeaderWidth="0">
    <!--Column SEQ Type Integer-->
    <DataGrid.Columns>
    <DataGridTemplateColumn Header="Seq" Width="50*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtSeq" Text="{Binding SEQ, Mode=OneWay}" FontSize="08" IsReadOnly="True" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column LOCAL_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Local Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopLocalCode" Text="{Binding LOCAL_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SUPLIERS_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Suppliers Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopSuppliersCode" Text="{Binding SUPPLIERS_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column BAR_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Bar Code" Width="96*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopBarCode" Text="{Binding BAR_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SHORT_DESC VARCHAR(250)-->
    <DataGridTemplateColumn Header="Product Description" Width="400*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopProductdesc" Text="{Binding SHORT_DESC, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column UNITOF_MEASURE VARCHar(5)-->
    <DataGridTextColumn Header="Unit" Binding="{Binding UNITOF_MEASURE}" Width="50*" FontSize="8" IsReadOnly="True" />
    <!--Column SALES_TAX VARCHAR(25)-->
    <DataGridTextColumn Header="Tax" Binding="{Binding SALES_TAX}" Width="40*" FontSize="8" IsReadOnly="True" />
    <!--Column COST VARCHAR(25)-->
    <DataGridTemplateColumn Header="Cost" Width="60*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtCost" Text="{Binding COST , Mode=OneWay}" FontSize="8" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column Qty Calculated needs to be decimal for saving-->
    <DataGridTemplateColumn Header="Qty" Width="60*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtQty" Text="{Binding QTY, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column TOTEX Calculated needs to be decimal for saving as TOTALEX-->
    <DataGridTextColumn Header="Tot Ex" Binding="{Binding TOTALEX}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column GST Calculated needs to be decimal for saving as GST-->
    <DataGridTextColumn Header="Gst" Binding="{Binding GST}" IsReadOnly="True" Width="60*" FontSize="8"/>
    <!--Column TOTALINC Calculated needs to be decimal for saving as TOTALINC-->
    <DataGridTextColumn Header="Tot Inc" Binding="{Binding TOTALINC}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column NOTES inputed needs to be VARCHAR(100) for saving as NOTES-->
    <DataGridTemplateColumn Header="Notes" Width="150*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtNotes" Text="{Binding NOTES, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    </DataGrid.Columns>
    </DataGrid>
    </Grid>
    </Window>
    </code>
    Last edited by tonyallan8128; Dec 10th, 2018 at 05:35 AM. Reason: add code tags

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    1,932

    Re: Bind Datagrid colunm width to another Datagrid

    Hi, For readability purposes please wrap your code snippets with code tags.

    - kgc
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal |Programming | GitHub
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2013
    Posts
    60

    Re: Bind Datagrid colunm width to another Datagrid

    Yes and if I had known what code tags were I would have. Thank you.

  4. #4
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    1,932

    Re: Bind Datagrid colunm width to another Datagrid

    You wrap snippets using code tags such as below. It's the hash symbol in the editor.

    Code:
    <Window x:Class="DatagridToDatagridBinding.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:DatagridToDatagridBinding"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    <ColumnDefinition Width="10*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    <RowDefinition Height="10*"/>
    </Grid.RowDefinitions>
    
    
    <DataGrid x:Name="dgTop" Grid.Column="1" Grid.ColumnSpan="8" Grid.Row="2" Grid.RowSpan="3" AutoGenerateColumns="False" CanUserAddRows="True" CanUserResizeColumns="True" CanUserDeleteRows="False" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Hidden" FontSize="6" RowHeaderWidth="0">
    <!--Column SEQ Type Integer-->
    <DataGrid.Columns>
    <DataGridTemplateColumn Header="Seq" Width="50*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtSeq" Text="{Binding SEQ, Mode=OneWay}" FontSize="08" IsReadOnly="True" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column LOCAL_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Local Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopLocalCode" Text="{Binding LOCAL_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SUPLIERS_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Suppliers Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopSuppliersCode" Text="{Binding SUPPLIERS_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column BAR_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Bar Code" Width="96*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopBarCode" Text="{Binding BAR_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SHORT_DESC VARCHAR(250)-->
    <DataGridTemplateColumn Header="Product Description" Width="400*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopProductdesc" Text="{Binding SHORT_DESC, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column UNITOF_MEASURE VARCHar(5)-->
    <DataGridTextColumn Header="Unit" Binding="{Binding UNITOF_MEASURE}" Width="50*" FontSize="8" IsReadOnly="True" />
    <!--Column SALES_TAX VARCHAR(25)-->
    <DataGridTextColumn Header="Tax" Binding="{Binding SALES_TAX}" Width="40*" FontSize="8" IsReadOnly="True" />
    <!--Column COST VARCHAR(25)-->
    <DataGridTemplateColumn Header="Cost" Width="60*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtCost" Text="{Binding COST , Mode=OneWay}" FontSize="8" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column Qty Calculated needs to be decimal for saving-->
    <DataGridTemplateColumn Header="Qty" Width="60*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtQty" Text="{Binding QTY, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column TOTEX Calculated needs to be decimal for saving as TOTALEX-->
    <DataGridTextColumn Header="Tot Ex" Binding="{Binding TOTALEX}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column GST Calculated needs to be decimal for saving as GST-->
    <DataGridTextColumn Header="Gst" Binding="{Binding GST}" IsReadOnly="True" Width="60*" FontSize="8"/>
    <!--Column TOTALINC Calculated needs to be decimal for saving as TOTALINC-->
    <DataGridTextColumn Header="Tot Inc" Binding="{Binding TOTALINC}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column NOTES inputed needs to be VARCHAR(100) for saving as NOTES-->
    <DataGridTemplateColumn Header="Notes" Width="150*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtNotes" Text="{Binding NOTES, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    </DataGrid.Columns>
    </DataGrid>
    
    <DataGrid x:Name="dgBottom" Grid.Column="1" Grid.ColumnSpan="8" Grid.Row="5" Grid.RowSpan="3" AutoGenerateColumns="False" CanUserAddRows="True" CanUserResizeColumns="True" CanUserDeleteRows="False" ScrollViewer.CanContentScroll="False" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Hidden" FontSize="6" RowHeaderWidth="0">
    <!--Column SEQ Type Integer-->
    <DataGrid.Columns>
    <DataGridTemplateColumn Header="Seq" Width="50*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtSeq" Text="{Binding SEQ, Mode=OneWay}" FontSize="08" IsReadOnly="True" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column LOCAL_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Local Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopLocalCode" Text="{Binding LOCAL_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SUPLIERS_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Suppliers Code" Width="120*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopSuppliersCode" Text="{Binding SUPPLIERS_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column BAR_CODE VARCHar(25)-->
    <DataGridTemplateColumn Header="Bar Code" Width="96*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopBarCode" Text="{Binding BAR_CODE, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column SHORT_DESC VARCHAR(250)-->
    <DataGridTemplateColumn Header="Product Description" Width="400*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtTopProductdesc" Text="{Binding SHORT_DESC, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column UNITOF_MEASURE VARCHar(5)-->
    <DataGridTextColumn Header="Unit" Binding="{Binding UNITOF_MEASURE}" Width="50*" FontSize="8" IsReadOnly="True" />
    <!--Column SALES_TAX VARCHAR(25)-->
    <DataGridTextColumn Header="Tax" Binding="{Binding SALES_TAX}" Width="40*" FontSize="8" IsReadOnly="True" />
    <!--Column COST VARCHAR(25)-->
    <DataGridTemplateColumn Header="Cost" Width="60*" >
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <Viewbox>
    <TextBox Name="txtCost" Text="{Binding COST , Mode=OneWay}" FontSize="8" />
    </Viewbox>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column Qty Calculated needs to be decimal for saving-->
    <DataGridTemplateColumn Header="Qty" Width="60*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtQty" Text="{Binding QTY, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    <!--Column TOTEX Calculated needs to be decimal for saving as TOTALEX-->
    <DataGridTextColumn Header="Tot Ex" Binding="{Binding TOTALEX}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column GST Calculated needs to be decimal for saving as GST-->
    <DataGridTextColumn Header="Gst" Binding="{Binding GST}" IsReadOnly="True" Width="60*" FontSize="8"/>
    <!--Column TOTALINC Calculated needs to be decimal for saving as TOTALINC-->
    <DataGridTextColumn Header="Tot Inc" Binding="{Binding TOTALINC}" IsReadOnly="True" Width="60*" FontSize="8" />
    <!--Column NOTES inputed needs to be VARCHAR(100) for saving as NOTES-->
    <DataGridTemplateColumn Header="Notes" Width="150*">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <TextBox Name="txtNotes" Text="{Binding NOTES, Mode=OneWay}" FontSize="8" />
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>
    </DataGrid.Columns>
    </DataGrid>
    </Grid>
    </Window>
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal |Programming | GitHub
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width