I had created unbound checkbox inside Webdatagrid at runtime. How can one display message like 'Are you sure you want to uncheck?' if one tries to uncheck a checked checkbox?
Hi Birendra,
You can accomplish this by handling the CellValueChanging event, canceling the event, and showing a dialog.
You can learn more about how to use this event in our documentation here:http://ko.infragistics.com/help/aspnet/infragistics4.web.v16.2~infragistics.web.ui.gridcontrols.editingclientevents~cellvaluechanging
I've attached a sample application that you can use for reference. Please let me know if you have any further questions.
Thanks Mike for replying.
How can one get currentrow column 1 value which is boundedDataField on checkbox click?
Done it like below:
function DisplayAlert(sender, args)
{
//Get cellIndex of checkbox column which is clicked
var currentcellIndex=args.get_cell().get_Index();
//currentrow.get_cell(currentcellIndex).get_column().get_key(); //Get key of clicked checkbox
var currentrow=args.get_cell().get_row();
//Get Header Text of checkbox column which is clicked
var colHeaderText = currentrow.get_cell(currentcellIndex).get_column().get_header().get_text();
//var currentrowIndex = args.get_cell().get_row().get_Index();
var currentrowname = currentrow.get_cellByColumnKey("FullName").get_value(); //Boundedcolumn at position1 value
if(args.get_currentValue() ==true){
var cc=confirm("Benefit '" + colHeaderText + "' may have associated data." + '\n\n' + "Are you sure you want to remove '" + currentrowname + "'?");
if(cc==true)
args.set_cancel(false);
else
args.set_cancel(true);
}