Click here to Skip to main content
15,887,966 members
Home / Discussions / C#
   

C#

 
QuestionC# code making prolem when calling secure conection. Pin
Shinu K8-Sep-13 20:15
Shinu K8-Sep-13 20:15 
AnswerRe: C# code making prolem when calling secure conection. Pin
Abhinav S8-Sep-13 22:25
Abhinav S8-Sep-13 22:25 
QuestionC# vs Delphi. any ideas? Pin
Swinkaran8-Sep-13 20:13
professionalSwinkaran8-Sep-13 20:13 
AnswerRe: C# vs Delphi. any ideas? Pin
Abhinav S8-Sep-13 22:22
Abhinav S8-Sep-13 22:22 
AnswerRe: C# vs Delphi. any ideas? Pin
Eddy Vluggen8-Sep-13 22:33
professionalEddy Vluggen8-Sep-13 22:33 
QuestionCurrent Row Select in DataGridView ... Pin
smh13928-Sep-13 6:46
smh13928-Sep-13 6:46 
AnswerRe: Current Row Select in DataGridView ... Pin
Richard Andrew x648-Sep-13 14:20
professionalRichard Andrew x648-Sep-13 14:20 
AnswerRe: Current Row Select in DataGridView ... Pin
Eddy Vluggen9-Sep-13 8:06
professionalEddy Vluggen9-Sep-13 8:06 
smh1392 wrote:
the problem is I want to use :
That's indeed a problem; that property is readonly, meaning you cannot set it. You can set the current row by selecting it using the CurrentCel property, like shown below;
C#
using System;
using System.Collections.Generic;
using System.Windows.Forms;

class Program
{
    static void Main(string[] args)
    {
        using (var f = new Form())                                  
        {                                                           
            var dgv = new DataGridView() { Dock = DockStyle.Fill }; 
            var lst = new List<Object[]>();                         // a list to hold values
            lst.Add(new object[] { 1, "One", DateTime.Now });       // add a record
            lst.Add(new object[] { 2, "Two", DateTime.Now });       // and another
            lst.Add(new object[] { 3, "Tee", DateTime.Now });       // ..
            dgv.DataSource = lst;                                   // assign the list as datasource
            f.Controls.Add(dgv);                                    // add dgv to form
            var btn = new Button() { Dock = DockStyle.Top };        // create button
            btn.Click += delegate                                   // when clicked
            {                                                       //
                dgv.CurrentCell = dgv[1, 1];                        // moves current row to the middle;
            };                                                      //
            f.Controls.Add(btn);                                    // add button to form
            f.ShowDialog();                                         // show form
        }
    }
}

Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

Questionwordlist generator Pin
mory_2607-Sep-13 21:50
mory_2607-Sep-13 21:50 
SuggestionRe: wordlist generator Pin
Richard MacCutchan8-Sep-13 0:39
mveRichard MacCutchan8-Sep-13 0:39 
AnswerRe: wordlist generator Pin
Eddy Vluggen9-Sep-13 8:13
professionalEddy Vluggen9-Sep-13 8:13 
QuestionAvoid space at the Start of the textbox Pin
smh13927-Sep-13 10:21
smh13927-Sep-13 10:21 
AnswerRe: Avoid space at the Start of the textbox Pin
Dave Kreskowiak7-Sep-13 12:55
mveDave Kreskowiak7-Sep-13 12:55 
AnswerRe: Avoid space at the Start of the textbox Pin
Abhinav S7-Sep-13 18:05
Abhinav S7-Sep-13 18:05 
GeneralRe: Avoid space at the Start of the textbox Pin
Ron Beyer7-Sep-13 18:11
professionalRon Beyer7-Sep-13 18:11 
GeneralRe: Avoid space at the Start of the textbox Pin
Abhinav S7-Sep-13 19:09
Abhinav S7-Sep-13 19:09 
GeneralRe: Avoid space at the Start of the textbox Pin
BillWoodruff7-Sep-13 19:48
professionalBillWoodruff7-Sep-13 19:48 
GeneralRe: Avoid space at the Start of the textbox Pin
Pete O'Hanlon8-Sep-13 2:33
mvePete O'Hanlon8-Sep-13 2:33 
AnswerRe: Avoid space at the Start of the textbox Pin
BillWoodruff7-Sep-13 19:27
professionalBillWoodruff7-Sep-13 19:27 
GeneralRe: Avoid space at the Start of the textbox Pin
smh13927-Sep-13 22:17
smh13927-Sep-13 22:17 
GeneralRe: Avoid space at the Start of the textbox Pin
Pete O'Hanlon7-Sep-13 22:30
mvePete O'Hanlon7-Sep-13 22:30 
GeneralRe: Avoid space at the Start of the textbox Pin
BillWoodruff8-Sep-13 4:08
professionalBillWoodruff8-Sep-13 4:08 
GeneralRe: Avoid space at the Start of the textbox Pin
Pete O'Hanlon8-Sep-13 4:46
mvePete O'Hanlon8-Sep-13 4:46 
GeneralRe: Avoid space at the Start of the textbox Pin
BillWoodruff8-Sep-13 20:09
professionalBillWoodruff8-Sep-13 20:09 
GeneralRe: Avoid space at the Start of the textbox Pin
Pete O'Hanlon8-Sep-13 23:11
mvePete O'Hanlon8-Sep-13 23:11 

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.