EDITITEMTEMPLATE FINDCONTROL PROBLEM

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

    #1

    EDITITEMTEMPLATE FINDCONTROL PROBLEM

    I have a datagrid control and in my edit item template tag

    I have ,



  • Savas Ates

    #2
    Re: EDITITEMTEMPLAT E FINDCONTROL PROBLEM

    They Are both same ... The problem is still going on...

    <asp:DropDownLi st Runat =server ID="CIdeefixeSa tis"

    and

    ideefixesatisc = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)





    It is a different kind of problem



    ideefixesatisc = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)

    If indexno = True Then

    ideefixesatisc. DataTextField = "Stokta Var"

    ideefixesatisc. SelectedIndex =
    ideefixesatisc. Items.IndexOf(i deefixesatisc.I tems.FindByValu e(True))

    End If

    If indexno = False Then

    ideefixesatisc. DataTextField = "Stokta Yok"

    ideefixesatisc. SelectedIndex =
    ideefixesatisc. Items.IndexOf(i deefixesatisc.I tems.FindByValu e(False))

    End If

    End Function





    <asp:DropDownLi st Runat =server ID="CIdeefixeSa tis" SelectedIndex=' <%#
    SelectMyIndex(D ataBinder.Eval( Container, "DataItem.ideef ixesatis"))

    %>' >


    <asp:ListItem Value="True">St okta Var</asp:ListItem>


    <asp:ListItem Value="False">S tokta Yok</asp:ListItem>


    </asp:DropDownLis t>


    Comment

    • Cor Ligthert [MVP]

      #3
      Re: EDITITEMTEMPLAT E FINDCONTROL PROBLEM

      Savas,
      They Are both same ...
      >"CIdeefixeSati s"
      >"CIdeefixesati s"
      Sorry, probably we have a different mail system, in mine they are different.

      Cor

      "Savas Ates" <in da clubschreef in bericht
      news:Owh3%23B%2 3qGHA.2180@TK2M SFTNGP05.phx.gb l...
      They Are both same ... The problem is still going on...
      >
      <asp:DropDownLi st Runat =server ID="CIdeefixeSa tis"
      >
      and
      >
      ideefixesatisc = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)
      >
      >
      >
      >
      >
      It is a different kind of problem
      >
      >
      >
      ideefixesatisc = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)
      >
      If indexno = True Then
      >
      ideefixesatisc. DataTextField = "Stokta Var"
      >
      ideefixesatisc. SelectedIndex =
      ideefixesatisc. Items.IndexOf(i deefixesatisc.I tems.FindByValu e(True))
      >
      End If
      >
      If indexno = False Then
      >
      ideefixesatisc. DataTextField = "Stokta Yok"
      >
      ideefixesatisc. SelectedIndex =
      ideefixesatisc. Items.IndexOf(i deefixesatisc.I tems.FindByValu e(False))
      >
      End If
      >
      End Function
      >
      >
      >
      >
      >
      <asp:DropDownLi st Runat =server ID="CIdeefixeSa tis" SelectedIndex=' <%#
      SelectMyIndex(D ataBinder.Eval( Container, "DataItem.ideef ixesatis"))
      >
      %>' >
      >
      >
      <asp:ListItem Value="True">St okta Var</asp:ListItem>
      >
      >
      <asp:ListItem Value="False">S tokta Yok</asp:ListItem>
      >
      >
      </asp:DropDownLis t>
      >
      >

      Comment

      • Savas Ates

        #4
        Re: EDITITEMTEMPLAT E FINDCONTROL PROBLEM

        What about now ?

        ideefixesatisc. DataTextField = "Stokta Yok"
        Object reference not set to an instance of an object.

        It is still same ?



        Public Function SelectMyIndex(B yVal indexno As Boolean)

        Dim ideefixesatisc As New DropDownList

        ideefixesatisc = CType(Page.Find Control("CIdeef ixeSatis"), DropDownList)



        <asp:DropDownLi st Runat =server ID="CIdeefixeSa tis" SelectedIndex=' <%#
        SelectMyIndex(D ataBinder.Eval( Container, "DataItem.ideef ixesatis")) %>' >












        "Cor Ligthert [MVP]" <notmyfirstname @planet.nl>, haber iletisinde þunlarý
        yazdý:u7juZQ%23 qGHA.2448@TK2MS FTNGP03.phx.gbl ...
        Savas,
        >
        >They Are both same ...
        >
        >>"CIdeefixeSat is"
        >>"CIdeefixesat is"
        >
        Sorry, probably we have a different mail system, in mine they are
        different.
        >
        Cor
        >
        "Savas Ates" <in da clubschreef in bericht
        news:Owh3%23B%2 3qGHA.2180@TK2M SFTNGP05.phx.gb l...
        >They Are both same ... The problem is still going on...
        >>
        ><asp:DropDownL ist Runat =server ID="CIdeefixeSa tis"
        >>
        >and
        >>
        >ideefixesati sc = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)
        >>
        >>
        >>
        >>
        >>
        >It is a different kind of problem
        >>
        >>
        >>
        >ideefixesati sc = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)
        >>
        >If indexno = True Then
        >>
        >ideefixesatisc .DataTextField = "Stokta Var"
        >>
        >ideefixesatisc .SelectedIndex =
        >ideefixesatisc .Items.IndexOf( ideefixesatisc. Items.FindByVal ue(True))
        >>
        >End If
        >>
        >If indexno = False Then
        >>
        >ideefixesatisc .DataTextField = "Stokta Yok"
        >>
        >ideefixesatisc .SelectedIndex =
        >ideefixesatisc .Items.IndexOf( ideefixesatisc. Items.FindByVal ue(False))
        >>
        >End If
        >>
        >End Function
        >>
        >>
        >>
        >>
        >>
        ><asp:DropDownL ist Runat =server ID="CIdeefixeSa tis" SelectedIndex=' <%#
        >SelectMyIndex( DataBinder.Eval (Container, "DataItem.ideef ixesatis"))
        >>
        >%>' >
        >>
        >>
        ><asp:ListIte m Value="True">St okta Var</asp:ListItem>
        >>
        >>
        ><asp:ListIte m Value="False">S tokta Yok</asp:ListItem>
        >>
        >>
        ></asp:DropDownLis t>
        >>
        >>
        >
        >

        Comment

        • Cor Ligthert [MVP]

          #5
          Re: EDITITEMTEMPLAT E FINDCONTROL PROBLEM

          Savas,

          I tried the essential part of your code and don't get any error.

          Dim ideefixesatisc As DropDownList
          ideefixesatisc = CType(Page.Find Control("CIdeef ixeSatis"), DropDownList)
          ideefixesatisc. DataTextField = "Stokta Var"

          Although I don't understand what you are doing.

          Cor

          "Savas Ates" <in da clubschreef in bericht
          news:ui9T1W%23q GHA.3592@TK2MSF TNGP02.phx.gbl. ..
          What about now ?
          >
          ideefixesatisc. DataTextField = "Stokta Yok"
          Object reference not set to an instance of an object.
          >
          It is still same ?
          >
          >
          >
          Public Function SelectMyIndex(B yVal indexno As Boolean)
          >
          Dim ideefixesatisc As New DropDownList
          >
          ideefixesatisc = CType(Page.Find Control("CIdeef ixeSatis"), DropDownList)
          >
          >
          >
          <asp:DropDownLi st Runat =server ID="CIdeefixeSa tis" SelectedIndex=' <%#
          SelectMyIndex(D ataBinder.Eval( Container, "DataItem.ideef ixesatis")) %>' >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          "Cor Ligthert [MVP]" <notmyfirstname @planet.nl>, haber iletisinde þunlarý
          yazdý:u7juZQ%23 qGHA.2448@TK2MS FTNGP03.phx.gbl ...
          >Savas,
          >>
          >>They Are both same ...
          >>
          >>>"CIdeefixeSa tis"
          >>>"CIdeefixesa tis"
          >>
          >Sorry, probably we have a different mail system, in mine they are
          >different.
          >>
          >Cor
          >>
          >"Savas Ates" <in da clubschreef in bericht
          >news:Owh3%23B% 23qGHA.2180@TK2 MSFTNGP05.phx.g bl...
          >>They Are both same ... The problem is still going on...
          >>>
          >><asp:DropDown List Runat =server ID="CIdeefixeSa tis"
          >>>
          >>and
          >>>
          >>ideefixesatis c = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)
          >>>
          >>>
          >>>
          >>>
          >>>
          >>It is a different kind of problem
          >>>
          >>>
          >>>
          >>ideefixesatis c = CType(Page.Find Control("CIdeef ixesatis"), DropDownList)
          >>>
          >>If indexno = True Then
          >>>
          >>ideefixesatis c.DataTextField = "Stokta Var"
          >>>
          >>ideefixesatis c.SelectedIndex =
          >>ideefixesatis c.Items.IndexOf (ideefixesatisc .Items.FindByVa lue(True))
          >>>
          >>End If
          >>>
          >>If indexno = False Then
          >>>
          >>ideefixesatis c.DataTextField = "Stokta Yok"
          >>>
          >>ideefixesatis c.SelectedIndex =
          >>ideefixesatis c.Items.IndexOf (ideefixesatisc .Items.FindByVa lue(False))
          >>>
          >>End If
          >>>
          >>End Function
          >>>
          >>>
          >>>
          >>>
          >>>
          >><asp:DropDown List Runat =server ID="CIdeefixeSa tis" SelectedIndex=' <%#
          >>SelectMyIndex (DataBinder.Eva l(Container, "DataItem.ideef ixesatis"))
          >>>
          >>%>' >
          >>>
          >>>
          >><asp:ListIt em Value="True">St okta Var</asp:ListItem>
          >>>
          >>>
          >><asp:ListIt em Value="False">S tokta Yok</asp:ListItem>
          >>>
          >>>
          >></asp:DropDownLis t>
          >>>
          >>>
          >>
          >>
          >
          >

          Comment

          Working...