PC Review


Reply
Thread Tools Rate Thread

Combining 2 Fields Using ListBox.DataTextField

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      9th Nov 2005
I have a ListBox control which I am using with databinding. However, the
text that I want to be displayed is a combination of two fields (in this
case, first and last names). What do I enter as the DataTextField property
to combine these two fields? Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Darren Kopp
Guest
Posts: n/a
 
      9th Nov 2005
Well, for a general purpose answer... this should work.

list.DataTextField = string.Forma("{0}, {1}", FirstNameVar, LastNameVar);

FirstNameVar and LastNameVar are string variables or you could use really
anything, I'm sure you get the basic idea.


HTH
-Darren Kopp
http://blog.secudocs.com/

"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a ListBox control which I am using with databinding. However, the
>text that I want to be displayed is a combination of two fields (in this
>case, first and last names). What do I enter as the DataTextField property
>to combine these two fields? Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
Darren Kopp
Guest
Posts: n/a
 
      10th Nov 2005
oops, string.Format.

-Darren

"Darren Kopp" <darrenkopp+(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Well, for a general purpose answer... this should work.
>
> list.DataTextField = string.Forma("{0}, {1}", FirstNameVar, LastNameVar);
>
> FirstNameVar and LastNameVar are string variables or you could use really
> anything, I'm sure you get the basic idea.
>
>
> HTH
> -Darren Kopp
> http://blog.secudocs.com/
>
> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I have a ListBox control which I am using with databinding. However, the
>>text that I want to be displayed is a combination of two fields (in this
>>case, first and last names). What do I enter as the DataTextField property
>>to combine these two fields? Thanks.
>> --
>> Nathan Sokalski
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      10th Nov 2005
Nathan you coould do that in SQL
Hope that helps
Patrick



"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a ListBox control which I am using with databinding. However, the
> text that I want to be displayed is a combination of two fields (in this
> case, first and last names). What do I enter as the DataTextField property
> to combine these two fields? Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Using the DataTextField and DataValue Field in a ListBox l7alabeh Microsoft ASP .NET 4 20th Sep 2006 12:43 PM
DataBinding ListBox.DataTextField =?Utf-8?B?bXVzb3NkZXY=?= Microsoft ASP .NET 2 4th Apr 2006 05:39 AM
Combining 2 Fields Using ListBox.DataTextField Nathan Sokalski Microsoft ASP .NET 3 10th Nov 2005 08:49 AM
listbox datavaluefield and datatextfield tshad Microsoft ASP .NET 3 10th May 2005 06:35 AM
Masking DataTextField Output For Display In a ListBox NBB Microsoft ASP .NET 1 24th Dec 2003 12:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:32 PM.