Given the code:
sub Bind_AgentList()
dv_currAgents=ds_Agents.Tables(agentList).DefaultView
dv_currAgents.RowFilter = "agent_Status='CURR'"
dv_Agents=ds_Agents.Tables(agentList).DefaultView
dropdownlist_Agents.DataSource=dv_Agents
dropdownlist_Agents.DataBind()
dropdownlist_Agents.Items.Insert(0, new listitem("select agent name", ""))
end sub
Question: What should appear in the drop down list? The filtered or unfiltered data?
Answer: The filtered dataview is being used as the source for the dropdown
Question: WHY?! :-(Because the datasource for the dropdownlist is dv_Agents, which is unfiltered. If you want the filtered data, use dv_currAgents as the datasource for the dropdownlist.
0 comments:
Post a Comment