Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 26th, 2005, 12:36 PM
Registered User
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Kathryn
Default DataGrid cell events?? Help

Here is my scenario.

I have a database that will be used to create a schedule of class for each term. I have used a new row in the footer to add the classes then rebind into the data grid so the user can see what they entered and also have the option to edit or delete those classes.

What I have added is a data bound ddlist to the footer so the user can choose the Department the next text box is for the class number.
    What I need to do is when the user leaves the cell where the textbox for the number is, is to concatenate the Department and Number together to search another database for the Title of the class and also the number of credits.

    How do I find that event when the user leaves that textbox? I also would like to be able to give the user the option of accepting that title or changing it?

    Any help would be appreciated.

Thanks



Kathryn
 
Old January 26th, 2005, 02:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Javascript version:
The onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation. It may be used with the same elements as onfocus.

textbox control:
http://authors.aspalliance.com/aspxt...ebcontrol.aspx

 
Old January 26th, 2005, 02:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Forgot to mention:
AutoPostBack - true if client-side changes in the control automatically cause a postback to the server; false otherwise. The default is false.

 
Old January 27th, 2005, 04:28 PM
Registered User
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Kathryn
Default

Thanks for responding, had meeting today will try it Monday and let you know!!

Thanks again

Kathryn
 
Old January 31st, 2005, 10:12 AM
Registered User
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Kathryn
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fire events from datagrid cell? param99 ASP.NET 1.0 and 1.1 Professional 2 November 15th, 2006 07:33 AM
Datagrid Button Events Ric_H C# 0 April 5th, 2006 09:20 PM
Tricky DataGrid Events Issue DudeBori82 ASP.NET 1.0 and 1.1 Professional 3 October 21st, 2005 04:26 PM
DataGrid Cell mrideout BOOK: Beginning ASP.NET 1.0 0 August 17th, 2004 12:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.