0

i hv a chk box item field and the bound field . and one separate drodown llist i hv added in my code.based on the selection of the chkbox , it will giv me the index and the selection of the calue from the dropdoen list , both the values will be used to retrieve from the database and then the second column of the gridview will be poplated accc. to the chk box selected and the selection in the sepatere dropdown list ..

how can i do it???

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Jihad
0

Well what I understand is that you want to fill the drop down list based on your selection of the check box, then upon the selection of certain item in the dop down list the gridview the second column of the grid view will be filled with certain values from the data base.

I suggest that you use the RowdataBound event handler to fill that field, but you have to make the column as templatefield and add a control to it such as a label. You can assign a value from an instance where that instance represent the type of data you are assigning to the gridview as a datasource (example a list of cars) .
ex:inside the RowDatabound handler

If e.Row.RowType = DataControlRowType.DataRow Then
CType(e.Row.FindControl("your_label"), Label).Text = CType(e.Row.DataItem, Car).CarName
End If
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.