Results 1 to 2 of 2

Thread: web datagrid

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    web datagrid

    Hi,
    In the web datagrid property builder there is a url field that you can set the ID to pass. This seems that you can only use one field to pass the value of. How could one pass more than one parameters in this property builder

    For example using the id field in the url field in the property builder the url that gets created is something like http://local/machinea/default.aspx?id=2

    Notice that only one parameter is being paased.

    Can the property builder produce something like http://local/machinea/default.aspx?id=2&date=23/06/2003

    Notice that now there are two parameters.

    Thanks

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    You can achieve this by using an ItemTemplate Column.
    Example:

    You want to pass and EmployeeID and EmployeeName to a javascript function from a datagrid.

    In the HTML of the DataGrid
    Code:
    <asp:TemplateColumn HeaderText="Select">	
       <HeaderStyle CssClass="HEADERSTYLE"></HeaderStyle>
       <ItemStyle HorizontalAlign="Left"></ItemStyle>
       <ItemTemplate>
          <a href='<%# GetClientSideChooseEmployeeFunction(DataBinder.Eval(Container,"DataItem.EmployeeID").toString(), DataBinder.Eval(Container,"DataItem.EmployeeName").toString()) %>'>Select</a>
       </ItemTemplate>
    </asp:TemplateColumn>
    The GetClientSideChooseEmployeeFunction in the code behind
    VB Code:
    1. Public Function GetClientSideChooseEmployeeFunction(ByVal EmployeeID As String, ByVal EmployeeName As String) As String
    2.    Return "javascript:ChooseEmployee(""" & EmployeeID & """,""" & EmployeeName & """);"
    3. End Function

    Hope this helps.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

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



Click Here to Expand Forum to Full Width