Click here to Skip to main content
15,886,639 members
Home / Discussions / C#
   

C#

 
QuestionWinform linked to Entity Data Model Pin
pmcm5-Mar-12 5:25
pmcm5-Mar-12 5:25 
QuestionVB input box in C# Pin
glennPattonWork35-Mar-12 5:23
professionalglennPattonWork35-Mar-12 5:23 
AnswerRe: VB input box in C# Pin
Richard MacCutchan5-Mar-12 5:30
mveRichard MacCutchan5-Mar-12 5:30 
AnswerRe: VB input box in C# Pin
DaveyM695-Mar-12 7:02
professionalDaveyM695-Mar-12 7:02 
AnswerRe: VB input box in C# Pin
Luc Pattyn5-Mar-12 8:16
sitebuilderLuc Pattyn5-Mar-12 8:16 
GeneralRe: VB input box in C# Pin
glennPattonWork35-Mar-12 21:40
professionalglennPattonWork35-Mar-12 21:40 
AnswerRe: VB input box in C# Pin
glennPattonWork35-Mar-12 21:42
professionalglennPattonWork35-Mar-12 21:42 
QuestionCheckbox Column in DataGridView Pin
MWRivera5-Mar-12 5:20
MWRivera5-Mar-12 5:20 
I have a DataGridView with three columns (checkbox, text, int). The text and int columns are bound to data from a data source. I want to manipulate in c#, which of the checkbox rows should be checked. I have the below code, however setting the value of the checkbox to true isn't displaying the required checkboxes as checked. Does anyone know how I could implement this?

C#
// Populate dataGridView with all available options for the given field (stored in oCodeList)
dgvMultiCodes.AutoGenerateColumns = false;
            dgvMultiCodes.DataSource = oCodeList.Table;

            string SQLState = ChcekedSQLStatement();        // Build SQL statement for options that are already checked

            SortedList<int, string> slCodeList = new SortedList<int, string>();
            int codeCD = 0;
            string desc = "";
            oCodeList.GoTop();
            // Save options DataTable values and keys in a SortedList
            while (!oCodeList.EoF)
            {
                codeCD = oCodeList.GetInteger("CD");
                desc = oCodeList.GetString("DEF");
                slCodeList.Add(codeCD, desc);
                oCodeList.Skip();
            }


            bool bChecked = false;
            // Select/check already selected checkboxes in the dataGridView
            ##DataReader checkedList = new ##DataReader(SQLState, currentUser.oConnection);
            while (checkedList.Read())
            {
                bChecked = slCodeList.ContainsKey(checkedList.GetInteger("KEYCODE"));

                if (bChecked)
                {
                    foreach (DataGridViewRow row in dgvMultiCodes.Rows)
                    {
                        if (row.Cells[dgvCodeCol.Index].Value.ToString() == checkedList.GetString("KEYCODE"))
                        {
                            row.Cells[dgvCheckCol.Index].Value = true;  // DOESN’T CHECK CHECKBOX IN DATAGRIDVIEW
                            break;
                        }
  }
                }

                bChecked = false;
            }
            …

AnswerRe: Checkbox Column in DataGridView Pin
MWRivera5-Mar-12 7:22
MWRivera5-Mar-12 7:22 
QuestionInsert Duplicate into Hashset Pin
sharma.ravi215-Mar-12 1:11
sharma.ravi215-Mar-12 1:11 
AnswerRe: Insert Duplicate into Hashset Pin
Luc Pattyn5-Mar-12 2:03
sitebuilderLuc Pattyn5-Mar-12 2:03 
AnswerRe: Insert Duplicate into Hashset Pin
PIEBALDconsult5-Mar-12 2:06
mvePIEBALDconsult5-Mar-12 2:06 
AnswerRe: Insert Duplicate into Hashset Pin
Shameel5-Mar-12 2:15
professionalShameel5-Mar-12 2:15 
AnswerRe: Insert Duplicate into Hashset Pin
Dean Oliver5-Mar-12 2:58
Dean Oliver5-Mar-12 2:58 
AnswerRe: Insert Duplicate into Hashset Pin
Montasser Ben Ouhida5-Mar-12 3:32
Montasser Ben Ouhida5-Mar-12 3:32 
Questioncombobox filter in datagridview filterpoup Pin
polachan5-Mar-12 0:56
polachan5-Mar-12 0:56 
Questionrunning multiple dos commands (including TFS commands) in c# Pin
canakcan4-Mar-12 22:40
canakcan4-Mar-12 22:40 
AnswerRe: running multiple dos commands (including TFS commands) in c# Pin
Richard MacCutchan4-Mar-12 23:33
mveRichard MacCutchan4-Mar-12 23:33 
AnswerRe: running multiple dos commands (including TFS commands) in c# Pin
BobJanova5-Mar-12 0:20
BobJanova5-Mar-12 0:20 
QuestionInserting the XML tag in existing file Pin
Harish Reddy K4-Mar-12 20:22
Harish Reddy K4-Mar-12 20:22 
AnswerRe: Inserting the XML tag in existing file Pin
Wayne Gaylard4-Mar-12 21:01
professionalWayne Gaylard4-Mar-12 21:01 
QuestionHI ANYBODY PLS HELP ME ! Pin
mbjino4-Mar-12 19:11
mbjino4-Mar-12 19:11 
AnswerRe: HI ANYBODY PLS HELP ME ! Pin
Bernhard Hiller4-Mar-12 19:17
Bernhard Hiller4-Mar-12 19:17 
GeneralRe: HI ANYBODY PLS HELP ME ! Pin
mbjino4-Mar-12 19:22
mbjino4-Mar-12 19:22 
GeneralRe: HI ANYBODY PLS HELP ME ! Pin
Bernhard Hiller4-Mar-12 19:23
Bernhard Hiller4-Mar-12 19:23 

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.