tags:

views:

304

answers:

2

Hi,,,,

Can I add the NewButton in the header template of the aspxgridview(DevExpress Control) to insert a new record to the aspxgridview ?becuase I don't want to add the NewButton in every row in the grid

I would appreciate any help in this

A: 

Hi there!

To answer your question, I've never seen this done in the header of a GridView (probably because most users wish to keep the column headings that are done in the header). I'm a bit curious about this myself.

I have seen this done in the footer, though. If you'd like to do it that way, here are a few links (with pictures, horray) to get you started:

HTH.

rlb.usa
thank you,but actually I used aspxgridview from devexpress in my application,so do you have any idea how to implement that code in devexpress gridview??
kathy
A: 

Try this link: http://www.devexpress.com/Support/Center/SearchResults.aspx?searchtext=new+button&p=T4|P5|57

This has been brought up a few times (and answered) on the DevExpress forums.

The crux of the solution is to add a footer template to your grid and then put an html button in the footer with the OnClick handler set to mygridname.AddNewRow();

as in...

<input id="btnAdd" type="button" value="Add" onclick="grid.AddNewRow();" />
OFConsulting