3 Answers, 1 is accepted
0
Accepted
Shinu
Top achievements
Rank 2
answered on 15 Jul 2008, 05:11 AM
Hi Krishna,
You can use the ItemCreated event of the grid to locate the Insert/Update button and use its OnClientClick property to launch custom javascript.
CS:
JS:
Thanks
Shinu.
You can use the ItemCreated event of the grid to locate the Insert/Update button and use its OnClientClick property to launch custom javascript.
CS:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted) |
{ |
GridEditFormInsertItem item = e.Item as GridEditFormInsertItem; |
LinkButton insertButton = item.FindControl("PerformInsertButton") as LinkButton; |
insertButton.OnClientClick = "Show();"; |
} |
} |
JS:
<script type="text/javascript" language="javascript" > |
function Show() |
{ |
alert('Hi') |
} |
</script> |
Thanks
Shinu.
0
Krishna
Top achievements
Rank 1
answered on 15 Jul 2008, 08:17 PM
Hi Shinu..
where to specify the name "PerformInsertButton" in ASPX page..
i have mentioned as below
where to specify the name "PerformInsertButton" in ASPX page..
i have mentioned as below
<
EditColumn UniqueName="InsertButton"
but it doestnt seems to be working ..
can u please help me out again
Thanks,
-Krishna
0
Krishna
Top achievements
Rank 1
answered on 15 Jul 2008, 08:38 PM
I found out the problem
it should be as below then it works fine
it should be as below then it works fine
else if (e.Item is GridEditableItem)
{
LinkButton insertButton = (LinkButton)e.Item.FindControl("PerformInsertButton");
Thanks for the help