When I used the text changed event it recoginized when I left the box but It couldn't find the information in the datagrid because it wasn't a web.ui event it was a Eventargs. Tried to find the data on the build of the datagrid, but can't seem to get it. Here is some of the code I was using
<FooterTemplate>
<asp:TextBox ID="txtadd_Number" Columns="13" AutoPostBack="true" MaxLength="5" Wrap="false" onTextChanged="onTextChangedHandler"
Runat="server" />
</FooterTemplate>
<FooterTemplate>
<asp:LISTBOX ID="listTitle" Runat="server" DataValueField="TITLE" datasource = '<%# GetInformation() %>' DataTextField="TITLE" />
<asp:TextBox ID="txtadd_Title" Columns="13" Runat="server" />
</FooterTemplate>
Sub dgrAddSched_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs ) _
Handles dgrAddSched.ItemCommand
Dim ddlDept As DropDownList = e.Item.FindControl(ddlDept.SelectedItem.Value)
Dim txtadd_Number As TextBox = e.Item.FindControl(txtadd_Number.Text)
Dim strNum = txtadd_Number
Dim strDept = ddlDept.SelectedItem.Value
Dim strLabcode As String = strDept & strNum
Session("labcode") = strLabcode
End Sub
Sub onTextChangedHandler(ByVal sender As Object, ByVal e As EventArgs)
getinformation()
end sub
Function getinformation()
Dim strlabcode As String = Session("labcode")
conData2 = New OdbcConnection("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=" & strDataLocation & ";")
strSql = "select * from s1hedule where labcode ='" & strlabcode & "'"
lstdataset = New DataSet
Dim daData As OdbcDataAdapter = New OdbcDataAdapter(strSql, conData2)
Dim ddldataset = New DataSet
daData.Fill(lstdataset, "Classes")
Return lstdataset
End Function
Any ideas?
Kathryn
|