Another Salesforce blog!!!

Salesforce, Apex

May, 2012

Check to see what checkbox is checked (looping)

  //flag for to check weather any option is selected or not. Default to all selected.         var flag = false;         //Retrieves controls for which the drop down selected option is set.         var dropDownControls = $(‘#<%=gv.ClientID %> select option:selected’);         var checkboxes = $(“.selectreject input[type=’checkbox’]”);         for (index = 0; index < checkboxes.length; […]

Check-All checkbox using GridView (

&lt;asp:CheckBox ID=”chkRejectAll” CssClass=”selectreject” runat=”server” onclick=”javascript:SelectAllRejectCheckboxes(this, ‘.selectreject’);” /&gt; //select reject all checkbox     function SelectAllRejectCheckboxes(chk, selector) {         $(‘#&lt;%=gv.ClientID%&gt;’).find(selector + ” input:checkbox”).not(‘checked’).each(function () {             $(this).prop(“checked”, $(chk).prop(“checked”));         }); } &nbsp; Favorite

Check Or Uncheck Checkboxes within GridView in ASP.NET using JQuery

How to implement check and uncheckboxes within the gridview control using Source: Introduction Today I have implemented to my project to check and uncheck all checkboxes within gridview in So in this article we focus how to implement this features using JQuery with less code. And also I have given live demonstration as […]

How to grab the text inside the TextBox in ASP.NET using jQuery

   var _comment = $(“#[id*=’commentEdit’]”).val();  <asp:TextBox runat=”server” ID=”txtNewComments”  MaxLength=”300″ TextMode=”MultiLine” Rows=”7″ Width=”100%”></asp:TextBox> Favorite

How to restrict the user to allow only one checkbox of each checked? (ASP.NET)

<%@ Page Language=”C#” AutoEventWireup=”true” CodeBehind=”chkbox_checked_uncheked.aspx.cs”     Inherits=”Ediable_Repeater.chkbox_checked_uncheked” %> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” ““> <html xmlns=”“> <head runat=”server”>     <title></title>     <script src=”Scripts/jquery-1.6.2.min.js” type=”text/javascript”></script>     <script type=”text/javascript”>         $(document).ready(function () {             $(‘#C1All’).click(function () {                 $(‘.col1 > input’).attr(“checked”, $(‘#C1All’).attr(“checked”));                 $(‘.col2 > input’).removeAttr(“checked”);                 $(‘#C2All’).removeAttr(“checked”);             });             $(‘#C2All’).click(function () {                 […]

How to restrict the user to allow only one checkbox of each checked?

i have a two columns (approve all/reject all) how to restrict the user to allow only one checkbox of each? output screen <html xmlns=””> <head runat=”server”> <title></title> <script src=”Scripts/jquery-1.4.1.min.js” type=”text/javascript”></script> </head> <body> <form id=”form1″ runat=”server”> <div> <table border=”1″> <tr> <td><input type=”checkbox” id=”C1All” />Approve All</td> <td><input type=”checkbox” id=”C2All” />Reject All</td> </tr> <tr> <td><input type=”checkbox” id=”C101″ class=”col1″ />John […]

Gridview itemTemplate enable/disable the dropdownlist based on the checkbox checked using jQuery

 <ItemTemplate>              <div>                 <asp:CheckBox CssClass=”selectme” ID=”chkReject” runat=”server” Checked=”false”>                 </asp:CheckBox>                 <asp:DropDownList runat=”server” ID=”detail” >                     <asp:ListItem Selected=”True” Value=”0″>Select me</asp:ListItem>                     <asp:ListItem Value=”1″>one</asp:ListItem>                     <asp:ListItem Value=”2″>two</asp:ListItem>                     <asp:ListItem Value=”3″>three</asp:ListItem>                     <asp:ListItem Value=”4″>four</asp:ListItem>                 </asp:DropDownList>             </div>         </ItemTemplate> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) {     var chk = e.Row.FindControl(“CheckBox1”) as CheckBox;     if […]

Check if property is null in lambda expression

  _approved = doa.getEmployee(new Guid(_guidid)).Where(m => !string.IsNullOrEmpty(m.Comment)).ToList(); Favorite

Single lambda expression

What is better to have two where clauses with && or just one where clause: //two where clause: list.Where(x => x.Prop1 == value1).Where(x => x.Prop2 == value2).ToList(); Or //one where clause with && list.Where(x => x.Prop1 == value1 && x.Prop2 == value2).ToList(); It’s better to use the && with two tests in a single lambda. It […]