Click here to Skip to main content
15,906,227 members
Home / Discussions / C#
   

C#

 
GeneralRe: Report builder in c# Pin
Zeyad Jalil12-Jan-16 6:59
professionalZeyad Jalil12-Jan-16 6:59 
GeneralRe: Report builder in c# Pin
Brisingr Aerowing12-Jan-16 13:31
professionalBrisingr Aerowing12-Jan-16 13:31 
AnswerRe: Report builder in c# Pin
Mycroft Holmes12-Jan-16 12:07
professionalMycroft Holmes12-Jan-16 12:07 
AnswerRe: Report builder in c# Pin
Gerry Schmitz12-Jan-16 16:39
mveGerry Schmitz12-Jan-16 16:39 
QuestionGood Example C# Datagrid and CRUD-Functionality Pin
gpc4411-Jan-16 23:36
gpc4411-Jan-16 23:36 
AnswerRe: Good Example C# Datagrid and CRUD-Functionality Pin
Garth J Lancaster11-Jan-16 23:55
professionalGarth J Lancaster11-Jan-16 23:55 
GeneralRe: Good Example C# Datagrid and CRUD-Functionality Pin
gpc4413-Jan-16 2:41
gpc4413-Jan-16 2:41 
QuestionThe best way to set all the datagrid cells of a row with the same value Pin
Member 1144944711-Jan-16 8:03
Member 1144944711-Jan-16 8:03 
I have a function fired by a buton to select an entire row of checkboxes of a datagrid and set them with the same value (true or false), similar to the excel filters. If all checkboxes of the row are true than if I click the button, they all become false, otherwise they all become true. But it only works when all the checkboxes are simultaneously true or false, if one of them is true, they all become false instead of true as it was supposed to, like in excel filters. This is due to the last part of the code that is commented which is not throwing the expected result. Can anyone help to see the problem cause?

C#
public void seleciona_check()
       {

        for (int i = 7; i < grid_lic.ColumnCount-1 ; i++)
           {
            for (int j = 7; j < grid_lic.ColumnCount - 1; j++)
             {

               if (grid_lic.CurrentRow.Cells[j].Value.ToString() == grid_lic.CurrentRow.Cells[i].Value.ToString())
               {
                if (grid_lic.CurrentRow.Cells[i].Value.ToString() == "True")
                {
                 Convert.ToBoolean(grid_lic.CurrentRow.Cells[i].Value = false);

                 Convert.ToBoolean(grid_lic.CurrentRow.Cells[3].Value = false);
              }

              else if (grid_lic.CurrentRow.Cells[i].Value.ToString() == "False")
              {
               Convert.ToBoolean(grid_lic.CurrentRow.Cells[i].Value = true);

               Convert.ToBoolean(grid_lic.CurrentRow.Cells[3].Value = true);
       }

        }
       //  else if (grid_lic.CurrentRow.Cells[j].Value.ToString() != grid_lic.CurrentRow.Cells[i].Value.ToString())
                          //{
                          //    Convert.ToBoolean(grid_lic.CurrentRow.Cells[i].Value = true);
                          //    Convert.ToBoolean(grid_lic.CurrentRow.Cells[j].Value = true);
                          //
                          //    Convert.ToBoolean(grid_lic.CurrentRow.Cells[3].Value = true);
                          //}

                       }
                   }


modified 11-Jan-16 15:01pm.

AnswerRe: The best way to set all the datagrid cells of a row with the same value Pin
John Torjo11-Jan-16 13:59
professionalJohn Torjo11-Jan-16 13:59 
GeneralRe: The best way to set all the datagrid cells of a row with the same value Pin
Member 1144944711-Jan-16 22:49
Member 1144944711-Jan-16 22:49 
GeneralRe: The best way to set all the datagrid cells of a row with the same value Pin
John Torjo11-Jan-16 23:36
professionalJohn Torjo11-Jan-16 23:36 
AnswerRe: The best way to set all the datagrid cells of a row with the same value Pin
Pete O'Hanlon12-Jan-16 1:08
mvePete O'Hanlon12-Jan-16 1:08 
GeneralRe: The best way to set all the datagrid cells of a row with the same value Pin
Member 1144944712-Jan-16 1:33
Member 1144944712-Jan-16 1:33 
GeneralRe: The best way to set all the datagrid cells of a row with the same value Pin
Pete O'Hanlon12-Jan-16 2:01
mvePete O'Hanlon12-Jan-16 2:01 
GeneralRe: The best way to set all the datagrid cells of a row with the same value Pin
Member 1144944712-Jan-16 3:09
Member 1144944712-Jan-16 3:09 
GeneralRe: The best way to set all the datagrid cells of a row with the same value Pin
Pete O'Hanlon12-Jan-16 3:12
mvePete O'Hanlon12-Jan-16 3:12 
Questiondtsearch engine/desktop C#? Pin
Hossei_Da_Hustla11-Jan-16 5:40
Hossei_Da_Hustla11-Jan-16 5:40 
AnswerRe: dtsearch engine/desktop C#? Pin
OriginalGriff11-Jan-16 5:52
mveOriginalGriff11-Jan-16 5:52 
AnswerRe: dtsearch engine/desktop C#? Pin
Richard Deeming11-Jan-16 5:58
mveRichard Deeming11-Jan-16 5:58 
QuestionReport Builder in Visual Studio Pin
milo-xml11-Jan-16 3:11
professionalmilo-xml11-Jan-16 3:11 
GeneralRe: Report Builder in Visual Studio Pin
V.11-Jan-16 3:40
professionalV.11-Jan-16 3:40 
GeneralRe: Report Builder in Visual Studio Pin
milo-xml11-Jan-16 4:54
professionalmilo-xml11-Jan-16 4:54 
AnswerRe: Report Builder in Visual Studio Pin
V.11-Jan-16 19:59
professionalV.11-Jan-16 19:59 
GeneralRe: Report Builder in Visual Studio Pin
milo-xml12-Jan-16 1:27
professionalmilo-xml12-Jan-16 1:27 
AnswerRe: Report Builder in Visual Studio Pin
Gerry Schmitz11-Jan-16 4:54
mveGerry Schmitz11-Jan-16 4:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.