Solved

Adding a link button or hyperlink in gridview

Posted on 2013-01-25
3
315 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 250 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 250 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

687 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