asp.net - Get DataRow from the DropDownList -
i doesn't know how convert dropdownlist selected item datarow
sdropdownlist.datasource = gettable(); sdropdownlist.datatextfield = "name"; sdropdownlist.datavaluefield = "id"; i tried datarow dropdownlist this.. .
datarow row = (sdropdownlist.selecteditem datarowview).row; but error .. . errors can't convert listitems datarows
it's not datarow on postback. dropdownlist's item has text , value since it's listitem. if need other informations record later (on postback) have query database again.
actually have need since you've set datavaluefield id-column.
int id = int.parse(sdropdownlist.selectedvalue); // query database whole record or information need
Comments
Post a Comment