Day: May 11, 2012

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 […]

Read more

Check if property is null in lambda expression

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

Read more

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 […]

Read more