Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One idea for the solution is to have another property with only a getter that merges the info you want. </p> <p>something like</p> <pre><code>property string Time {get {return this.FromDate.toshortdate().tostring() + AttendDate.hour.tostring() + attenddate.minutes.tostring()}; } </code></pre> <p>The code might be not exactly this, but then you can bind this property to show the info you want where it should be presented.</p> <p>regards,</p> <p><strong>=============EDIT===========</strong></p> <p>I tried this, a very simple example...don't know if it works for you:</p> <p>XAML:</p> <pre><code>&lt;Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:conv ="clr-namespace:WpfApplication1" Title="MainWindow" Height="350" Width="525"&gt; &lt;Window.Resources&gt; &lt;conv:TimeConverter x:Key="tmeConverter"&gt;&lt;/conv:TimeConverter&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;DataGrid ItemsSource="{Binding listExample}"&gt; &lt;DataGrid.Columns&gt; &lt;DataGridTextColumn Header="teste" &gt; &lt;DataGridTextColumn.Binding&gt; &lt;MultiBinding Converter="{StaticResource tmeConverter}"&gt; &lt;Binding Path="FromDate" /&gt; &lt;Binding Path="AttendDate" /&gt; &lt;/MultiBinding&gt; &lt;/DataGridTextColumn.Binding&gt; &lt;/DataGridTextColumn&gt; &lt;/DataGrid.Columns&gt; &lt;/DataGrid&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>Code behind (.cs)</p> <pre><code>namespace WpfApplication1 { /// &lt;summary&gt; /// Interaction logic for MainWindow.xaml /// &lt;/summary&gt; public partial class MainWindow : Window { public List&lt;Example2&gt; listExample { get; set; } public Example2 Test { get; set; } public MainWindow() { InitializeComponent(); this.listExample = new List&lt;Example2&gt;(); //listExample.Add(new Example { IsChecked = false, Test1 = "teste" }); //listExample.Add(new Example { IsChecked = false, Test1 = "TTTTT!" }); this.Test = new Example2 { AttendDate = "1ui", FromDate = "ff" }; this.listExample.Add(this.Test); DataContext = this; } } } </code></pre> <p>And Example2 class:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WpfApplication1 { public class Example2 { public string FromDate { get; set; } public string AttendDate { get; set; } } } </code></pre> <p>Converter:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace WpfApplication1 { class TimeConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return values[0].ToString() + values[1].ToString(); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } } </code></pre> <p>The final window appears 3 columns, and if I change the last two columns, the first one is automatically edited.</p> <p>Is that it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload