Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>[Update] As other's have suggested I'd try the simple binding of the value to your drop downs and see if that works. I know it doesn't work always, as I've done stuff as I've explained below (mostly with Telerik controls though the little code snippet doesn't include that).</p> <hr> <p>I'm too tired to write the code for ya, but there is some help. On each drop down Databound even you can figure out which item to select by doing something like this. </p> <pre><code>DropDownList ddl = (DropDownList)sender; FormView frmV = (FormView)ddl.NamingContainer; string field_value = ( frmV.DataItem as DataRowView )[ ddl.DataTextField ].ToString (); ListItem lm = ddl.Items.FindByValue ( field_value ); if (lm != null) lm.Selected = true; </code></pre> <p>As far as doing cascading drop downs in a form view, on your selectedIndexChanged events on your drop down list you will need to find the other drop down list that are affected and set parameters and re-data bind them. You can use a similar approach as the above where on your selectedIndexChanged event you through the drop down list's naming container get the formview, then use the formview's findcontrol to get at the other drop downs you need to modify.</p> <p>I hope that helps. If I was more awake I'd give you a better example.</p> <p>Also a couple gotcha's. </p> <p>1) For better performance I would use a webservice for your drop down list, but I'll leave you to figure that one out or ask in another thread. </p> <p>2) I've noticed sometimes when I've got three different controls bound to the same sqlDataSource sometimes weird things happen if you aren't careful. Like your country drop downs might be. Sometimes I grab a view from a DataSet instead of binding directly to it it like in this link-</p> <p><a href="http://trappedinhoth.blogspot.com/2008/10/for-reference-getting-datatable.html" rel="nofollow">http://trappedinhoth.blogspot.com/2008/10/for-reference-getting-datatable.html</a></p> <p>3) For better performance you can do a lot of this on the client side in Javascript. You can ask about that in a different thread though :)</p> <p>This type of thing is a pain but once you do it a few times it gets a little less tedious. Good luck.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload