Click here to Skip to main content
15,922,584 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Custom Controls handling Design Time Events Pin
Thomas Stockwell18-Nov-06 6:20
professionalThomas Stockwell18-Nov-06 6:20 
QuestionQuery related to Framework 1.1 Pin
sharmankit17-Nov-06 8:02
sharmankit17-Nov-06 8:02 
AnswerRe: Query related to Framework 1.1 Pin
Karthik Kalyanasundaram17-Nov-06 14:55
Karthik Kalyanasundaram17-Nov-06 14:55 
AnswerRe: Query related to Framework 1.1 Pin
WillemM18-Nov-06 7:47
WillemM18-Nov-06 7:47 
Questionto clear the find combobox list in microsoft .net 2003 Pin
zareee16-Nov-06 21:22
zareee16-Nov-06 21:22 
AnswerRe: to clear the find combobox list in microsoft .net 2003 Pin
Thomas Stockwell18-Nov-06 6:31
professionalThomas Stockwell18-Nov-06 6:31 
QuestionDataGridView In Form Designer Pin
junxian_chen16-Nov-06 14:39
junxian_chen16-Nov-06 14:39 
AnswerRe: DataGridView In Form Designer Pin
Tal Kain16-Nov-06 15:26
Tal Kain16-Nov-06 15:26 
The easiest way I know to work with a DataGridView is to create a DataTable… create its columns and then connect the DataTable to the DataGridView as its data source..
I created an empty form and throwed a DataGridView on it with the name "gridNumbers"

here is the code:

<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
namespace DataGridExample<br />
{<br />
    public partial class frmMain : Form<br />
    {<br />
        DataTable oTable;<br />
<br />
        public frmMain()<br />
        {<br />
            InitializeComponent();<br />
        }<br />
<br />
        private void Form1_Load(object sender, EventArgs e)<br />
        {<br />
            oTable = new DataTable();<br />
            oTable.Columns.Add("Number", typeof(int)); //with cell's type..<br />
            oTable.Columns.Add("Text"); //a simple way..<br />
<br />
            gridNumbers.DataSource = oTable; //connecting the table to the grid<br />
<br />
            AddRow(1, "One");<br />
            AddRow(2, "Two");<br />
            AddRow(3, "Three");<br />
            AddRow(4, "Four");<br />
<br />
        }<br />
<br />
        protected void AddRow(int num, string text)<br />
        {<br />
            DataRow oRow = oTable.NewRow(); //getting a row with the table's scheme<br />
            oRow["Number"] = num;<br />
            oRow["Text"] = text;<br />
            oTable.Rows.Add(oRow);<br />
        }<br />
<br />
    }<br />
}<br />
<br />


I tried to make this example as clear as possible... hope you got your answer Smile | :)
QuestionGet Info From Windows Service Pin
Owen West16-Nov-06 12:06
Owen West16-Nov-06 12:06 
GeneralRe: Get Info From Windows Service [modified] Pin
George L. Jackson16-Nov-06 16:16
George L. Jackson16-Nov-06 16:16 
AnswerRe: Get Info From Windows Service Pin
Scott Dorman17-Nov-06 6:10
professionalScott Dorman17-Nov-06 6:10 
QuestionUnderstanding .NET Programmability & MSWord Pin
Andrew Mercer16-Nov-06 6:32
Andrew Mercer16-Nov-06 6:32 
Questioncombobox find item by value Pin
Jason18816-Nov-06 5:26
Jason18816-Nov-06 5:26 
AnswerRe: combobox find item by value Pin
Tal Kain16-Nov-06 15:36
Tal Kain16-Nov-06 15:36 
GeneralRe: combobox find item by value Pin
Jason18817-Nov-06 4:11
Jason18817-Nov-06 4:11 
GeneralRe: combobox find item by value Pin
Tal Kain18-Nov-06 14:35
Tal Kain18-Nov-06 14:35 
Questionrosettanet and dotnet framework Pin
rik_b16-Nov-06 3:20
rik_b16-Nov-06 3:20 
QuestionBugs founded Pin
Hendrik Debedts16-Nov-06 1:26
Hendrik Debedts16-Nov-06 1:26 
AnswerRe: Bugs founded [modified] Pin
Dave Kreskowiak16-Nov-06 4:27
mveDave Kreskowiak16-Nov-06 4:27 
GeneralRe: Bugs founded Pin
Tal Kain16-Nov-06 15:41
Tal Kain16-Nov-06 15:41 
GeneralRe: Bugs founded Pin
Dave Kreskowiak16-Nov-06 17:02
mveDave Kreskowiak16-Nov-06 17:02 
GeneralRe: Bugs founded Pin
Tal Kain18-Nov-06 14:22
Tal Kain18-Nov-06 14:22 
QuestionError in building simple directshow application Pin
alpa shah15-Nov-06 23:04
alpa shah15-Nov-06 23:04 
QuestionTime Problem Pin
Tauseef A15-Nov-06 20:36
Tauseef A15-Nov-06 20:36 
AnswerRe: Time Problem Pin
Dave Kreskowiak16-Nov-06 4:24
mveDave Kreskowiak16-Nov-06 4:24 

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.