Skip to main content

Posts

Angular Reactive Form

ts import { Component , OnInit } from '@angular/core' ; import { FormControl , FormControlName , FormGroup , Validators } from '@angular/forms' ; @ Component ({   selector : 'app-root' ,   templateUrl : './app.component.html' ,   styleUrls : [ './app.component.css' ] }) export class AppComponent implements OnInit {   title = 'ReactiveForm' ;   reactiveForm : FormGroup ;   ngOnInit () : void {     this . reactiveForm = new FormGroup ({       firstname : new FormControl < string >( '' , Validators . required ),       lastname : new FormControl < string >( '' ,[ Validators . required ]),       email : new FormControl ( '' ,[ Validators . required , Validators . email ]),       dob : new FormControl < number >( 0 ),       username : new FormControl ( null ),       gender : new FormControl ( 'male' ),    ...

Add and delete in array

 if ($("#" + id).attr("checked") == true)                             {                                                                if (!elems.includes(val))                                 {                                                                          elems.push(val)                                 }                             ...

datalist rows count and find checkbox inside it

        function displayButtonRights()         {             debugger;             var datalist = document.getElementById("<%= dlistBranchDetails.ClientID %>");             var j = 0;             for (var i = 0; i <= datalist.rows.length ; i++)             {                 debugger;                            alert(datalist.rows.length);                 if ($("#" + "ctl00_hldPage_dlistBranchDetails_ctl0" + i + "_chkBranchName").attr("checked") ==true && j==0)                 {                     $("#ctl00_hldPage_dvbtnRights").css("display", "blo...

nested grid 0n heading and multiple subheading

nested grid 0n heading and multiple subheading        private void BindBtnRights()         {             long UserId = 0;             DataSet _dsMenu = ((DataSet)Session["MenuDS"]);             DataView dvMenu = new DataView(_dsMenu.Tables[0]);             dvMenu.RowFilter = "ModuleId=3 AND  MenuId=77";             if (dvMenu.Count > 0)             {                 if (hfUserId.Value != "" && hfUserId.Value != null)                 {                     UserId = Convert.ToInt64(hfUserId.Value);                 }                     dvbtnR...

check all checkboxes under table or gridview

 <table width="100%" border="0" cellpadding="3" cellspacing="0" class="block-borders">                             <tr>                                 <td width="100%" colspan="2">                                     <asp:DataList ID="dListRolesList" ItemStyle-Width="17%" RepeatColumns="3"                                         RepeatDirection="Horizontal" runat="server" DataKeyField="Id" Width="95%">                                         <ItemTemplate>                   ...

denr_rank over partition to skip null value

select distinct *,(CASE WHEN seq is not null  THEN DENSE_RANK() OVER (PARTITION BY menuid , (case when seq is not null  then 1 else 0 end) ORDER BY  SubMenuId)-1  ELSE null END) as   index1 From #SubMenu    order by MenuID asc,isDisplay  desc

Dynamic Menu in asp.net using Listview

 1.    public DataTable LoadMenu()         {             MenuBal MenuBal = new MenuBal();             DataSet ds = this.GetData(0);             PopulateMenu(ds);             return ds.Tables[2];         }     private DataSet GetData(int parentMenuId)         {             MenuBal objmenu = new MenuBal();             string Mode = "";             if (Session["Mode"] != null)             {                 Mode = Session["Mode"].ToString();             }             DataSet ds = objmenu.GetData(parentMenuId, Convert.ToInt32(SessionHelper.CurrentUserId), Mode, SessionHelper...