Multiple elements within a datagrid querystring

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

    #1

    Multiple elements within a datagrid querystring

    Hi,

    I need to bind data to a datagrid and have a custom hyperlink column that
    has multiple elements in the querystring:

    Page.aspx?1=Hel lo&2=Goodbye.. .

    The query string needs to be populated from different values in the
    database. How can I therefore allow for this in the template rather than
    having to create a custom field in my stored procedure as the following will
    not work!:

    NavigateUrl='Se lectCriteria.as px?Database=<%# DataBinder.Eval (Container,
    "DataItem.lsID" ) %>&Table=<%# DataBinder.Eval (Container, "DataItem.tblID ")
    %>&QueryID=<%# DataBinder.Eval (Container, "DataItem.Query ID") %>'

    Many thanks in anticipation,

    Carl
    carl.howarth@m-s-solutions.co.uk


  • Saravana

    #2
    Re: Multiple elements within a datagrid querystring

    It is possible try this,
    <asp:DataGrid id="DataGrid1" AutoGenerateCol umns="False" style="Z-INDEX:
    101; LEFT: 66px; POSITION: absolute; TOP: 79px" runat="server">

    <Columns>

    <asp:TemplateCo lumn HeaderText="Ord er">

    <ItemTemplate >

    <asp:Hyperlin k runat="server"
    Text='<%#DataBi nder.Eval(Conta iner.DataItem," OrderID")%>' NavigateUrl='<% #
    "page.aspx?Orde rid=" + DataBinder.Eval (Container.Data Item,"Orderid") +
    "&ProductID =" + DataBinder.Eval (Container.Data Item,"ProductID ")%>'
    ID="Hyperlink1 " NAME="Hyperlink 1"/>

    </ItemTemplate>

    </asp:TemplateCol umn>

    </Columns>

    </asp:DataGrid>


    --
    Saravana
    Microsoft India Community Star,
    MCAD,SE,SD,DBA.


    "Carl Howarth" <carl.howarth @m-s-solutions.co.uk > wrote in message
    news:uKG8NocUDH A.2564@tk2msftn gp13.phx.gbl...[color=blue]
    > Hi,
    >
    > I need to bind data to a datagrid and have a custom hyperlink column that
    > has multiple elements in the querystring:
    >
    > Page.aspx?1=Hel lo&2=Goodbye.. .
    >
    > The query string needs to be populated from different values in the
    > database. How can I therefore allow for this in the template rather than
    > having to create a custom field in my stored procedure as the following[/color]
    will[color=blue]
    > not work!:
    >
    > NavigateUrl='Se lectCriteria.as px?Database=<%# DataBinder.Eval (Container,
    > "DataItem.lsID" ) %>&Table=<%# DataBinder.Eval (Container, "DataItem.tblID ")
    > %>&QueryID=<%# DataBinder.Eval (Container, "DataItem.Query ID") %>'
    >
    > Many thanks in anticipation,
    >
    > Carl
    > carl.howarth@m-s-solutions.co.uk
    >
    >[/color]


    Comment

    • Saravana

      #3
      Re: Multiple elements within a datagrid querystring

      It is possible try this,
      <asp:DataGrid id="DataGrid1" AutoGenerateCol umns="False" style="Z-INDEX:
      101; LEFT: 66px; POSITION: absolute; TOP: 79px" runat="server">

      <Columns>

      <asp:TemplateCo lumn HeaderText="Ord er">

      <ItemTemplate >

      <asp:Hyperlin k runat="server"
      Text='<%#DataBi nder.Eval(Conta iner.DataItem," OrderID")%>' NavigateUrl='<% #
      "page.aspx?Orde rid=" + DataBinder.Eval (Container.Data Item,"Orderid") +
      "&ProductID =" + DataBinder.Eval (Container.Data Item,"ProductID ")%>'
      ID="Hyperlink1 " NAME="Hyperlink 1"/>

      </ItemTemplate>

      </asp:TemplateCol umn>

      </Columns>

      </asp:DataGrid>


      --
      Saravana
      Microsoft India Community Star,
      MCAD,SE,SD,DBA.


      "Carl Howarth" <carl.howarth @m-s-solutions.co.uk > wrote in message
      news:uKG8NocUDH A.2564@tk2msftn gp13.phx.gbl...[color=blue]
      > Hi,
      >
      > I need to bind data to a datagrid and have a custom hyperlink column that
      > has multiple elements in the querystring:
      >
      > Page.aspx?1=Hel lo&2=Goodbye.. .
      >
      > The query string needs to be populated from different values in the
      > database. How can I therefore allow for this in the template rather than
      > having to create a custom field in my stored procedure as the following[/color]
      will[color=blue]
      > not work!:
      >
      > NavigateUrl='Se lectCriteria.as px?Database=<%# DataBinder.Eval (Container,
      > "DataItem.lsID" ) %>&Table=<%# DataBinder.Eval (Container, "DataItem.tblID ")
      > %>&QueryID=<%# DataBinder.Eval (Container, "DataItem.Query ID") %>'
      >
      > Many thanks in anticipation,
      >
      > Carl
      > carl.howarth@m-s-solutions.co.uk
      >
      >[/color]


      Comment

      Working...