Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralRe: save NumericUpDown in Registry Pin
Jassim Rahma13-Nov-09 13:25
Jassim Rahma13-Nov-09 13:25 
GeneralRe: save NumericUpDown in Registry Pin
The Man from U.N.C.L.E.14-Nov-09 3:58
The Man from U.N.C.L.E.14-Nov-09 3:58 
QuestionHow to get HBITMAP form BitMap Pin
vibindia13-Nov-09 1:45
vibindia13-Nov-09 1:45 
AnswerRe: How to get HBITMAP form BitMap Pin
dan!sh 13-Nov-09 2:37
professional dan!sh 13-Nov-09 2:37 
Questionhow to generate licence key for my product which is developed with c# Pin
happies13-Nov-09 1:27
happies13-Nov-09 1:27 
AnswerRe: how to generate licence key for my product which is developed with c# Pin
Shameel13-Nov-09 4:15
professionalShameel13-Nov-09 4:15 
AnswerRe: how to generate licence key for my product which is developed with c# Pin
Eddy Vluggen13-Nov-09 4:55
professionalEddy Vluggen13-Nov-09 4:55 
QuestionProgrammatically select multiple cells in DataGridView C# / VB.NET application Pin
willempipi12-Nov-09 23:40
willempipi12-Nov-09 23:40 
Hi,

I'm creating a user control that displays a DataGridView control. I want to be able to programmatically select multiple cells/rows. So i made this function:

public bool SetSelectedValues(string ColumnName, List<object> CellValues)
{
    bool FoundRows = false;

    for (int ColumnIndex = 0; ColumnIndex < gridData.Columns.Count; ColumnIndex++)
    {
        if (gridData.Columns[0].Name == ColumnName)
        {
            gridData.ClearSelection();

            for (int RowIndex = 0; RowIndex < gridData.Rows.Count; RowIndex++)
            {
                foreach (object CellValue in CellValues)
                {
                    if (gridData.Rows[RowIndex].Cells[ColumnIndex].Value.ToString() == CellValue.ToString())
                    {
                        gridData.Rows[RowIndex].Cells[ColumnIndex].Selected = true;
                        gridData.CurrentCell = gridData.Rows[RowIndex].Cells[ColumnIndex];

                        FoundRows = true;
                    }
                }
            }

            break;
        }
    }

    return FoundRows;
}

It doesn't work, only the last cell gets selected, because i cannot select multiple cells in the CurrentCell. How can i solve this?

Regards,

Willem
AnswerRe: Programmatically select multiple cells in DataGridView C# / VB.NET application Pin
dan!sh 13-Nov-09 3:35
professional dan!sh 13-Nov-09 3:35 
AnswerRe: Programmatically select multiple cells in DataGridView C# / VB.NET application Pin
willempipi13-Nov-09 3:39
willempipi13-Nov-09 3:39 
QuestionSslStream.Authenticate method Pin
nirmalsat12-Nov-09 22:55
nirmalsat12-Nov-09 22:55 
AnswerRe: SslStream.Authenticate method Pin
Paulo Zemek12-Nov-09 23:57
mvaPaulo Zemek12-Nov-09 23:57 
QuestionHow can I know/see on which core a thread run ? (In win XP) Pin
evyatar.v12-Nov-09 22:44
evyatar.v12-Nov-09 22:44 
AnswerRe: How can I know/see on which core a thread run ? (In win XP) Pin
Covean12-Nov-09 23:06
Covean12-Nov-09 23:06 
GeneralRe: How can I know/see on which core a thread run ? (In win XP) Pin
Luc Pattyn13-Nov-09 0:47
sitebuilderLuc Pattyn13-Nov-09 0:47 
GeneralRe: How can I know/see on which core a thread run ? (In win XP) Pin
Covean13-Nov-09 1:43
Covean13-Nov-09 1:43 
GeneralRe: How can I know/see on which core a thread run ? (In win XP) Pin
evyatar.v13-Nov-09 5:38
evyatar.v13-Nov-09 5:38 
GeneralRe: How can I know/see on which core a thread run ? (In win XP) Pin
evyatar.v13-Nov-09 0:58
evyatar.v13-Nov-09 0:58 
AnswerRe: How can I know/see on which core a thread run ? (In win XP) Pin
Eddy Vluggen13-Nov-09 1:22
professionalEddy Vluggen13-Nov-09 1:22 
GeneralRe: How can I know/see on which core a thread run ? (In win XP) Pin
Shameel13-Nov-09 4:23
professionalShameel13-Nov-09 4:23 
GeneralRe: How can I know/see on which core a thread run ? (In win XP) Pin
Eddy Vluggen13-Nov-09 4:42
professionalEddy Vluggen13-Nov-09 4:42 
GeneralWindows service using custom DLL Pin
TurboTaMan12-Nov-09 20:39
TurboTaMan12-Nov-09 20:39 
GeneralRe: Windows service using custom DLL Pin
Shameel12-Nov-09 22:17
professionalShameel12-Nov-09 22:17 
GeneralRe: Windows service using custom DLL Pin
Covean12-Nov-09 23:14
Covean12-Nov-09 23:14 
GeneralRe: Windows service using custom DLL Pin
TurboTaMan16-Nov-09 8:06
TurboTaMan16-Nov-09 8:06 

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.