Dim lblTimeleft As Label = CType(e.Row.Cells(9).FindControl("lblTimeleft"), Label)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jethro

    Dim lblTimeleft As Label = CType(e.Row.Cells(9).FindControl("lblTimeleft"), Label)

    Hi guys,

    I'm a bit of a newbie, but know VB Classic quite well. The above statement
    appears in some code I'm hacking, and I have added a column to the DataGrid
    (in the middle, so those to the right have had their index upped by one).
    Yet the statement above seems to still return the same value.

    Is the Index value (9) in the statement :

    CType(e.Row.Cel ls(9).FindContr ol("lblTimeleft "), Label)

    doing anything, or is the call simply going to the row, and picking the
    control from there ?

    Thanks in advance

  • Jethro

    #2
    Re: Dim lblTimeleft As Label = CType(e.Row.Cel ls(9).FindContr ol("lblTim eleft"),La bel)

    On 8 May, 15:40, "Jethro" <jethro...@hotm ail.comwrote:
    Hi guys,
    >
    I'm a bit of a newbie, but know VB Classic quite well. The above statement
    appears in some code I'm hacking, and I have added a column to the DataGrid
    (in the middle, so those to the right have had their index upped by one).
    Yet the statement above seems to still return the same value.
    >
    Is the Index value (9) in the statement :
    >
     CType(e.Row.Cel ls(9).FindContr ol("lblTimeleft "), Label)
    >
    doing anything, or is the call simply going to the row, and picking the
    control from there ?
    >
    Thanks in advance
    bump

    Comment

    • Armin Zingler

      #3
      Re: Dim lblTimeleft As Label = CType(e.Row.Cel ls(9).FindContr ol(&quot;lblTim eleft&quot;), Label)

      "Jethro" <jethro_uk@hotm ail.comschrieb
      On 8 May, 15:40, "Jethro" <jethro...@hotm ail.comwrote:
      Hi guys,
      >
      I'm a bit of a newbie, but know VB Classic quite well. The above
      statement appears in some code I'm hacking, and I have added a
      column to the DataGrid (in the middle, so those to the right have
      had their index upped by one). Yet the statement above seems to
      still return the same value.
      >
      Is the Index value (9) in the statement :
      >
      CType(e.Row.Cel ls(9).FindContr ol("lblTimeleft "), Label)
      >
      doing anything, or is the call simply going to the row, and picking
      the control from there ?
      >
      Thanks in advance
      Sorry, no answer, but you should give some more information. What is e?
      Where is the code located? By searching for "findcontro l" I get 5
      results. Which one is it? "Cells" give 4 results. Hmmm... Ok, 3 out of 5
      are "protected" , so 2 are remaining..... After combining the results,
      it's probably

      System.Web.UI.C ontrol.FindCont rol(ByVal String) As
      System.Web.UI.C ontrol

      Right? Pretty much to do for a reader before being able to understand
      the question. :-)


      Armin

      Comment

      Working...