Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default DataGrid Woes

    I have a datagrid that I created and fill a dataset using a stored proc.
    and bind it. The first column( a linkbutton button column) in the DG
    contains a number, the second a name. When the user presses the button I
    need the number displayed on the link. The number is a field from the
    database. I got the code to trap the button press to work, but I cant get
    the number displayed.. (vb.net)

    Sub Gridclick( byval sender as object, byval e as datagridcommandeventargs)
    handles datagrid1.ItemCommand

    I've tried different variations of casting such as
    CType(e.Item.Cells(0).Controls(0), ButtonColumn) or LinkButton and other
    variations
    I also tried to use the e.item.cell(0).text and other variations of the
    e.item....
    I CAN READ the NAME part of the row with e.item.cells(1).text.
    WHAT GIVES..?
    I tried many different commands till I am frustrated.
    A code sample to read the first col link would be great.
    Thank You
    F



    Freddy Guest

  2. Similar Questions and Discussions

    1. XML encoding woes
      Hi there, i need to load xml files from a lot of different sources where the encoding varies from iso to utf 8 (not my data, so I cannot reformat...
    2. WSE 2 woes
      I have created the Hello World web service and implemented WSE 2 tokens to validate against a database. I am using VS 2003 and installed the...
    3. PHP installation woes
      Hi there, Could someone please give the low down on installing and configuring php on freebsd? I am running the 4.10 release as our development...
    4. PDF woes
      EPS files are intended to be placed on a page in a page-layout program, and thus contain no page orientation or page size information. If you are...
    5. Font Woes
      Sorry... not a regular member of this forum.... just cruising through, trying to decide whether to upgrade or not.... Anyway.... Description...
  3. #2

    Default Re: DataGrid Woes

    Hi Freddy,

    If the linkbutton button is in the first column, following code should work:

    Dim linkNumber As String = CType(e.Item.Cells(0).Controls(0),
    LinkButton).Text

    HTH

    "Freddy" <fred@tim.com> wrote in message
    news:uqqjv#HlFHA.3436@tk2msftngp13.phx.gbl...
    > I have a datagrid that I created and fill a dataset using a stored proc.
    > and bind it. The first column( a linkbutton button column) in the DG
    > contains a number, the second a name. When the user presses the button I
    > need the number displayed on the link. The number is a field from the
    > database. I got the code to trap the button press to work, but I cant get
    > the number displayed.. (vb.net)
    >
    > Sub Gridclick( byval sender as object, byval e as
    datagridcommandeventargs)
    > handles datagrid1.ItemCommand
    >
    > I've tried different variations of casting such as
    > CType(e.Item.Cells(0).Controls(0), ButtonColumn) or LinkButton and other
    > variations
    > I also tried to use the e.item.cell(0).text and other variations of the
    > e.item....
    > I CAN READ the NAME part of the row with e.item.cells(1).text.
    > WHAT GIVES..?
    > I tried many different commands till I am frustrated.
    > A code sample to read the first col link would be great.
    > Thank You
    > F
    >
    >
    >

    Elton Wang Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139