Click here to Skip to main content
15,896,606 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Framework Bug - Known or Unknown? Pin
nlarson1121-Jan-09 11:15
nlarson1121-Jan-09 11:15 
GeneralRe: Framework Bug - Known or Unknown? Pin
Dave Kreskowiak21-Jan-09 12:13
mveDave Kreskowiak21-Jan-09 12:13 
GeneralRe: Framework Bug - Known or Unknown? Pin
nlarson1121-Jan-09 14:07
nlarson1121-Jan-09 14:07 
GeneralRe: Framework Bug - Known or Unknown? Pin
Dave Kreskowiak21-Jan-09 18:33
mveDave Kreskowiak21-Jan-09 18:33 
AnswerRe: Framework Bug - Known or Unknown? Pin
Eddy Vluggen21-Jan-09 23:53
professionalEddy Vluggen21-Jan-09 23:53 
GeneralRe: Framework Bug - Known or Unknown? Pin
nlarson1122-Jan-09 4:15
nlarson1122-Jan-09 4:15 
AnswerRe: Framework Bug - Known or Unknown? Pin
Ben Fair22-Jan-09 9:19
Ben Fair22-Jan-09 9:19 
QuestionDynamic Item Template DropDownList in DataGrid, Grid disappears on SelectedIndexChanged Pin
Member 327333921-Jan-09 6:37
Member 327333921-Jan-09 6:37 
Frown | :( I have a single row datagrid for adding records. I populate the grid dynamically with dynamic item templates because I have custom controls in the grid.

My ddl is a list of years. When a year is selected, I want to populate a textbox in the grid.

Problem: the entire grid disappears when I select a year

Code:
Public Class DynamicItemTemplate_DropDownList_Year

Implements ITemplate

Public Overridable Overloads Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn

Dim oDropDownList As DropDownList = New DropDownList
oDropDownList.AutoPostBack = True
oDropDownList.EnableViewState = False

AddHandler oDropDownList.Init, AddressOf BindDropDownList
AddHandler oDropDownList.SelectedIndexChanged, AddressOf ChangedDropDownList
container.Controls.Add(oDropDownList)

End Sub

Public Sub BindDropDownList(ByVal sender As Object, ByVal e As EventArgs)
Dim oDropDownList As DropDownList = CType(sender, DropDownList)
Dim container As DataGridItem = CType(oDropDownList.NamingContainer, DataGridItem)
Dim i As Integer

For i = 0 To 5
oDropDownList.Items.Add(New ListItem(CStr(CInt(Now.Year) + 5 - i), CStr(CInt(Now.Year) + 5 - i)))
Next
oDropDownList.SelectedValue = m_SelectedYear

End Sub
Public Sub ChangedDropDownList(ByVal sender As Object, ByVal e As EventArgs)
Dim oDropDownList As DropDownList = CType(sender, DropDownList)
Dim container As DataGridItem = CType(oDropDownList.NamingContainer, DataGridItem)
Dim oDescription As TextBox = CType(container.Cells(4).Controls(0), TextBox)

oDescription.Text = oDropDownList.SelectedItem.Text

End Sub
End Class
QuestionQuestion on strongly typed datasets and using the typed datarows. Pin
Jon_Boy21-Jan-09 4:39
Jon_Boy21-Jan-09 4:39 
AnswerRe: Question on strongly typed datasets and using the typed datarows. Pin
Steven J Jowett21-Jan-09 22:04
Steven J Jowett21-Jan-09 22:04 
GeneralRe: Question on strongly typed datasets and using the typed datarows. [modified] Pin
Jon_Boy22-Jan-09 1:11
Jon_Boy22-Jan-09 1:11 
GeneralRe: Question on strongly typed datasets and using the typed datarows. Pin
Steven J Jowett22-Jan-09 5:16
Steven J Jowett22-Jan-09 5:16 
Questionin msaccess val function what is in oracle? Pin
premprakashbhati21-Jan-09 2:26
premprakashbhati21-Jan-09 2:26 
AnswerRe: in msaccess val function what is in oracle? Pin
EliottA21-Jan-09 2:44
EliottA21-Jan-09 2:44 
AnswerRe: in msaccess val function what is in oracle? Pin
Wendelius21-Jan-09 20:18
mentorWendelius21-Jan-09 20:18 
Questionhow to publish vb.net 2005 project with sqlserver database help me anyone Pin
NaliniNagarajan21-Jan-09 2:09
NaliniNagarajan21-Jan-09 2:09 
AnswerRe: how to publish vb.net 2005 project with sqlserver database help me anyone Pin
EliottA21-Jan-09 2:44
EliottA21-Jan-09 2:44 
AnswerRe: how to publish vb.net 2005 project with sqlserver database help me anyone Pin
rprateek21-Jan-09 13:15
rprateek21-Jan-09 13:15 
AnswerRe: how to publish vb.net 2005 project with sqlserver database help me anyone Pin
Wendelius21-Jan-09 20:19
mentorWendelius21-Jan-09 20:19 
QuestionWindow Height Pin
afridy21-Jan-09 0:51
afridy21-Jan-09 0:51 
AnswerRe: Window Height Pin
Dave Kreskowiak21-Jan-09 3:41
mveDave Kreskowiak21-Jan-09 3:41 
GeneralRe: Window Height Pin
afridy21-Jan-09 5:05
afridy21-Jan-09 5:05 
GeneralRe: Window Height Pin
Dave Kreskowiak21-Jan-09 7:08
mveDave Kreskowiak21-Jan-09 7:08 
GeneralRe: Window Height Pin
afridy21-Jan-09 8:49
afridy21-Jan-09 8:49 
GeneralRe: Window Height Pin
Tom Deketelaere21-Jan-09 5:27
professionalTom Deketelaere21-Jan-09 5:27 

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.