HighTechTalks DotNet Forums  

dropdownlist, textbox in datagrid on dropdownlist_selectedindexchanged event

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss dropdownlist, textbox in datagrid on dropdownlist_selectedindexchanged event in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
CindyH
 
Posts: n/a

Default dropdownlist, textbox in datagrid on dropdownlist_selectedindexchanged event - 09-03-2007 , 01:06 PM






Hi
I'm using vs.net 2003.
I have a dropdownlist inside a datagrid.
I would like to be able to select a value from the dropdownlist and then
have a textbox which is also inside the datagrid filled with that value.

I'm calling OnSelectedIndexChanged="ddlGridMonth_SelectedIndex Changed" event
when an item from the dropdownlist is selected

I'm not sure of the code I should be using for this event.
Right now I'm trying something like this:


Dim ddl As DropDownList = CType(sender, DropDownList)

Dim dg As DataGrid = Me.FindControl("dgMonthlyReports")

' not getting anything in this textbox (nothing)

Dim txt As TextBox = CType(dg.FindControl("ReportMonth"), TextBox)

' getting value from dropdownlist

Dim ddlValue As Integer = ddl.SelectedItem.Value

' not getting value here because it doesn't seem to know about the textbox

Dim TextValue As String = txt.Text

If ddlValue <> 0 Then

txt.Text = ddlValue

End If


I'm getting the value of the dropdownlist, but not the textbox and then I
need to see if the dropdownlist value is something other then 0 and if so
write the value to the textbox.

Thanks,

CindyH



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.