Here's what i'm currently doing. To bind a dataset to a datagrid.
VB Code:
Dim myReports As New DATA_ACCESS Dim dsReports As New DataSet dsReports = myReports.GET_MY_REPORTS(Session("USER_NAME")) ReportGrid.DataSource = dsReports ReportGrid.DataBind() myReports = Nothing dsReports = Nothing
There's no problem there. Everything comes back fine. My question is, "how do i set the index/key for the grid?". Something like what i did with a drop down box.
Here when an item is selected in the dropdown box i can see a behind the scenes value for it. I'd like to do the same thing with the datagrid. Basically have a column in my dataset that doesn't show in the datagrid but is recognized as the index for that row in the code behind. Or am i going about this the wrong way.VB Code:
Dim dsDepts As New DataSet dsDepts = depts.GET_DEPT_OPTS ddDept.DataSource = dsDepts ddDept.DataTextField = "DEPT_INFO_NAME" ddDept.DataValueField = "DEPT_INFO_IDNM" ddDept.DataBind()
Thanks
Andy (ASP.NET noob)


Reply With Quote