Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Get label text when dropdownlist is changed

Reply
Thread Tools

Get label text when dropdownlist is changed

 
 
staeri@gmail.com
Guest
Posts: n/a
 
      11-02-2006
I have a datagrid containing one TemplateColumn with a label
(lblObjectID) and one TemplateColumn with a DropDownList.

When the DropDownList is changed I want to capture the value in the
TemplateColumn with the label. How can I do that?

I'm using the following code:

Private Sub ddContract_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)

Dim strContractID As String = CType(sender,
DropDownList).SelectedItem.Value
Dim strObjectID As String = ???

End If

Regards,

S

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      11-02-2006
Try using ItemCommand event. If I am not mistaken, it should fire on the ddl
selection change. Through the event's second parameter you can get to the
item (row), from item to the cell with the label and FindControl on the
cell.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I have a datagrid containing one TemplateColumn with a label
> (lblObjectID) and one TemplateColumn with a DropDownList.
>
> When the DropDownList is changed I want to capture the value in the
> TemplateColumn with the label. How can I do that?
>
> I'm using the following code:
>
> Private Sub ddContract_SelectedIndexChanged(ByVal sender As
> System.Object, ByVal e As System.EventArgs)
>
> Dim strContractID As String = CType(sender,
> DropDownList).SelectedItem.Value
> Dim strObjectID As String = ???
>
> End If
>
> Regards,
>
> S
>



 
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
dll config and web.config and Label Expressions (binding label text to dll config settings) CSharpner ASP .Net 0 04-09-2007 09:00 PM
How to get/read Hard disk label / drive label Praveen Python 1 11-05-2006 07:48 PM
xmlDocument.Save "&#10;" getting changed changed to "&amp;#10" st@jpa.co.jp ASP .Net 1 10-11-2005 01:30 PM
Server side access the text of <asp:label> changed by client side javascript code? nick ASP .Net Web Controls 1 12-23-2004 04:18 AM
server side code access the text of <asp:label> changed by client-side javascript code? nick ASP .Net 3 12-15-2004 06:26 PM



Advertisments