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

C#

 
GeneralRe: Why is happening this error: Object synchronization method was called from an unsynchronized block of code. ? Pin
OriginalGriff7-Jan-15 8:59
mveOriginalGriff7-Jan-15 8:59 
QuestionI'm looking for instructions to convert a demo project into a class Pin
turbosupramk37-Jan-15 5:00
turbosupramk37-Jan-15 5:00 
AnswerRe: I'm looking for instructions to convert a demo project into a class Pin
OriginalGriff7-Jan-15 5:23
mveOriginalGriff7-Jan-15 5:23 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
turbosupramk37-Jan-15 8:00
turbosupramk37-Jan-15 8:00 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
OriginalGriff7-Jan-15 8:27
mveOriginalGriff7-Jan-15 8:27 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
turbosupramk37-Jan-15 8:49
turbosupramk37-Jan-15 8:49 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
OriginalGriff7-Jan-15 8:58
mveOriginalGriff7-Jan-15 8:58 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
turbosupramk37-Jan-15 9:12
turbosupramk37-Jan-15 9:12 
Ok, I tried the code below but it did not work and my basic class is at the bottom. Under designer.cs, should I be using some of the code under InitializeComponent()?


dataGridViewUserControl1 dgv1 = new dataGridViewUserControl1();
dgv1.ColumnCount = 25;
dgv1.RowCount = 20;


C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace UserControlDemo
{
    public partial class dataGridViewUserControl1 : UserControl
    {
        public dataGridViewUserControl1()
        {
            InitializeComponent();
        }

        private int columnCount;

        public int ColumnCount
        {
            get { return columnCount; }
            set { columnCount = value; }
        }

        private int rowCount;

        public int RowCount
        {
            get { return rowCount; }
            set { rowCount = value; }
        }

        private void UserControl1_Load(object sender, EventArgs e)
        {
            // create datagridviewcolumns
            for (int i = 0; i < columnCount; i++)
            {
                dataGridView1.Columns[i].Name = "column " + i;
            }

            // create datagridviewrows
            for (int i = 0; i < rowCount; i++)
            {
                string[] rowName = new string[] { "row" + i.ToString() };
                dataGridView1.Rows.Add(rowName);
            }
        }
    }
}

GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
OriginalGriff7-Jan-15 10:09
mveOriginalGriff7-Jan-15 10:09 
AnswerRe: I'm looking for instructions to convert a demo project into a class Pin
V.7-Jan-15 10:35
professionalV.7-Jan-15 10:35 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
Mycroft Holmes7-Jan-15 13:42
professionalMycroft Holmes7-Jan-15 13:42 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
turbosupramk38-Jan-15 4:58
turbosupramk38-Jan-15 4:58 
GeneralRe: I'm looking for instructions to convert a demo project into a class Pin
V.8-Jan-15 10:04
professionalV.8-Jan-15 10:04 
QuestionBinding one to many (bindingsource / datasource ) Pin
rudo327-Jan-15 4:52
rudo327-Jan-15 4:52 
Questionenums Pin
Gilbert Consellado6-Jan-15 21:21
professionalGilbert Consellado6-Jan-15 21:21 
AnswerRe: enums Pin
V.6-Jan-15 21:46
professionalV.6-Jan-15 21:46 
GeneralRe: enums Pin
Gilbert Consellado6-Jan-15 22:15
professionalGilbert Consellado6-Jan-15 22:15 
AnswerRe: enums Pin
OriginalGriff6-Jan-15 22:49
mveOriginalGriff6-Jan-15 22:49 
AnswerRe: enums Pin
lukeer6-Jan-15 22:55
lukeer6-Jan-15 22:55 
GeneralRe: enums Pin
OriginalGriff6-Jan-15 23:17
mveOriginalGriff6-Jan-15 23:17 
GeneralRe: enums Pin
lukeer7-Jan-15 1:41
lukeer7-Jan-15 1:41 
GeneralRe: enums Pin
OriginalGriff7-Jan-15 2:08
mveOriginalGriff7-Jan-15 2:08 
GeneralRe: enums Pin
lukeer7-Jan-15 20:55
lukeer7-Jan-15 20:55 
GeneralRe: enums Pin
Gilbert Consellado9-Jan-15 13:07
professionalGilbert Consellado9-Jan-15 13:07 
AnswerRe: enums Pin
BillWoodruff9-Jan-15 15:08
professionalBillWoodruff9-Jan-15 15:08 

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.