CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.getting_started Tags:
Item Type: Date Entered: 2/10/2004 3:52:53 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 41 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
"lewy2000" <>
NewsGroup User
Using FindbyValue (C#)2/10/2004 3:52:53 PM

0

Hey all,

I'm trying to select an item in a drop-down list if it matches a value in a database. Quite simple, eh? Not for this newbie.

Here's my code:

UpdateStatusID.FindByValue("data_from_query_here").selected = true;


Here's the form:

<asp:DropDownList
ID="UpdateStatusID"
DataTextField="status_name"
DataValueField="status_id"
runat="server" />

Any hints?
"hits.net" <>
NewsGroup User
Re: Using FindbyValue (C#)2/10/2004 4:18:12 PM

0

ListItem l_obj_ListItem=null;
l_obj_ListItem = UpdateStatusID.FindByValue("data_from_query_here");
if(l_obj_ListItem != null)
{
Combo.ClearSelection();
l_obj_ListItem.Selected = true;
}

Hope it helps
"hemant verma"
NewsGroup User
Re: Using FindbyValue (C#)2/10/2004 4:21:07 PM

0


try first find selected index
Hemant
hi_hemant@@@hotmail.comNOSPAM
"lewy2000" <>
NewsGroup User
Re: Using FindbyValue (C#)2/10/2004 5:15:54 PM

0

Thanks for the attempt, but there's a problem with this line:

l_obj_ListItem = UpdateStatusID.FindByValue("task_id");

It throws:

CS0117: 'System.Web.UI.WebControls.DropDownList' does not contain a definition for 'FindByValue'

Keep trying, though!
"mychucky" <>
NewsGroup User
Re: Using FindbyValue (C#)1/30/2007 6:44:31 PM

0

I think the following will work:

ddlStartDateMonth.ClearSelection();

ddlStartDateMonth.Items.FindByValue(Convert.ToString(dr["expStartDateMonth"])).Selected = true;

Except at the moment, I do have my own other code issues.

 

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:













bwitish engwish

suggestions on how to make file on fle server not multi user?

phone stuff

spam, spam, spam, spam

bschnur has not made any friends yet

to reinstall netware 6 bm to netware file server nds

free storage space.

the end of the world

check a link

covering basement concrete

nebulous food packaging

old backup devices

whoami

testing x-face

is it broken where you are?

metatags in itrac

snow day

rip dick martin

flash is trash

raised bed gardening?

the welsh certainly know what to do with sheep...

:(

maxtore onetouch drives

google

quicksilver (mac) questions

new support options for mla and groupwise

i'm joining farc

i want to do that!

amazon apologizes

global warming?

cellphone question

tapesvr memory problem-help please

rip world's formerly oldest man!

looking for a general networking it type consultant

sheesh! 6000 unread messages!

i found this article fascinating

it's not brainshare, but...

ugh! vista drive imaging

odd computer behavior

favorite tv shows

sheesh!

dumb or smart?

can someone name for me (this is about the support change coming up)

t-227!!!

certifications???

this is not spam...really.

he gave up too easily ...

karate studio with a drive-thu!

bad words!

many happy wishes

   
  Privacy | Contact Us
All Times Are GMT