Template Column data depending on form data

Discussion in 'ASP .Net Datagrid Control' started by John Mackerras, Nov 15, 2004.

  1. Langauage C#

    I have a webform containing a dropdown control and a datagrid. A different
    query is fired depending on the value of the dropdown grid, i.e. if the
    dropdown grid.value = "a" then SQL queryA is fired, if the dropdown
    grid.value = "b" then SQL queryB is fired.

    There is a column in the datagrid for which the results depend on the query
    so I need to be able to detect which value the dropdownist is.

    I have tried

    <asp:TemplateColumn>
    <ItemTemplate>
    <%# GetSecondColumn(Container) %>
    </ItemTemplate>
    </asp:TemplateColumn>

    and letting the procedure GetSecondColumn() find the value, but
    DropDownList1.SelectedValue is not visible to the public procedure.

    How can I tell GetSecondColumn() what the value is of the form control
    DropDownList1.SelectedValue, so I can chose which data to return.

    Thanks

    John
     
    John Mackerras, Nov 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. carlos perez
    Replies:
    0
    Views:
    419
    carlos perez
    Jun 8, 2004
  2. Arne Claus
    Replies:
    4
    Views:
    397
    Arne Claus
    Jul 8, 2005
  3. Replies:
    3
    Views:
    280
    Markus Schoder
    May 28, 2007
  4. pramay

    Resize datagrid column depending on text enter by user

    pramay, Jul 15, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    190
    pramay
    Jul 15, 2005
  5. Replies:
    3
    Views:
    106
    Dr John Stockton
    Nov 18, 2005
Loading...

Share This Page