[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Adding a link button or hyperlink in gridview

Posted on 2013-01-25
3
Medium Priority
?
321 Views
Last Modified: 2013-01-25
I have a gridview that has  drop down defined.  I am having trouble binding a datasource to the dropdown.  

The UI Code and Code Behind code  is attached.  

At the line

drp.DataSource = ds

I am getting an object reference error.  Can someone please help with this.

Thanks.
gridviewdropdown.txt
0
Comment
Question by:sherbug1015
[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
3 Comments
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 1000 total points
ID: 38819301
>drp = DirectCast(RowItem.Cells(0).FindControl("ddlCadence"), DropDownList)

Above line is not working. Its not finding the drop down list.

Should it not be

drp = DirectCast(RowItem.Cells(1).FindControl("ddlCadence"), DropDownList)
0
 

Author Comment

by:sherbug1015
ID: 38819379
Still throwing the same object reference error
0
 
LVL 41

Accepted Solution

by:
guru_sami earned 1000 total points
ID: 38819407
Where is your vb code block called?

1: You should do the Dropdown databinding in the GridView RowDataBound

For the error...instead of finding in the cell just find in the rowItem

drp = DirectCast(RowItem.FindControl("ddlCadence"), DropDownList)

Open in new window

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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 this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

650 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