Sort Hyperlinks Not Showing Up (ASP.NET 2.0)

G

Guest

In my code I'm dynamically creating a GridView control and binding it to a
DataView object that I create form a DataSet that I get from a web service
call. It seems that no matter what I do I can not get the sort hyperlinks in
the header row to show up. I've set AllowSorting to true and various other
things but no matter what I do I can't get them to show up. Does sorting only
work with the new SqlDataSource and related objects in ASP.NET 2.0 and not
data sources like the DataView object.

Thanks
 
G

Guest

Just to help clarify here's a snippet from the problem code:

protected override void Render(HtmlTextWriter writer)
{
DataView dv = new DataView(_ds.Tables[0]);
_gv = new GridView();
_gv.AllowSorting = true;
_gv.DataSource = dv;
_gv.DataBind();
_gv.RenderControl(writer);
}

When I use this code no matter what properties I seem to set I can not get
the sort hyperlinks in the header row to show up. If I declaratively create a
GridView control it works fine. It's only if I dynamically create the control
as I've done above that I have the problem.

Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top