Click here to Skip to main content
12,252,427 members (58,569 online)
   

ASP.NET

 
GeneralRe: how to check if string is int and return boolean Pin
rsoni198012-Oct-06 4:14
memberrsoni198012-Oct-06 4:14 
AnswerRe: how to check if string is int and return boolean Pin
nlindley712-Oct-06 10:58
membernlindley712-Oct-06 10:58 
GeneralRe: how to check if string is int and return boolean Pin
max_dev2006@yahoo.com12-Oct-06 18:28
membermax_dev2006@yahoo.com12-Oct-06 18:28 
Questiondelete a file from prticular location Pin
dcjoshi211-Oct-06 22:39
memberdcjoshi211-Oct-06 22:39 
AnswerRe: delete a file from prticular location Pin
aavesh12-Oct-06 1:32
memberaavesh12-Oct-06 1:32 
AnswerRe: delete a file from prticular location Pin
Guffa12-Oct-06 2:49
memberGuffa12-Oct-06 2:49 
QuestionListview pronblem Pin
dany.s11-Oct-06 22:10
memberdany.s11-Oct-06 22:10 
AnswerRe: Listview pronblem Pin
perlmunger12-Oct-06 4:32
memberperlmunger12-Oct-06 4:32 
You can simply create a property in you underlying object called something like 'DisplayName' and use that as your DataTextField. For example, if you were wanting to display a list of States and you had state objects, you could do this:
public class State
{
    private string code;
    public string Code
    {
        get { return code; }
        set { code = value; }
    }
 
    private string name;
    public string Name
    {
        get { return name; }
        set { name = value; }
    }
 
    public string DisplayName
    {
        /// This will display the state as: "(CA) California"
        get { return string.Format( "({0}) {1}", code, name ); }
    }
}
So now when you set your dropdownlist fields, just use 'DisplayName' as your DataTextField and use 'Code' as your DataValueField.
List<State> states = GetAllStates(); // Must implement GetAllStates

ddlStates.DataTextField = "DisplayName";
ddlStates.DataValueField = "Code";
ddlStates.DataSource = states;
ddlStates.DataBind();

Hope that helps.

-Matt

------------------------------------------

The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall

AnswerRe: Listview pronblem Pin
minhpc_bk12-Oct-06 14:55
memberminhpc_bk12-Oct-06 14:55 
QuestionnewLine Pin
MHASSANF11-Oct-06 22:09
memberMHASSANF11-Oct-06 22:09 
AnswerRe: newLine Pin
Vasudevan Deepak Kumar12-Oct-06 4:39
memberVasudevan Deepak Kumar12-Oct-06 4:39 
AnswerRe: newLine Pin
minhpc_bk12-Oct-06 14:48
memberminhpc_bk12-Oct-06 14:48 
Questionproblem with validation controls in mozilla Pin
pradeep kumarappagari11-Oct-06 20:23
memberpradeep kumarappagari11-Oct-06 20:23 
AnswerRe: problem with validation controls in mozilla Pin
aavesh12-Oct-06 1:23
memberaavesh12-Oct-06 1:23 
GeneralRe: problem with validation controls in mozilla Pin
pradeep kumarappagari12-Oct-06 1:55
memberpradeep kumarappagari12-Oct-06 1:55 
GeneralRe: problem with validation controls in mozilla Pin
aavesh12-Oct-06 2:34
memberaavesh12-Oct-06 2:34 
AnswerRe: problem with validation controls in mozilla Pin
minhpc_bk12-Oct-06 14:50
memberminhpc_bk12-Oct-06 14:50 
Questiondatagrid rows and items drag and drop Pin
Krishlibran11-Oct-06 19:28
memberKrishlibran11-Oct-06 19:28 
AnswerRe: datagrid rows and items drag and drop Pin
Satips11-Oct-06 19:41
memberSatips11-Oct-06 19:41 
GeneralRe: datagrid rows and items drag and drop Pin
Krishlibran11-Oct-06 20:19
memberKrishlibran11-Oct-06 20:19 
Questionhow can i send and receive e-mail's and sms to and from mobile devices Pin
ayyp11-Oct-06 19:04
memberayyp11-Oct-06 19:04 
AnswerRe: how can i send and receive e-mail's and sms to and from mobile devices Pin
Vasudevan Deepak Kumar12-Oct-06 4:34
memberVasudevan Deepak Kumar12-Oct-06 4:34 
Questionhow to set row/column's height/width in datagrid?? Pin
steven_wong11-Oct-06 16:48
membersteven_wong11-Oct-06 16:48 
AnswerRe: how to set row/column's height/width in datagrid?? Pin
postmaster@programmingknowledge.com11-Oct-06 18:03
memberpostmaster@programmingknowledge.com11-Oct-06 18:03 
GeneralRe: how to set row/column's height/width in datagrid?? Pin
varun_khanna173-Nov-06 20:22
membervarun_khanna173-Nov-06 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 5 May 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid