User Profile & Activity

Conrad Hohenberger Member
Page
of 2

Hi Andi,

 

In reference to the code above, in the WebGrid1_UpdateRow code, I'm trying to reference the second column in the grid.  I can reference the first with the code:

 e.Rows.Cells(0).value

however when I try to reference the second column with:

 e.Rows.Cells(1).Value

I get the dreaded object reference error message.

What am I doing wrong?

Thanks,

Conrad

Andi,

I added the DataKeyField to the RootTable element and it caused problems with the Insert and I still get the same message on Update.  Oracle is the database I'm updating.  Will that make a difference?


Also, I couldn't find the attachment.


Thanks,

Conrad

Andi,

I apologize.  I was in the wrong section as you pointed out.  I have made the feature request per your suggestion.

Is there samples of code showing a custom context menu so that I may attempt a work-around?

 

Thanks again,

Conrad

Andi,

 

Apparently, you misunderstood me.  Developer Network is no longer usable.  The message when you try to post states that it doesn't allow new posts and all new posts be done here.  Is there a Feature Request forum here that I can't find?

 

Thanks,

Conrad

Andi,

Developer Network is Read-only and does not allow new posts.  Where should I post a feature request?

 

Thanks,

Conrad

Posted: January 7, 2010 2:12 PM

I spoke to soon.  I forgot to disable my trigger and it was supplying the data.   The InitializeRow event is writing the row number to the grid, but not setting the bind variable for the Insert, thus it fails with a cannot insert null.

Here is my datasource:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DHOUSE %>" ProviderName="Oracle.DataAccess.Client" SelectCommand="SELECT HARDWARE_SCHED_CODE, HARDWARE_SCHED_DESCR FROM HARDWARE_SCHEDULE2 WHERE (M2O_ID = :M2O_ID)" InsertCommand="INSERT INTO HARDWARE_SCHEDULE2(HARDWARE_SCHED_CODE, HARDWARE_SCHED_DESCR,M2O_ID) VALUES (:hardware_sched_code,:hardware_sched_descr,:M2O_ID)" <SelectParameters> <asp:SessionParameter Name="M2O_ID" SessionField="m2o_Id" DbType="Int32" /> </SelectParameters> <InsertParameters> <asp:Parameter Name="hardware_sched_code" DbType="Int32" /> <asp:Parameter Name="hardware_sched_descr" DbType="String" /> <asp:SessionParameter Name="M2O_ID" SessionField="m2o_Id" DbType="Int32" /> </InsertParameters>

</SqlDataSource>

 

Is there another way to accomplish this?  Should my parameter name be assigned differently?

Thanks,

Conrad

Posted: January 6, 2010 9:21 AM

Julia,

 

Wow, I never thought to right-click in the grid.  I thought I had to code for it.  Thanks for the video.

 

Conrad

 

 

Posted: January 5, 2010 3:11 PM

Julia,

 

I'm unable to view the video.  Can you email it to me at conrad.hohenberger@traco.com?

 

Thanks,

Conrad

All times are GMT -5. The time now is 2:24 AM.
Previous Next