Click here to Skip to main content
15,923,689 members
Home / Discussions / C#
   

C#

 
GeneralRe: override onpaint Pin
donkaiser29-Jun-06 5:51
donkaiser29-Jun-06 5:51 
GeneralRe: override onpaint Pin
Martin#29-Jun-06 6:19
Martin#29-Jun-06 6:19 
GeneralRe: override onpaint Pin
Ista29-Jun-06 6:36
Ista29-Jun-06 6:36 
GeneralRe: override onpaint Pin
LongRange.Shooter29-Jun-06 8:14
LongRange.Shooter29-Jun-06 8:14 
GeneralRe: override onpaint Pin
mikanu29-Jun-06 7:00
mikanu29-Jun-06 7:00 
GeneralRe: override onpaint Pin
donkaiser29-Jun-06 7:54
donkaiser29-Jun-06 7:54 
GeneralRe: override onpaint Pin
mikanu29-Jun-06 8:14
mikanu29-Jun-06 8:14 
QuestionNested datagrid: object reference not set to an instance of an object. Pin
leckey29-Jun-06 4:44
leckey29-Jun-06 4:44 
I have two datagrids, dgParts and a nested datagrid dgWeights
protected System.Web.UI.WebControls.DataGrid dgParts;<br />
		protected System.Web.UI.WebControls.DataGrid dgWeights;


I add a blank line to the dgParts grid with the following code:
private void add_Click(object sender, System.EventArgs e)<br />
		{<br />
			DataTable dt = ds.Tables["Rest"];<br />
			DataRow row;<br />
			row = dt.NewRow();<br />
			strPartNumberInputReference = txtPartNumberInput.Text;<br />
			row["PartNumber"] = strPartNumberInputReference; <br />
			row["DrawingNumber"]=DBNull.Value;<br />
			row["DrawingRevision"]=DBNull.Value;<br />
			row["DwgPath"]=DBNull.Value;<br />
			dt.Rows.Add(row);			<br />
			dt.AcceptChanges();			  <br />
			dgParts.DataSource=dt;			<br />
			dgParts.DataBind();<br />
<br />
<br />
		}


So I am trying to do the same thing for the dgWeights grid:
private void addWeight_Click(object sender, System.EventArgs e)<br />
		{<br />
			BindData();<br />
			DataTable dt = ds.Tables["Weight"];<br />
			DataRow row2;<br />
			row2 = dt.NewRow();<br />
			strPartNumberInputReference = txtPartNumberInput.Text;<br />
			row2["weight"] = DBNull.Value;<br />
			row2["wtdescription"] = DBNull.Value;<br />
			dt.Rows.Add(row2);			<br />
			dt.AcceptChanges();			  <br />
			dgWeights.DataSource=dt;			<br />
			dgWeights.DataBind();<br />
<br />
		}


However, in the debugger it says that the dgWeights is null and I get the error that is in my title description. What am I missing?
QuestionTiling an image in a PictureBox Pin
Cerasti29-Jun-06 4:41
Cerasti29-Jun-06 4:41 
AnswerRe: Tiling an image in a PictureBox Pin
Ista29-Jun-06 6:37
Ista29-Jun-06 6:37 
AnswerRe: Tiling an image in a PictureBox Pin
mikanu29-Jun-06 6:44
mikanu29-Jun-06 6:44 
QuestionC# Event Handling Questions Pin
joshp121729-Jun-06 3:40
joshp121729-Jun-06 3:40 
AnswerRe: C# Event Handling Questions Pin
Jun Du29-Jun-06 4:06
Jun Du29-Jun-06 4:06 
GeneralRe: C# Event Handling Questions Pin
joshp121729-Jun-06 4:16
joshp121729-Jun-06 4:16 
GeneralRe: C# Event Handling Questions Pin
Jun Du29-Jun-06 7:59
Jun Du29-Jun-06 7:59 
AnswerRe: C# Event Handling Questions Pin
led mike29-Jun-06 6:43
led mike29-Jun-06 6:43 
Questioncallto: and mailto: settings Pin
ante.mihalj29-Jun-06 2:32
ante.mihalj29-Jun-06 2:32 
AnswerRe: callto: and mailto: settings Pin
Super Lloyd29-Jun-06 3:15
Super Lloyd29-Jun-06 3:15 
GeneralRe: callto: and mailto: settings Pin
ante.mihalj29-Jun-06 21:34
ante.mihalj29-Jun-06 21:34 
GeneralRe: callto: and mailto: settings Pin
Super Lloyd29-Jun-06 21:51
Super Lloyd29-Jun-06 21:51 
GeneralRe: callto: and mailto: settings Pin
ante.mihalj30-Jun-06 3:28
ante.mihalj30-Jun-06 3:28 
QuestionDatabase problem Pin
hany_hu29-Jun-06 2:23
hany_hu29-Jun-06 2:23 
AnswerRe: Database problem Pin
PlayByTheRules29-Jun-06 3:13
PlayByTheRules29-Jun-06 3:13 
AnswerRe: Database problem Pin
V.29-Jun-06 4:42
professionalV.29-Jun-06 4:42 
AnswerRe: Database problem Pin
Not Active29-Jun-06 5:08
mentorNot Active29-Jun-06 5: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.