Hey guys,
I'm working on the search functionality of our member portal. The result datagrid's columns dynamically change depending on what entity the user is searching on. The problem I'm having is that the first column after the button column needs to be invisible because it holds the record's ID. I tried this:
dgResults.DataSource = objSU.GetSearchResults(strSQL)
dgResults.DataBind()
dgResults.Columns(1).Visible = False
But that didn't work, and trying this:
dgResults.DataSource = objSU.GetSearchResults(strSQL)
dgResults.Columns(1).Visible = False
dgResults.DataBind()
produced an error.
So then I thought: I'll just add a column through code, but the DataGridColumn object doesn't seem to have a DataField property.
Any thoughts on how I could get this working?
Thanks,
D
I'm working on the search functionality of our member portal. The result datagrid's columns dynamically change depending on what entity the user is searching on. The problem I'm having is that the first column after the button column needs to be invisible because it holds the record's ID. I tried this:
dgResults.DataSource = objSU.GetSearchResults(strSQL)
dgResults.DataBind()
dgResults.Columns(1).Visible = False
But that didn't work, and trying this:
dgResults.DataSource = objSU.GetSearchResults(strSQL)
dgResults.Columns(1).Visible = False
dgResults.DataBind()
produced an error.
So then I thought: I'll just add a column through code, but the DataGridColumn object doesn't seem to have a DataField property.
Any thoughts on how I could get this working?
Thanks,
D