DataRowView

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

    DataRowView

    Hi all,

    I have got this error when using "DataRowVie w". Do we
    need to put reference to this class somewhere? Or Could
    you please point out What is wrong with this HTML?
    Thanks

    ----------------------------------------------------------

    Compiler Error Message: CS0246: The type or namespace
    name 'DataRowView' could not be found (are you missing a
    using directive or an assembly reference?)

    Source Error:



    Line 78:
    </ItemTemplate>
    Line 79:
    <EditItemTempla te>
    Line 80:
    <asp:DropDownLi st runat="server"
    SelectedIndex=' <%# StateIndex[(String)((DataR owView)
    Container.DataI tem)["state"]] %>' id="edit_State" >
    Line 81:

    <asp:ListItem>C A</asp:ListItem>
    Line 82:

    <asp:ListItem>I N</asp:ListItem>
    ----------------------------------------------------------
    It is a dropdown list using in the datagrid control as
    follows:


    <EditItemTempla te>

    <asp:DropDownLi st runat="server"
    SelectedIndex=' <%# StateIndex[(String)((DataR owView)
    Container.DataI tem)["state"]] %>' id="edit_State" >

    <asp:ListItem>C A</asp:ListItem>

    <asp:ListItem>I N</asp:ListItem>

    <asp:ListItem>K S</asp:ListItem>

    <asp:ListItem>M D</asp:ListItem>

    <asp:ListItem>M I</asp:ListItem>

    <asp:ListItem>O R</asp:ListItem>

    <asp:ListItem>T N</asp:ListItem>

    <asp:ListItem>U T</asp:ListItem>

    </asp:DropDownLis t>

    </EditItemTemplat e>
    ---------------------------------------------------------


  • Benjie Fallar

    #2
    Re: DataRowView

    do you have a namespace reference to System.Data?

    "Dinky" <dinh.nguyen@de wr.gov.au> wrote in message
    news:07ac01c346 7a$29069ec0$a30 1280a@phx.gbl.. .[color=blue]
    > Hi all,
    >
    > I have got this error when using "DataRowVie w". Do we
    > need to put reference to this class somewhere? Or Could
    > you please point out What is wrong with this HTML?
    > Thanks
    >
    > ----------------------------------------------------------
    >
    > Compiler Error Message: CS0246: The type or namespace
    > name 'DataRowView' could not be found (are you missing a
    > using directive or an assembly reference?)
    >
    > Source Error:
    >
    >
    >
    > Line 78:
    > </ItemTemplate>
    > Line 79:
    > <EditItemTempla te>
    > Line 80:
    > <asp:DropDownLi st runat="server"
    > SelectedIndex=' <%# StateIndex[(String)((DataR owView)
    > Container.DataI tem)["state"]] %>' id="edit_State" >
    > Line 81:
    >
    > <asp:ListItem>C A</asp:ListItem>
    > Line 82:
    >
    > <asp:ListItem>I N</asp:ListItem>
    > ----------------------------------------------------------
    > It is a dropdown list using in the datagrid control as
    > follows:
    >
    >
    > <EditItemTempla te>
    >
    > <asp:DropDownLi st runat="server"
    > SelectedIndex=' <%# StateIndex[(String)((DataR owView)
    > Container.DataI tem)["state"]] %>' id="edit_State" >
    >
    > <asp:ListItem>C A</asp:ListItem>
    >
    > <asp:ListItem>I N</asp:ListItem>
    >
    > <asp:ListItem>K S</asp:ListItem>
    >
    > <asp:ListItem>M D</asp:ListItem>
    >
    > <asp:ListItem>M I</asp:ListItem>
    >
    > <asp:ListItem>O R</asp:ListItem>
    >
    > <asp:ListItem>T N</asp:ListItem>
    >
    > <asp:ListItem>U T</asp:ListItem>
    >
    > </asp:DropDownLis t>
    >
    > </EditItemTemplat e>
    > ---------------------------------------------------------
    >
    >[/color]


    Comment

    • gladers
      New Member
      • Sep 2005
      • 3

      #3
      simple fix, where you have

      StateIndex[(String)((DataR owView)
      Container.DataI tem)["state"]]

      change to StateIndex[(String)((Syste m.Data.DataRowV iew)
      Container.DataI tem)["state"]]

      adding System.Data. to the front of the DataRowView.

      Comment

      Working...