adding button to header, footer or Pager of dataGrid

R

rosh

hi
i want to know whether is it possible to add button (say DELETE button)
in the header,footer or Pager of a dataGrid?
If yes,how do i achieve the same?
thnkx
cheers
 
A

A Traveler

Header and footer are easy enough. Which ever column you want the button in,
simply make it a template column, and then edit the template by
right-clicking the grid and going to "Edit Template..."

You can also do it through code, which would be the only way if you want to
edit the pager. You can handle the OnItemCreated event for the grid, then do
a Select Case e.Item.ItemType, and look for the type you want to edit. Then
go ahead and add your controls as you wish.
** The only caveat about doing it in code is that it CAN potentially become
very tricky to create and recreate this controls properly on postbacks and
rebinds, because of issues with needing to create the pages
viewstate/control hierarchy in excatly the same fashion it was originally
created.

I hope this helps you some.
 
R

rosh

thnkx a lot for ru quick reply :)
yeh tht worked :)
now i will try the same on PAGER of the dataGrid
now one more question arrises as to whether can i do the same by adding
image buttons?
I have a header fielt say "SortIt" and i want that column to be sorted
both ways(ascd'ng and descending)and also i want to append the image to
the header text "SortIt"[image]
All i want is when i click on this header the sorting must take place
and the image must change according to ascenging n descending sort...
i tried this by adding a Header Image through ProgramBuilder but then if
i add the image from there i am not able to see my header text :( wht do
i do?
can u suggest some idea for the same
have a nice time
cheers
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top