For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > February 2005 > Data Bindings in Whidbey









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Data Bindings in Whidbey
yaip

2005-02-23, 4:01 pm

I have a GridView - gv and an ObjectDataSources - ods. I've configured ods
to get data from tblMenu that has intMenuID as pk and a column called
intParentMenuID - pointing to intMenuID. So the values could be:

intMenuID intParentMenuID
----------- -------------------
1 0
2 0
3 1
....

On gv, I have two templated fields, menu name and parent menu name. In
EditItemTemplate for parent menu name, i have a DropDownList - ddl. I've got
the same ods as my DataSource. In "Select a data field to display", I have
vcMenuName and in "Select a data field for the value", I have intMenuID.

I've also bound my column (by selecting Edit DataBindings) to
intParentMenuID. So my source has Bind("intParentMenuID").

When I run my page and select a row where the parent menu is non-blank (the
third row in our case), I get "Specified argument was out of the range of
valid values. Parameter name: 1". If I remove the data bindings, the code
runs fine but the item is not selected in my ddl and I don't want this
behavior.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com