invisigoth
Member
Hi everybody
I have a problem with the DataView object in our current web project. We dont use DataGrid controls. In one spot in the code, we have to fetch data from various sources (SQL + Xml + others) and I build a DataTable with specific column names. I generate a custom-built web control, from tables and other things to present the data to the UI. In the event of a sort, I thought that sorting on the dataView would be ok, but it doesnt. In fact, it doesnt work at all. ViewState is set to false throughout our entire project.
Is there something missing in the sample I provide? Am I missing something? I have been searching on the various forums and newsgroups, and other resources, but without success. Please help me, anyone.
Thanks in advance!
Iz
Sample code in VB:
I have a problem with the DataView object in our current web project. We dont use DataGrid controls. In one spot in the code, we have to fetch data from various sources (SQL + Xml + others) and I build a DataTable with specific column names. I generate a custom-built web control, from tables and other things to present the data to the UI. In the event of a sort, I thought that sorting on the dataView would be ok, but it doesnt. In fact, it doesnt work at all. ViewState is set to false throughout our entire project.
Is there something missing in the sample I provide? Am I missing something? I have been searching on the various forums and newsgroups, and other resources, but without success. Please help me, anyone.
Thanks in advance!
Iz
Sample code in VB:
Code:
objMyDT is a dataTable
objDataView is what I will use to populate row by row an
html structure that isnt a datagrid object.
strMySortString = "MyColumn1 DESC"
objDataView = objMyDT.DefaultView
If strMySortString.Length > 0 Then We have a sort?
objDataView.Sort = strMySortString
End If
Dim myDataRow as DataRow
For iCnt = iStartCnt To iEndCnt get some results
Get current DataRow:
myDataRow = objDataView.Table.Rows(iCnt)
... here would be the code where I add TableCells
... to TableRows, here irrelevant.
...
Next
Last edited by a moderator: