When selecting a row in a datagrid how can I activate a multiview view?

Last post 06-07-2006 7:27 AM by bananas. 0 replies.

Sort Posts:

  • When selecting a row in a datagrid how can I activate a multiview view?

    06-07-2006, 7:27 AM
    • Member
      43 point Member
    • bananas
    • Member since 03-22-2006, 4:19 PM
    • Posts 19

    Hi fellas, there's trouble here for me!

    I have a DataGrid, and I've used some code to highlight a selected row, and when clicked it pulls up the details in a DetailsView. That works fine! But the problem is that my DetailsView is in View2 of a Multiview and the default active view is (and needs to be) View1.

    What would be the code to activate the View2 OnClick ?

    Any help is much appreiciated!

    Here's the relevant code:-----------

    This is my highlight selected row and pass the selected info to my DetailsView code:

     
      Sub Select_Change_View(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
            If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand'; this.style.backgroundColor='#FFE0C0';")
    
                e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(ResultsGrid, "Select$" + e.Row.RowIndex.ToString))
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';")
    
            End If
        End Sub
     This is the datagrid command I pass to call the above code:

    OnRowDataBound

    ="Select_Change_View"
Page 1 of 1 (1 items)