[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Deselect Grid view Row

Posted on 2016-09-05
4
Medium Priority
?
49 Views
Last Modified: 2016-09-12
When I select a Gridview row i have code that finds a button in the gridview template and sets visible to ' True'

    Protected Sub gvLiveLearners_SelectedIndexChanged(sender As Object, e As EventArgs) Handles gvLiveLearners.SelectedIndexChanged

        Dim btnLiveL1 As Button = CType(gvLiveLearners.SelectedRow.FindControl("btnLiveL1"), Button)



        btnLiveL1.Visible = True


    End Sub

Open in new window


This all works fine however I can get it to hide the button when I De-select the row.  Help.   Thanks
0
Comment
Question by:Ed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 41784756
btnLiveL1.Visible = False
0
 

Author Comment

by:Ed
ID: 41784864
Thanks but what I'm trying to achieve is this.

When I user selects a gridview Row, the button appears in that row.

However, once another row is selected, the button on the original row button should disappear and the button on the selected row appear.
0
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 2000 total points
ID: 41785148
You could store the button set to visible in a variable of the class so you can easily set it to hidden when you wanted.

Something like:
Dim btnLiveL1 As Button = null   'class level member

Protected Sub gvLiveLearners_SelectedIndexChanged(sender As Object, e As EventArgs) Handles gvLiveLearners.SelectedIndexChanged

if btnLiveL1  is not null then btnLiveL1.Visible = false
        btnLiveL1  = CType(gvLiveLearners.SelectedRow.FindControl("btnLiveL1"), Button)

        btnLiveL1.Visible = True


    End Sub

Open in new window

0
 

Author Closing Comment

by:Ed
ID: 41793835
Perfect, thanks
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question