Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Get label text when dropdownlist is changed (http://www.velocityreviews.com/forums/t381789-get-label-text-when-dropdownlist-is-changed.html)

staeri@gmail.com 11-02-2006 11:44 AM

Get label text when dropdownlist is changed
 
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


Eliyahu Goldin 11-02-2006 03:16 PM

Re: Get label text when dropdownlist is changed
 
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]


<staeri@gmail.com> wrote in message
news:1162467844.054073.314000@h48g2000cwc.googlegr 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
>





All times are GMT. The time now is 04:29 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.