$('#dg').datagrid({ onSelect: function(index,row){ var count = $(this).datagrid('getSelections').length; console.log(count) }})