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

How to display a confirm dialog box from code behind

4 Answers 265 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rajendra
Top achievements
Rank 1
rajendra asked on 01 Nov 2008, 09:57 AM
Hi everybody,

I'm using two radgrid seaparetly related to two tab. Now If I click tab2 and edit any record of grid 2 then edit popup form open. The scenario starts from here that without touching Update or Cancel button if I click 2nd tab then I need a confirmation message...... I am getting alert mesage through following code..

foreach

(GridDataItem item in radGridTimeBand.MasterTableView.Items)

 

{

 

if (item.ItemType == GridItemType.EditItem)

 

{

RadAjaxManager1.Alert(

"You haven't completed the previous form, data will be lost!!");

 

}

item.Edit =

false;

 

}

radGridTimeBand.Rebind();

Please suggest me how could I display confirm dialog box in place of alert message box.

4 Answers, 1 is accepted

Sort by
0
Bruno
Top achievements
Rank 2
answered on 01 Nov 2008, 06:52 PM
Test this demo:

RadWindow confirmation
0
rajendra
Top achievements
Rank 1
answered on 03 Nov 2008, 06:56 AM
Hi Bruno,

Thanks for the response & answer!!
but my scenario is totally differ becouse I want to implement this confirm dialog box from server side..

if (item.ItemType == GridItemType.EditItem)

 

{

RadAjaxManager1.Alert(

 

"You haven't completed the previous form, data will be lost!!");

 

}

As u can see at this place i wanna confirm dialog box if user submit yes or no...this value is neede further... thats why i need some alternate option...please help me.

0
Princy
Top achievements
Rank 1
answered on 03 Nov 2008, 07:08 AM
Hi,

Try  the following code to register a startup script for  showing radconfirm  window from server side

C#
foreach(GridDataItem item in radGridTimeBand.MasterTableView.Items) 
    {    
          if (item.ItemType == GridItemType.EditItem)    
           {         
            ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language='javascript'>radconfirm('You have not filled the form ?', confirmCallBackFn, 500, 200, '', 'please confirm);</script>");   
           }     
        }    

Thanks,
Princy

0
rajendra
Top achievements
Rank 1
answered on 03 Nov 2008, 07:41 AM
Hi Princy,
thanks for the quick answer!!

I applied given code to register a startup script for  showing radconfirm  window from server side but unfortunately nothing happened.

Let me explain my issue once again:
I'm using two radgrid inside two radtab separately. Now if I clicked Add or Edit window of second grid which is related to second tab specific form(inline or popup) open...here no issue. But if I leave this form without touching Update, Insert or Cancel button and move to first tab then I need a confirmation that previous form(inline or popup) is still open and if I select ok button of that confirmation dialog box  then first tab should be click and further task go ahead along with previous form (inline or popup should be close automatically), but if i select cancel/no button of that confirmation dialog box then automatically previous tab should be select with previous (open) state.

Please give me a appropriate suggestion with example!!
Its urgent.
Tags
Grid
Asked by
rajendra
Top achievements
Rank 1
Answers by
Bruno
Top achievements
Rank 2
rajendra
Top achievements
Rank 1
Princy
Top achievements
Rank 1
Share this question
or