c# How do I freeze the Rowfilter in a DataGridView, so the filter stops changing shown data?











up vote
0
down vote

favorite












I show a DataTable in a DataGridView (_dgv) via a DataView (_dv).
I use a RowFilter to show only part of the data.



Now I would like to be able to edit the data in this filtered state, including the column, which I just filtered for. Let's say the column is called Infotext. However, if I change the text in Infotext the line I just changed disappears. I know it makes sense, since it does not contain the keyword anymore, but for my application I want to keep it inside the view until the user
changes the filter (I have lot's of filters).



Is there a way to "freeze" the view until the next rowfilter command was applied? While "frozen", the user should be allowed to edit any cell without changing the number of shown lines.



_dv = new DataView(_DataTable);
_dv.RowFilter = "Infotext LIKE '%test%'";
_dgv.DataSource = _dv;


Any help is appriated, let me know if you need more info to give an answer, thanks.










share|improve this question




























    up vote
    0
    down vote

    favorite












    I show a DataTable in a DataGridView (_dgv) via a DataView (_dv).
    I use a RowFilter to show only part of the data.



    Now I would like to be able to edit the data in this filtered state, including the column, which I just filtered for. Let's say the column is called Infotext. However, if I change the text in Infotext the line I just changed disappears. I know it makes sense, since it does not contain the keyword anymore, but for my application I want to keep it inside the view until the user
    changes the filter (I have lot's of filters).



    Is there a way to "freeze" the view until the next rowfilter command was applied? While "frozen", the user should be allowed to edit any cell without changing the number of shown lines.



    _dv = new DataView(_DataTable);
    _dv.RowFilter = "Infotext LIKE '%test%'";
    _dgv.DataSource = _dv;


    Any help is appriated, let me know if you need more info to give an answer, thanks.










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I show a DataTable in a DataGridView (_dgv) via a DataView (_dv).
      I use a RowFilter to show only part of the data.



      Now I would like to be able to edit the data in this filtered state, including the column, which I just filtered for. Let's say the column is called Infotext. However, if I change the text in Infotext the line I just changed disappears. I know it makes sense, since it does not contain the keyword anymore, but for my application I want to keep it inside the view until the user
      changes the filter (I have lot's of filters).



      Is there a way to "freeze" the view until the next rowfilter command was applied? While "frozen", the user should be allowed to edit any cell without changing the number of shown lines.



      _dv = new DataView(_DataTable);
      _dv.RowFilter = "Infotext LIKE '%test%'";
      _dgv.DataSource = _dv;


      Any help is appriated, let me know if you need more info to give an answer, thanks.










      share|improve this question















      I show a DataTable in a DataGridView (_dgv) via a DataView (_dv).
      I use a RowFilter to show only part of the data.



      Now I would like to be able to edit the data in this filtered state, including the column, which I just filtered for. Let's say the column is called Infotext. However, if I change the text in Infotext the line I just changed disappears. I know it makes sense, since it does not contain the keyword anymore, but for my application I want to keep it inside the view until the user
      changes the filter (I have lot's of filters).



      Is there a way to "freeze" the view until the next rowfilter command was applied? While "frozen", the user should be allowed to edit any cell without changing the number of shown lines.



      _dv = new DataView(_DataTable);
      _dv.RowFilter = "Infotext LIKE '%test%'";
      _dgv.DataSource = _dv;


      Any help is appriated, let me know if you need more info to give an answer, thanks.







      c# datagridview rowfilter






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 at 7:19

























      asked Nov 18 at 20:23









      Birk

      8916




      8916





























          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',
          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%2f53365078%2fc-sharp-how-do-i-freeze-the-rowfilter-in-a-datagridview-so-the-filter-stops-cha%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53365078%2fc-sharp-how-do-i-freeze-the-rowfilter-in-a-datagridview-so-the-filter-stops-cha%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

          Ottavio Pratesi

          Tricia Helfer

          15 giugno