Monday, March 26, 2012

Validating Drop Down List in datagrid.

Hi I asked this question yesterday, but had no replies so I thought I try again today :)

I have two dropdownlist in my datagrid. What I Want to do is disable the second DD when the first DD is selected for that row in the Datagrid. In plain English, users can not select two different items from two different drop down list.

Thanks for your help in advance.

PS: Please provide code examples, my knowledge in dot net in elemantary.ok I figured this much...I create a sub for itemdatabound and add the attributes onselect to disable the other control. but it not working. I get object reference not set to an object...

Public Sub disposition_ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) Handles disposition.ItemDataBound
CType(e.Item.FindControl("binlistDD"), DropDownList).Attributes("onselect") = "javascript:Form1.userlistDD.enabled = false"
End Sub

No comments:

Post a Comment