C# WPF MVVM - Compare two Datatables and display differences by colored rowsDifferences in string compare methods in C#Set background color of WPF Textbox in C# codeHow to create a DataTable in C# and how to add rows?Comparing two strings, ignoring case in C#MVVM gridview binding to datatable WPFCompare two DataTables for differences in C#?How to select a DataGrid row in WPF with MVVM when the DataGrid is bound to a DataTablecompare two datatables and get difference rows in C#WPF MVVM Bind DataTable to DataGrid does not display dataLINQ result in DataRow

Have powerful mythological heroes ever run away or been deeply afraid?

Concise way to draw this pyramid

Creating Fictional Slavic Place Names

Working in the USA for living expenses only; allowed on VWP?

Asking bank to reduce APR instead of increasing credit limit

Relativistic resistance transformation

Are there mythical creatures in the world of Game of Thrones?

Pros and cons of writing a book review?

How did rebel fighters get past the Scarif shield?

Hygienic footwear for prehensile feet?

Please help me identify this plane

Can I ask a publisher for a paper that I need for reviewing

What is a simple, physical situation where complex numbers emerge naturally?

Will dual-learning in a glider make my GA learning safer?

Does Peach's float negate shorthop knockback multipliers?

How to detach yourself from a character you're going to kill?

Is there a way to save this session?

Why are grass strips more dangerous than tarmac?

Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?

Homophone fills the blanks

Unconventional Opposites

The qvolume of an integer

How can Iron Man's suit withstand this?

How should I push back against my job assigning "homework"?



C# WPF MVVM - Compare two Datatables and display differences by colored rows


Differences in string compare methods in C#Set background color of WPF Textbox in C# codeHow to create a DataTable in C# and how to add rows?Comparing two strings, ignoring case in C#MVVM gridview binding to datatable WPFCompare two DataTables for differences in C#?How to select a DataGrid row in WPF with MVVM when the DataGrid is bound to a DataTablecompare two datatables and get difference rows in C#WPF MVVM Bind DataTable to DataGrid does not display dataLINQ result in DataRow






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I want to compare two datatables next to each other in separate tables , and display the row data differences by color, with dynamical data received from the user.



I've been reading about implementing datatriggers / triggers, but the examples are with non dynamically data which made it hard to implement. Etc. The value path are not needed here, due it depends on the total row data.



 <Style TargetType="DataGridCell">
<Style.Triggers>
<Trigger Property="Text" Value="Error">
<Setter Property="Background" Value="biding ColorDif"/>
</Trigger>
</Style.Triggers>
</Style>


I then ran across a usage of this to compare the datables, but couldn't find anything about how to combine it with above example, to color the rows correclty with an MVVM patteren.



 foreach (DataRow Leftrows in compare_TabItemModel._leftDataTable.Rows)

foreach (DataRow RightRows in compare_TabItemModel._rightDataTable.Rows)


var array1 = Leftrows.ItemArray;
var array2 = RightRows.ItemArray;

if (array1.SequenceEqual(array2))


ColorDif= "Green";

else

ColorDif= "Red";





The wished result should be etc when we compare the data from the datatables.
Result wished










share|improve this question






























    0















    I want to compare two datatables next to each other in separate tables , and display the row data differences by color, with dynamical data received from the user.



    I've been reading about implementing datatriggers / triggers, but the examples are with non dynamically data which made it hard to implement. Etc. The value path are not needed here, due it depends on the total row data.



     <Style TargetType="DataGridCell">
    <Style.Triggers>
    <Trigger Property="Text" Value="Error">
    <Setter Property="Background" Value="biding ColorDif"/>
    </Trigger>
    </Style.Triggers>
    </Style>


    I then ran across a usage of this to compare the datables, but couldn't find anything about how to combine it with above example, to color the rows correclty with an MVVM patteren.



     foreach (DataRow Leftrows in compare_TabItemModel._leftDataTable.Rows)

    foreach (DataRow RightRows in compare_TabItemModel._rightDataTable.Rows)


    var array1 = Leftrows.ItemArray;
    var array2 = RightRows.ItemArray;

    if (array1.SequenceEqual(array2))


    ColorDif= "Green";

    else

    ColorDif= "Red";





    The wished result should be etc when we compare the data from the datatables.
    Result wished










    share|improve this question


























      0












      0








      0








      I want to compare two datatables next to each other in separate tables , and display the row data differences by color, with dynamical data received from the user.



      I've been reading about implementing datatriggers / triggers, but the examples are with non dynamically data which made it hard to implement. Etc. The value path are not needed here, due it depends on the total row data.



       <Style TargetType="DataGridCell">
      <Style.Triggers>
      <Trigger Property="Text" Value="Error">
      <Setter Property="Background" Value="biding ColorDif"/>
      </Trigger>
      </Style.Triggers>
      </Style>


      I then ran across a usage of this to compare the datables, but couldn't find anything about how to combine it with above example, to color the rows correclty with an MVVM patteren.



       foreach (DataRow Leftrows in compare_TabItemModel._leftDataTable.Rows)

      foreach (DataRow RightRows in compare_TabItemModel._rightDataTable.Rows)


      var array1 = Leftrows.ItemArray;
      var array2 = RightRows.ItemArray;

      if (array1.SequenceEqual(array2))


      ColorDif= "Green";

      else

      ColorDif= "Red";





      The wished result should be etc when we compare the data from the datatables.
      Result wished










      share|improve this question
















      I want to compare two datatables next to each other in separate tables , and display the row data differences by color, with dynamical data received from the user.



      I've been reading about implementing datatriggers / triggers, but the examples are with non dynamically data which made it hard to implement. Etc. The value path are not needed here, due it depends on the total row data.



       <Style TargetType="DataGridCell">
      <Style.Triggers>
      <Trigger Property="Text" Value="Error">
      <Setter Property="Background" Value="biding ColorDif"/>
      </Trigger>
      </Style.Triggers>
      </Style>


      I then ran across a usage of this to compare the datables, but couldn't find anything about how to combine it with above example, to color the rows correclty with an MVVM patteren.



       foreach (DataRow Leftrows in compare_TabItemModel._leftDataTable.Rows)

      foreach (DataRow RightRows in compare_TabItemModel._rightDataTable.Rows)


      var array1 = Leftrows.ItemArray;
      var array2 = RightRows.ItemArray;

      if (array1.SequenceEqual(array2))


      ColorDif= "Green";

      else

      ColorDif= "Red";





      The wished result should be etc when we compare the data from the datatables.
      Result wished







      c# wpf mvvm datatable






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 11:51







      Lowrater

















      asked Mar 24 at 11:45









      LowraterLowrater

      84




      84






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323450%2fc-sharp-wpf-mvvm-compare-two-datatables-and-display-differences-by-colored-row%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323450%2fc-sharp-wpf-mvvm-compare-two-datatables-and-display-differences-by-colored-row%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴