This is a migrated thread and some comments may be shown as answers.

[Solved] Add custom button next to AddNewRecord button

2 Answers 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mattias
Top achievements
Rank 1
Mattias asked on 16 Apr 2009, 07:08 AM
Hi,
I wants to add one button next to the AddNewRecord button, how can I do that?
Something like this:

<tr> 
<td align="left"><input type="submit" name="ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$AddNewRecordButton" value=" " id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_AddNewRecordButton" title="Lägg till" class="rgAdd" /> 
<id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_InitInsertButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$InitInsertButton','')">Lägg till</a> 
 
<id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_CustomButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$CustomButton','')">My custom button</a> 
 
</td> 
 
<td align="right"><input type="submit" name="ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$RefreshButton" value=" " id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_RefreshButton" title="Uppdatera" class="rgRefresh" /> 
<id="ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_RebindGridButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$RadGrid1$ctl00$ctl02$ctl00$RebindGridButton','')">Uppdatera</a> 
</td> 
</tr> 

/Mattias

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Apr 2009, 07:54 AM
Hi Mattias,

Try using the CommandItemTemplate so that you can place the desired controls in the CommandItemTemplate. Refer the online demo which explains more about this.
Command Item

Shinu.
0
Mattias
Top achievements
Rank 1
answered on 16 Apr 2009, 09:56 AM
Ahh, thank you Shinu! :)
Tags
Grid
Asked by
Mattias
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mattias
Top achievements
Rank 1
Share this question
or