954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sorting in a custom grid view

hi,

I am trying to create a web custom control- a grid view that inherits from the system.web.ui.webcontrols.gridview class,,

the functionality that i am trying to add to this custom control is-sorting with up and down arrow keys on the header,

i found a control on the net that does sorting as i want,,,

but u see the problem is that the custom control does sorting with images only when bound through an sqldatasource either directly by placing a datasource control on my aspx page or by programmatically creating one in the page load

when i try binding the custom control using a dataset , i am unable to sort with the images-up and down arrow keys,,

i have created handlers for sort event so sorting occurs through the header links but the iamges don't show


i would really appreciate any help from ur side

painthu

painthu
Newbie Poster
5 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

You can programmatically set a gridview column's headertext (which can be html). So in your procedure that handles the sorting, you could do the following and change the image source depending on the sort direction.

gv.Columns(0).HeaderText = "<img src='whatever.jpg' />"
a496761
Junior Poster in Training
62 posts since Feb 2008
Reputation Points: 10
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You