Datadgird with row selected

Discussion in 'ASP .Net' started by Luis E Valencia, May 12, 2004.

  1. look at this I dont know how to do that bin song


    Public Sub pasar(ByVal sender As System.Object, ByVal e As
    System.Web.UI.WebControls.DataGridCommandEventArgs)

    e.Item.BackColor = Color.Red

    panelmeta.Visible = False

    If IsPostBack Then

    If e.CommandName = "Pasar" Then

    dgdir.SelectedIndex = e.Item.ItemIndex

    dgdir.DataBind()

    End If

    Dim iddireccion As Int16 = dgdir.DataKeys(e.Item.ItemIndex)

    lblmetas.Text = "Indicadores para la direccion seleccionada"

    Dim selectCMD2 As SqlCommand = New SqlCommand("select * from tblrelinddir,
    tblheaderindicador where
    tblheaderindicador.idindicador=tblrelinddir.idindicador and
    tblrelinddir.iddireccion=" & iddireccion & "", SqlConnection1)

    selectCMD2.CommandTimeout = 30

    Dim custDA2 As SqlDataAdapter = New SqlDataAdapter

    custDA2.SelectCommand = selectCMD2

    Dim custDS2 As DataSet = New DataSet

    custDA2.Fill(custDS2, "tblindicadormeta")

    dgmetas.DataSource = custDS2.Tables("tblindicadormeta").DefaultView

    If custDS2.Tables("tblindicadormeta").Rows.Count = 0 Then

    lblmetas.Text = "NO hay indicadores en esta direccion"

    dgmetas.Visible = False

    panelmeta.Visible = False

    Else

    dgmetas.DataBind()

    dgmetas.Visible = True

    panelmeta.Visible = False

    End If

    End If

    End Sub
     
    Luis E Valencia, May 12, 2004
    #1
    1. Advertising

  2. it doesnt make what I need
    If a row is sleected
    and I select another one, the last one must be unselected
    "Bin Song, MCP" <> escribió en el mensaje
    news:...
    > So what's the problem?
     
    Luis E Valencia, May 12, 2004
    #2
    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. =?Utf-8?B?U3VyZXNo?=
    Replies:
    1
    Views:
    481
    Saravana
    Nov 22, 2004
  2. Charles Shao
    Replies:
    1
    Views:
    409
    Eliyahu Goldin
    Apr 18, 2005
  3. Want to add row under selected row of gridview

    , Feb 16, 2007, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    327
  4. D
    Replies:
    0
    Views:
    239
  5. Selected Row Only GridView Row Visible?

    , Oct 17, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    312
Loading...

Share This Page