ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Is it possible to customize a column header in a grid
Title:
B
I
{code}
?
I have a grid. On each row there is a link to download a corresponding document. I thought it would be nice if I could use a button/link in the column header that would download all the corresponding documents of the rows in the grid. A little bit like the check all checkbox you see sometimes in column headers. Is it possible to create a custom column header?
Save Changes
Cancel
mounhim
asked at 03 Feb 2014
Answers
B
I
{code}
?
the Header property of the columns accepts html as well, so you could do something like this: new Column{ Header = "<button id='bDownload' onclick='download();'>Download all</button>" }, if you have sorting on this column you might also want to stop propagation on the click handler for this button $('#Grid').on('aweload', function(){ $('#bDownload').click(function(e){e.stopPropagation();})}); you could also listen for aweload event of the grid and modify the html in the header or put a button outside the grid
Save Changes
Cancel
Omu
answered at 03 Feb 2014
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK