Click here to Skip to main content
15,914,820 members
Home / Discussions / C#
   

C#

 
AnswerRe: Reading a string line by line? Pin
Heath Stewart22-Sep-05 8:37
protectorHeath Stewart22-Sep-05 8:37 
Question.Net control behaves differently between Web and Windows application Pin
Handy Su22-Sep-05 7:59
Handy Su22-Sep-05 7:59 
AnswerRe: .Net control behaves differently between Web and Windows application Pin
Heath Stewart22-Sep-05 8:03
protectorHeath Stewart22-Sep-05 8:03 
GeneralRe: .Net control behaves differently between Web and Windows application Pin
Dave Kreskowiak22-Sep-05 8:23
mveDave Kreskowiak22-Sep-05 8:23 
GeneralRe: .Net control behaves differently between Web and Windows application Pin
Heath Stewart22-Sep-05 8:33
protectorHeath Stewart22-Sep-05 8:33 
Questionproblem with a HEX array Pin
cue_ball22-Sep-05 7:42
cue_ball22-Sep-05 7:42 
AnswerRe: problem with a HEX array Pin
Heath Stewart22-Sep-05 8:09
protectorHeath Stewart22-Sep-05 8:09 
QuestionDataGridViewCheckBoxColumn Pin
Drew McGhie22-Sep-05 7:22
Drew McGhie22-Sep-05 7:22 
Here's my issue in a nutshell. I have a table that I bind to columns in a DGV, and, in addition, I have one nonbound DataGridViewCheckBoxColumn in the [0] position. In my code, I bind the data, but upon trying to access the checkboxes, I get errors that say the values are null. How do I check the .Checked property of the checkboxes?

//relevant code, cut/pasted so it might be out of order.
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeColumns = false;
this.dataGridView1.AllowUserToResizeRows = false;
this.dataGridView1.AutoGenerateColumns = false;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dgvcbcSelect,
this.dgvtbcName,
this.dgvtbcDescription,
this.AttachmentKey,
this.AttachmentType,
this.AttachmentSourceID,
this.AttachmentID,
this.FileName,
this.FileSize,
this.ContentType});
this.dataGridView1.DataSource = this.attachmentBindingSource;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 25);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(792, 241);
this.dataGridView1.TabIndex = 1;
//
// dgvcbcSelect
//
this.dgvcbcSelect.HeaderText = "Select";
this.dgvcbcSelect.Name = "dgvcbcSelect";
this.dgvcbcSelect.Width = 50;
//
// dgvtbcName
//
this.dgvtbcName.DataPropertyName = "Name";
this.dgvtbcName.HeaderText = "Name";
this.dgvtbcName.Name = "dgvtbcName";
this.dgvtbcName.Width = 150;
//
// dgvtbcDescription
//
this.dgvtbcDescription.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.dgvtbcDescription.DataPropertyName = "Description";
this.dgvtbcDescription.HeaderText = "Description";
this.dgvtbcDescription.Name = "dgvtbcDescription";

// ALL OTHER COLUMNS HAVE .visible=false;

Anyways, when I load the form that has the datagrid, I do this:
{
InitializeComponent();
myAttachmentClient = new AttachmentClient(); //holder for the dataset
myAttachmentClient.LoadAttachmentList(inKey); //loads the data from a SQL server
versionKey = inKey;
dataGridView1.DataSource = myAttachmentClient.AttachmentTable;
}

After this, putting in MessageBox.Show(dataGridView1.Rows[0].Cells[0].Value.ToString()); gives me an error. How can I access the 'checked'-ness of the checkboxes?
AnswerRe: DataGridViewCheckBoxColumn Pin
Drew McGhie22-Sep-05 7:59
Drew McGhie22-Sep-05 7:59 
QuestionMore Efficient Code Pin
Debs*22-Sep-05 6:58
Debs*22-Sep-05 6:58 
AnswerRe: More Efficient Code Pin
therealmccoy22-Sep-05 7:03
therealmccoy22-Sep-05 7:03 
AnswerRe: More Efficient Code Pin
Robert Rohde22-Sep-05 8:06
Robert Rohde22-Sep-05 8:06 
GeneralRe: More Efficient Code Pin
Niklas Ulvinge22-Sep-05 8:51
Niklas Ulvinge22-Sep-05 8:51 
GeneralRe: More Efficient Code Pin
Robert Rohde22-Sep-05 9:05
Robert Rohde22-Sep-05 9:05 
GeneralRe: More Efficient Code Pin
Debs*22-Sep-05 10:30
Debs*22-Sep-05 10:30 
GeneralRe: More Efficient Code Pin
Niklas Ulvinge23-Sep-05 0:42
Niklas Ulvinge23-Sep-05 0:42 
AnswerRe: More Efficient Code -SOLVED Pin
Debs*23-Sep-05 7:11
Debs*23-Sep-05 7:11 
QuestionIEnumIDList.Next(...) is not working :( Pin
daouner22-Sep-05 5:28
daouner22-Sep-05 5:28 
AnswerRe: IEnumIDList.Next(...) is not working :( Pin
Heath Stewart22-Sep-05 6:29
protectorHeath Stewart22-Sep-05 6:29 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner22-Sep-05 7:25
daouner22-Sep-05 7:25 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner22-Sep-05 10:00
daouner22-Sep-05 10:00 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
Heath Stewart22-Sep-05 11:06
protectorHeath Stewart22-Sep-05 11:06 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner23-Sep-05 7:19
daouner23-Sep-05 7:19 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
Heath Stewart23-Sep-05 7:27
protectorHeath Stewart23-Sep-05 7:27 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner23-Sep-05 7:34
daouner23-Sep-05 7:34 

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.