Click here to Skip to main content
15,886,919 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: application.run Pin
Colin Angus Mackay18-Feb-07 4:36
Colin Angus Mackay18-Feb-07 4:36 
Questionshared keyword in vb.net Pin
amaneet18-Feb-07 0:48
amaneet18-Feb-07 0:48 
AnswerRe: shared keyword in vb.net Pin
Colin Angus Mackay18-Feb-07 4:34
Colin Angus Mackay18-Feb-07 4:34 
GeneralRe: shared keyword in vb.net Pin
amaneet19-Feb-07 3:36
amaneet19-Feb-07 3:36 
GeneralRe: shared keyword in vb.net Pin
Hossein Narimani Rad20-Feb-07 19:13
Hossein Narimani Rad20-Feb-07 19:13 
Questiontransfer attribute from 1 datagrid to another Pin
kendo1718-Feb-07 0:17
kendo1718-Feb-07 0:17 
AnswerRe: transfer attribute from 1 datagrid to another Pin
Johan Hakkesteegt23-Feb-07 0:40
Johan Hakkesteegt23-Feb-07 0:40 
QuestionSelectedIndexChange of DDL inside Datagrid.. HELP!! Pin
Huvandhuma17-Feb-07 19:50
Huvandhuma17-Feb-07 19:50 
Hi..

I am having a huge problem with getting the selected index changed property of a drop down list when inside a datagrid..

I have two drop down lists inside the datagrid, toSectDDL and tosubSectDDL. What i want is when the user selects an item from the toSectDDL, the tosubSectDDL should be populated with the related subsections for that particular section only..

I have written the VB code as
Protected Sub toSectDDL_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim row As DataGridItem
For Each row In SectionGrid.Items
Dim toSectDDL As DropDownList = CType(SectionGrid.FindControl("toSectDDL"), DropDownList)
Dim toSubSectDDL As DropDownList = CType(SectionGrid.FindControl("toSubSectDDL"), DropDownList)
If toSectDDL.SelectedValue = 0 Then
toSubSectDDL.Items.Insert(0, New ListItem("None", "0"))
Else

toSubSectDDL.DataSource = Office.GetSubSectionsForSection(toSectDDL.SelectedValue)
toSubSectDDL.DataTextField = "subsection"
toSubSectDDL.DataValueField = "subSecID"
toSubSectDDL.DataBind()
toSubSectDDL.Items.Insert(0, New ListItem("Select", "0"))
End If
Next
End Sub

and set the ASP code as
<asp:templatecolumn headertext="toSection">
<itemtemplate>
<asp:dropdownlist id="toSectDDL" runat="server" cssclass="standardDDL" width="402px" onselectedindexchanged="toSectDDL_SelectedIndexChanged" autopostback="True">


Now i am getting a server error saying
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
veyo.OfficeNameChange.toSectDDL_SelectedIndexChanged(Object sender, EventArgs e) in \\aion\intranetroot$\veyo\updateVEYO\OfficeNameChange.aspx.vb:430
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1099

Can anyone plz help!!!!!!
AnswerRe: SelectedIndexChange of DDL inside Datagrid.. HELP!! Pin
Marcus J. Smith19-Feb-07 3:39
professionalMarcus J. Smith19-Feb-07 3:39 
QuestionCopy any Folder & its Sub Folder in My Document Pin
Vikash Yadav17-Feb-07 17:59
Vikash Yadav17-Feb-07 17:59 
AnswerRe: Copy any Folder &amp; its Sub Folder in My Document Pin
MatrixCoder17-Feb-07 18:28
MatrixCoder17-Feb-07 18:28 
AnswerRe: Copy any Folder & its Sub Folder in My Document Pin
TwoFaced17-Feb-07 18:45
TwoFaced17-Feb-07 18:45 
QuestionColor of a Pixel in a image in a pictureBox Pin
charchabil0317-Feb-07 7:58
charchabil0317-Feb-07 7:58 
AnswerRe: Color of a Pixel in a image in a pictureBox Pin
Christian Graus17-Feb-07 9:48
protectorChristian Graus17-Feb-07 9:48 
AnswerRe: Color of a Pixel in a image in a pictureBox Pin
The ANZAC17-Feb-07 14:14
The ANZAC17-Feb-07 14:14 
Questioncrystal report multiple headings Pin
nilam1117-Feb-07 1:51
nilam1117-Feb-07 1:51 
Questiondatetime setting Pin
nilam1117-Feb-07 1:31
nilam1117-Feb-07 1:31 
AnswerRe: datetime setting Pin
nlarson1117-Feb-07 1:45
nlarson1117-Feb-07 1:45 
QuestionHow to deploy .net Crystal Report with .net setup project Pin
Ali 11016-Feb-07 23:38
Ali 11016-Feb-07 23:38 
QuestionColor of a Pixel in a image in a pictureBox Pin
charchabil0316-Feb-07 23:13
charchabil0316-Feb-07 23:13 
AnswerRe: Color of a Pixel in a image in a pictureBox Pin
Guffa17-Feb-07 1:12
Guffa17-Feb-07 1:12 
GeneralRe: Color of a Pixel in a image in a pictureBox Pin
charchabil0317-Feb-07 3:52
charchabil0317-Feb-07 3:52 
AnswerRe: Color of a Pixel in a image in a pictureBox Pin
Guffa17-Feb-07 9:31
Guffa17-Feb-07 9:31 
AnswerRe: Color of a Pixel in a image in a pictureBox Pin
The ANZAC17-Feb-07 14:11
The ANZAC17-Feb-07 14:11 
QuestionHow do i store my font and return back. Pin
.NetRams16-Feb-07 22:30
.NetRams16-Feb-07 22:30 

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.