Hi,
I addedcode in the Grid <ClientEvents> to call a javascript function. The javascript function is as below:
function RaiseCommand(sender,args)
{
if(args.get_commandName()=='Page' || args.get_commandName()=='Sort')
{
if('<%= grdOrders.MasterTableView.IsItemInserted %>' == 'True')
{
if(confirm("Some of the data entered may be lost. Do you want to continue?"))
{
args.set_cancel(false);
}
else
{
args.set_cancel(true);
}
}
}
}
As seen from the above, this is to alert the user that a data will be lost in the InsertItem if the page is changed or sorted.
The issue is that, this function is called correctly and also the alert is displayed.
But let's say that there are just 2 pages in the grid and in the insertitem is on page 2 and I chose to navigate to page 1. When I click on 'Prev' icon the confirm message comes up and I cancel it i.e. choose not to navigate. Now when I want to navigate to Page 1, the pager doesnt work. The page navigates to page 1 when I click on 'Next' icon and not on 'Prev' icon. This is incorrect. Also the footer message is getting changed to Page 1 of 2 even in the event of I cancelling the Command.
Any pointers?
Brindavan
I addedcode in the Grid <ClientEvents> to call a javascript function. The javascript function is as below:
function RaiseCommand(sender,args)
{
if(args.get_commandName()=='Page' || args.get_commandName()=='Sort')
{
if('<%= grdOrders.MasterTableView.IsItemInserted %>' == 'True')
{
if(confirm("Some of the data entered may be lost. Do you want to continue?"))
{
args.set_cancel(false);
}
else
{
args.set_cancel(true);
}
}
}
}
As seen from the above, this is to alert the user that a data will be lost in the InsertItem if the page is changed or sorted.
The issue is that, this function is called correctly and also the alert is displayed.
But let's say that there are just 2 pages in the grid and in the insertitem is on page 2 and I chose to navigate to page 1. When I click on 'Prev' icon the confirm message comes up and I cancel it i.e. choose not to navigate. Now when I want to navigate to Page 1, the pager doesnt work. The page navigates to page 1 when I click on 'Next' icon and not on 'Prev' icon. This is incorrect. Also the footer message is getting changed to Page 1 of 2 even in the event of I cancelling the Command.
Any pointers?
Brindavan