Skip to main content

Posts

Cascading DropDownLists Inside Telerik RadGrid

protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)         {             // Get the Country DropDownList first.             RadComboBox ddlBranch = (RadComboBox)sender;             // Get the current GridView Row, from which the DropDownList is selected.             GridEditableItem currentRow = (GridEditableItem)ddlBranch.NamingContainer;             // Now let's find the City DropDownList on the same GridView Row.             DropDownList ddlCity = (DropDownList)currentRow.FindControl("ddlAgent");             if (ddlBranch != null && ddlBranch.SelectedIndex > 0 && ddlCity != null)             {                 relife_part2Entities db = new relife_part2Entities();                 int? companyidfk=Convert.ToInt32(ddlBranch.SelectedValue);                 ddlCity.DataSource = db.tbl_policymaster.Where(x => x.companyidfk == companyidfk).ToList();                 dd
Recent posts

For Localize Datetime in Windows Application

  private void Form1_Load(object sender, EventArgs e)         {             // Creating a Global culture specific to our application.             System.Globalization.CultureInfo cultureInfo =new System.Globalization.CultureInfo("en-US");             // Creating the DateTime Information specific to our application.             System.Globalization.DateTimeFormatInfo dateTimeInfo =                 new System.Globalization.DateTimeFormatInfo();             // Defining various date and time formats.             dateTimeInfo.DateSeparator = "/";             dateTimeInfo.LongDatePattern = "dd-MMM-yyyy";             dateTimeInfo.ShortDatePattern = "dd/MM/yyyy";             dateTimeInfo.LongTimePattern = "hh:mm:ss tt";             dateTimeInfo.ShortTimePattern = "hh:mm tt";             // Setting application wide date time format.             cultureInfo.DateTimeFormat = dateTimeInfo;             // Assigning our custom Culture to t

Good Css for HTML Table

<style type="text/css" > /* Table 3 Style */ #tbl{     font-family:Arial;     font-size: 12px;     font-style: normal;     font-weight: normal;     text-transform: uppercase;     letter-spacing: -1px;     line-height: 1.7em;     text-align:center;     border-collapse:collapse; } #tbl thead th{     padding:6px 10px;     text-transform:uppercase;     color:#444;     font-weight:bold;     text-shadow:1px 1px 1px #fff;     border-bottom:5px solid #444; } #tbl thead th:empty{     background:transparent;     border:none; } #tbl thead :nth-child(2), #tbl tfoot :nth-child(2){     background-color: #7FD2FF; } #tbl tfoot :nth-child(2){     -moz-border-radius:0px 0px 0px 5px;     -webkit-border-bottom-left-radius:5px;     border-bottom-left-radius:5px; } #tbl thead :nth-child(2){     -moz-border-radius:5px 0px 0px 0px;     -webkit-border-top-left-radius:5px;     border-top-left-radius:5px; } #tbl thead :nth-child(3), #tbl tfoot :nth-chil

Ms Excel in C#,VB.Net Could not find installable ISAM

When you are going to use Ms Excel in c#, If you get this error when importing a excel  file  use this connection string  Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +Server .MapPath("Master.xlsx") + ";Extended Properties='Excel 12.0;HDR=YES;'"  "HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite. 

Print Div ,HTML or Table Content in Asp.net Using C#

Following is the code for printing  Div ,HTML or Table to printer using C# in Asp.net < script type ="text/javascript" language ="javascript">     function print()     {     var printFriendly = document.getElementById( "div1" )     var printWin = window.open( "about:blank" , "Voucher" , "menubar=no;status=no;toolbar=no;" );     printWin.document.write( "<html><head><title>Voucher Report</title></head><body><h1>Agent Wise Report</h1>" + printFriendly.innerHTML + "</body></html>" );     printWin.document.close();     printWin.window.print();        printWin.close();     }         </ script > add this script lines in your header section of given page. < div id ="div1"> < table width ="100%">     < tr >     < td align ="center" width =&qu