Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > DropDownList: Accesing the columns values

Reply
Thread Tools

DropDownList: Accesing the columns values

 
 
WhiskeyRomeo
Guest
Posts: n/a
 
      10-03-2007
I have a ddl bound to a sqldatasource which returns 4 columns. It is easy to
access two of them since one serves as the datavaluefield and the other as
the datatextfield. But how do I access the other columns' values in the
selecteditem of the ddl?

I was expecting to see something like this:

ddl1.selecteditem.columns("whatevercolumnIwant").v alue but, of course, that
does not exist.

Any help is appreciated.

WR

 
Reply With Quote
 
 
 
 
WhiskeyRomeo
Guest
Posts: n/a
 
      10-04-2007
David,

Thank you for the reply.

The dropdown list is actually a list of available appointments retrieved via
a stored procedure:

SELECT Cast(Cast(DayDT as Varchar(11)) + ' ' + StartTime12 AS DateTime) AS
APPT, DayDT, StartTime24, StartTime12
FROM tblOrgTimeSlot
WHERE (Org_ID = @Org_ID)AND(Taken < Capacity)
ORDER BY DayDT, StartTime24

So APPT is the datavaluefield and datatextfield. So an item looks like

9/30/2007 9:00 AM, 9/25/2007, 0900, 8:00 AM

The customer only sees first column and the first column is what makes each
item unique. But rather than string manipulate the Appt back into it parts I
just want the StartTime24 and DayDT value.

I can do this via a Infragistic combobox or I can use a dataset as the
dataource. I was just hoping I could do this using the MS standard ddl.

Bill

"David R. Longnecker" wrote:

> WR-
>
> Unless you extend the DropDownList control and add a bit more functionality,
> they only take two columns (a key/value pair) of information--one that is
> associated to the textual display and one behind the scenes for the value.
> When the HTML is generated, the KV pair is translated into:
>
> <option value="__yourValueParameter__">__yourTextFieldPara meter__</option>
>
> How are you wanting to use your other two columns? Append them as potential
> ListItems in the DropDownList control? If you could post an example of your
> code, that'd be helpful.
>
> -dl
>
> --
> David R. Longnecker
> http://blog.tiredstudent.com
>
> > I have a ddl bound to a sqldatasource which returns 4 columns. It is
> > easy to access two of them since one serves as the datavaluefield and
> > the other as the datatextfield. But how do I access the other
> > columns' values in the selecteditem of the ddl?
> >
> > I was expecting to see something like this:
> >
> > ddl1.selecteditem.columns("whatevercolumnIwant").v alue but, of
> > course, that does not exist.
> >
> > Any help is appreciated.
> >
> > WR
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accesing SQL Server from .net server explorer KH ASP .Net 0 12-03-2004 02:33 PM
accesing values of htmldropdownlist on server side? deepak kumar ASP .Net Web Controls 0 10-30-2004 05:44 AM
help with Accesing pix 506 Tomas Cisco 10 05-13-2004 02:29 PM
Structural VHDL - Accesing signals of instances Valentin Tihomirov VHDL 2 11-02-2003 12:08 PM
Accesing Items in datalist edittemplate Gönen EREN ASP .Net 0 08-22-2003 05:12 PM



Advertisments