S
simonZ
I have gridView, which allows sorting and sqlDataSource, which fill in the
data into gridView.
When user clicks one button, I would like to walk through the records in
grid view(which could be sorted):
String content="";
DataSourceSelectArguments arg=new DataSourceSelectArguments();
arg.SortExpression = grdView.SortExpression;
DataView dv = (DataView)SqlDataSource.Select(arg);
foreach (DataRow dr in dv.Table.Rows)
{
content += "<tr><td>"+dr[1].ToString()+"</tD></tr>";
}
It works only that my result(content) is not sorted like gridView. Why? Have
I missed something?
regards,
Simon
data into gridView.
When user clicks one button, I would like to walk through the records in
grid view(which could be sorted):
String content="";
DataSourceSelectArguments arg=new DataSourceSelectArguments();
arg.SortExpression = grdView.SortExpression;
DataView dv = (DataView)SqlDataSource.Select(arg);
foreach (DataRow dr in dv.Table.Rows)
{
content += "<tr><td>"+dr[1].ToString()+"</tD></tr>";
}
It works only that my result(content) is not sorted like gridView. Why? Have
I missed something?
regards,
Simon