Click here to Skip to main content
       

Visual Basic

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
AnswerRe: Help with Class Library and "Roll Your Own MsgBox"memberSimon_Whale13 Dec '12 - 5:38 
AnswerRe: Help with Class Library and "Roll Your Own MsgBox"mvpRichard MacCutchan13 Dec '12 - 5:40 
Questionnewbiemembervaskoedo12 Dec '12 - 2:16 
AnswerRe: newbiememberEddy Vluggen12 Dec '12 - 3:02 
QuestionExcel.XlChartType.xlLine chart not draw using VB.NetmemberD.Manivelan11 Dec '12 - 19:32 
AnswerRe: Excel.XlChartType.xlLine chart not draw using VB.NetmemberEddy Vluggen12 Dec '12 - 3:00 
QuestionMake a DataGridView column editablememberJohn Waclawski11 Dec '12 - 11:01 
I've been at this on/off for about a week now. I put it to the side & move onto other things and now I'm back to it.
I have a datagridview (dgvScheduleInfo). In its properties I have the "ReadOnly" set to true. I have 6 columns (0-5). The last column ("Notes") I want to make editable if someone clicks on a "Edit Notes" button. Sounds simple enough.
 
I've used the following code to no avail:
dgvScheduleInfo.Columns(5).ReadOnly = False
 
I've tried:
dgvScheduleInfo.Columns("Notes").ReadOnly = False
 
The code above errors out with a "Object reference not set to an instance of an object." even though when I step through the code it shows "Notes" as the name.
 
I've tried hard-coding a value for testing purposes:
dgvScheduleInfo.Rows(3).Cells(5).ReadOnly = False
 
and that hasn't worked.
 
And this is ultimately what I want to work:
dgvScheduleInfo.Rows(dgvScheduleInfo.CurrentRow.Index).Cells(5).ReadOnly = False
 
When I step through the code, I only get an error on the one I specified. Other then that though the code steps through fine but does not set the column I'm requesting to be editable.
 
Now yet another curveball...
If I use:
dgvScheduleInfo.ReadOnly = False
 
It works fine but turns ALL the cells on which I don't want. I only want the "Notes" (or column 5) to be editable.
 
I've changed the "EditMode" to a couple of different things as well. Nothing.
 
Hopefully it's something very easy I'm missing.
 
I haven't changed any of the properties on the datagridview control when I dropped it on my form either. Also I'm using a tableadapter and dataset to populate my datagridview.
 
The only code in my command button is what I've stated above.
 
Thanks for any help on this.
AnswerRe: Make a DataGridView column editablememberEddy Vluggen12 Dec '12 - 2:58 
Questionportability/deployment, VB/DatabasememberMember 838594911 Dec '12 - 4:34 
AnswerRe: portability/deployment, VB/DatabasememberEddy Vluggen11 Dec '12 - 4:51 
GeneralRe: portability/deployment, VB/DatabasememberMember 838594911 Dec '12 - 5:04 
QuestionUSBMuxdmemberD_Wilbur10 Dec '12 - 9:19 
AnswerRe: USBMuxdmemberEddy Vluggen11 Dec '12 - 2:24 
Questionneed vb.net DMS systemmemberMember 967170910 Dec '12 - 0:10 
AnswerRe: need vb.net DMS systemmvpDave Kreskowiak10 Dec '12 - 2:21 
GeneralRe: need vb.net DMS systemmemberSimon_Whale11 Dec '12 - 5:36 
AnswerRe: need vb.net DMS systemmemberPaul Conrad13 Dec '12 - 8:56 
AnswerRe: need vb.net DMS systemmemberPrissySC26 Dec '12 - 2:48 
Questionparent/child bindingsource save new failsmemberPrissySC8 Dec '12 - 11:03 
AnswerRe: parent/child bindingsource save new failsmemberEddy Vluggen11 Dec '12 - 2:21 
GeneralRe: parent/child bindingsource save new failsmemberPrissySC26 Dec '12 - 2:47 
Questionread mail from yahoo using yahoo api in vb.netmemberpuvanar7 Dec '12 - 23:01 
AnswerRe: read mail from yahoo using yahoo api in vb.netmemberEddy Vluggen9 Dec '12 - 23:14 
QuestionMissing ToolbarmemberNo-e6 Dec '12 - 6:09 
AnswerRe: Missing ToolbarmemberPeter_in_27806 Dec '12 - 13:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 21 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid