|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DropDownlist and sortingI am using DropdownList control and it is popued up by my datareader
How can I sort the items...neither DropDownlist non data reader has sort method lstTitleList.DataSource = myReader; lstTitleList.DataTextField = "Title"; lstTitleList.DataValueField = "Value"; lstTitleList.DataBind(); thanks got it solved using DataSet and DataView.
It looks that DataReader is forwardonly and there is no facility for sorting... thanks Show quoteHide quote "abcd" <a***@abcd.com> wrote in message news:uMfDqHyVFHA.2616@TK2MSFTNGP14.phx.gbl... >I am using DropdownList control and it is popued up by my datareader > > How can I sort the items...neither DropDownlist non data reader has sort > method > > lstTitleList.DataSource = myReader; > lstTitleList.DataTextField = "Title"; > lstTitleList.DataValueField = "Value"; > lstTitleList.DataBind(); > > thanks > > Unless you do the sort in the SQL query itself. But if you need to swith the
order (user-defined sorting, and more than one column), then using DataView/DataSet is ok because you don't have to pass the sort info so much to the database. On the other hand it *is*doable with dataReader as well (getting dataSet etc always adds little overhead, though it also can bring performance in terms of caching and so on -- Show quoteHide quoteTeemu Keiski ASP.NET MVP, Finland "abcd" <a***@abcd.com> wrote in message news:Ox3ZJ%23yVFHA.1384@TK2MSFTNGP09.phx.gbl... > got it solved using DataSet and DataView. > > It looks that DataReader is forwardonly and there is no facility for > sorting... > > thanks > > > "abcd" <a***@abcd.com> wrote in message > news:uMfDqHyVFHA.2616@TK2MSFTNGP14.phx.gbl... >>I am using DropdownList control and it is popued up by my datareader >> >> How can I sort the items...neither DropDownlist non data reader has sort >> method >> >> lstTitleList.DataSource = myReader; >> lstTitleList.DataTextField = "Title"; >> lstTitleList.DataValueField = "Value"; >> lstTitleList.DataBind(); >> >> thanks >> >> > >
Why don't child control events trigger OnBubbleEvent?
About CreateChildControls() HELP!! Dynamically created webcontrol not accessible on postback Looking for an Autocomplete DropDownList looking for tab control / tabstrip in VS 2005 beta2 Multiple Label tags with same ID Datagrid ... is this the control from hell? What is .Net equivilent of Fieldset/Legend Datalist layout Loading html file into panel |
|||||||||||||||||||||||