GridView + ObjectDataSource + web service

G

Guest

I am displaying data from a web service in a DataGrid, using an
ObjectDataSource. Retrieving and displaying data is working fine, but there
is a problem using Edit mode in the GridView. If my GridView contains
columns that correspond exactly to the input parameters for the UpdateMethod
of the ObjectDataSource, then everything works. However, there are some
columns in the DataGrid that should be invisible or read-only. When I set
the Visible attribute of the BoundColumn to true, the column value is not
sent in the web service request for the UpdateMethod.

Here is the web service request body when my SubjectID column is visible:

<UpdateBalanceInput xmlns="urn:schemas-kronos-com:wsdl">
<SubjectID xmlns="">2</SubjectID>
<BalanceTypeID xmlns="">1</BalanceTypeID>
<Quantity xmlns="">2</Quantity>
<Unit xmlns="">Days</Unit>
<Operation xmlns="">reset</Operation>
</UpdateBalanceInput>

And here's the request after setting the Visible attribute of the bound
column to false (because its value is selected from another control):

<UpdateBalanceInput xmlns="urn:schemas-kronos-com:wsdl">
<BalanceTypeID xmlns="">1</BalanceTypeID>
<Quantity xmlns="">0</Quantity>
<Unit xmlns="">Days</Unit>
<Operation xmlns="">reset</Operation>
</UpdateBalanceInput>

Can anyone tell me why making a bound column invisible causes the
ObjectDataSource to omit its value, so that the web service call is missing a
parameter? Is there any workaround?

Thanks,
Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top