datagrid question

Discussion in 'ASP .Net Datagrid Control' started by Purdy, Dec 2, 2003.

  1. Purdy

    Purdy Guest

    http://aspnet.4guysfromrolla.com/articles/090902-1.aspx
    I have used this and double checked my work and it isn't working for
    me! uggh!

    what am i doing wrong?
    the error i get is : 'Form1.MyDataGrid__ctl6_TxtDiscPct' is null or
    not an object.

    i am using frames, does that matter at all? thx for any help.


    Here is my code:

    Sub MyDataGrid_Edit(ByVal s As Object, ByVal e As
    DataGridCommandEventArgs)
    MyDataGrid.EditItemIndex = e.Item.ItemIndex

    Dim ds As DataSet
    ds = CType(Session("GlobalDataGrid"), DataSet)
    MyDataGrid.DataSource = ds
    MyDataGrid.DataBind()

    Dim tb As TextBox
    tb = MyDataGrid.Items(e.Item.ItemIndex).Cells(3).FindControl
    "TxtDiscPct")


    RegisterStartupScript("focus", "<script
    language=""JavaScript"">" & vbCrLf & _
    vbTab & "Form1." & tb.ClientID & ".focus();" & _
    vbCrLf & vbTab & "Form1." & tb.ClientID & ".select();" &
    _
    vbCrLf & "<" & "/script>")
     
    Purdy, Dec 2, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    626
  2. BK Kim

    datagrid in datagrid

    BK Kim, Feb 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    780
    Alvin Bruney [MVP]
    Mar 2, 2004
  3. Amar
    Replies:
    0
    Views:
    665
  4. matthew schouppe
    Replies:
    3
    Views:
    2,565
    Scott Allen
    Apr 30, 2004
  5. Patrick Delifer

    Updating Datagrid from outside datagrid

    Patrick Delifer, May 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    438
    Natty Gur
    May 4, 2004
  6. RSB
    Replies:
    2
    Views:
    1,385
  7. Martin Marinov
    Replies:
    2
    Views:
    5,718
  8. Andreas Klemt
    Replies:
    0
    Views:
    522
    Andreas Klemt
    Oct 8, 2003
Loading...