Solved

Adding a link button or hyperlink in gridview

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now