Posts

Number Allignment in gridview for dynamic data display

  protected void dgBatting1_RowDataBound(object sender, GridViewRowEventArgs e)         {             DataTable dt=(DataTable)((GridView)sender).DataSource;             if (e.Row.RowType == DataControlRowType.DataRow)             {                 for(int i=0; i < e.Row.Cells.Count; i++)                 {                     if (dt.Columns[i].DataType == typeof(System.Int32) || dt.Columns[i].DataType == typeof(System.Decimal))                     { ...

Keyboard Shortcut Keys for Visual Studio

Ctrl-Del Delete next "word" Ctrl-Shift-S Saves all files and projects F7 Switches from the design view to the code view in the editor Shift-F7 Switches from the code view to the design view in the editor Shift-F8 or F8 Navigate to compile time errors Alt-Shift-A Add Existing Item(file) to selected project Ctrl-Shift-A Add New Item(file) to selected project F12 Moves the cursor to the selected method, variable, class definition. Ctrl-] Moves the cursor to the matching brace in the document. If the cursor is on an opening brace, this will move to the corresponding closing brace and vice versa Shift-Tab Moves current line or selected lines one tab stop to the left Ctrl-K, Ctrl-C Marks the current line or selected lines of code as a comment, using the correct comment syntax for the programming language Ctrl-K, Ctrl-U Rem...

Find control in gridview_rowcommand event

 protected void dgAvailability_RowCommand(object sender, GridViewCommandEventArgs e)         {             try             {                 if (e.CommandName == "Save")                 {                     GridViewRow row = (GridViewRow)(((Button)e.CommandSource).NamingContainer);                     DropDownList ddl = (DropDownList)row.Cells[3].FindControl("ddlResponse");                     BFixturePlayer obj...

Create Virtualdirectory in existing website in iis

  Create virtual directory in already existing website in iis 7.0 using asp.net,C# try     {         CreateVirtualDir("localhost", "websiteName" ,"MyVirtualDirectory123", @"E:\testclub");     }     catch (Exception ex)     {         lblMessage.Text = string.Concat("An error occurred: ", ex.Message);     }  private void CreateVirtualDir(string serverName, string website, string appName, string path)     {         DirectoryEntry IISSchema = new DirectoryEntry(string.Concat("IIS://", serverName, "/Schema/AppIsolated"));         bool canCreate = IISSchema.Properties["Syntax"].Value.ToString().ToUpper() != "BOOLEAN";         IISSchema.Dispose();         //get the identifier for the s...

Copy All files from one folder to other folder in Asp.net

Hi , Here am creating th edirectory at runtime and am coping the All files from one folder to other folder  at a time. <div>     <asp:textbox ID="Textbox1" runat="server"></asp:textbox><br />         <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />         <br />          <asp:Label ID="lblMessage" runat="server"/>     </div> C# code  protected void Button1_Click(object sender, EventArgs e)     {         string directoryPath = Server.MapPath("~/") + Textbox1.Text;         //string[] f = Directory.GetFiles(Server.MapPath("/Account"));       if (!Directory.Exists(directoryPath))       {       ...

Bind data to Dropdownlist inside gridview

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" ShowFooter="true"         DataKeyNames="Slno" OnRowDataBound="GridView1_RowDataBound" Height="202px" Width="347px">         <Columns>             <asp:TemplateField HeaderText="Item Name">                 <ItemTemplate>                     <table width="100%">                         <tr>                             <td width="20%...

GridView Articles In Asp.Net 2.0 3.5 4.0

Hi all, Am gathered some grid view articles from this site. http://csharpdotnetfreak.blogspot.com/2012/07/gridview-articles-in-aspnet-20-35-40.html if u want any reference pls reffer above link. 1. Insert Update Edit Delete Rows Record In GridView How To Insert Update Edit Delete Records With SqlDataSource Using C# VB.NET Asp.Net. 2. Drag Drop GridView Rows With JQuery How To Implement Drag And Drop Functionality Using JQuery JavaScript To Rearrange Rows On Client Side. 3. Display Files In GridView From Server Directory This Example Show How To Display Files Directory Sub Directories In From Server. 4. Nested GridView With Expand Collapse Create Nested GridView With Expand Collapse Functionality. 5. Sort GridView By Columns Header In Ascending Descending Enable Sorting In GridView By Clicking on Columns Or Headers In Ascending Or Descending Direction. 6. Hide Disable CommandField ButtonField How to Conditionally Hide Or Disable CommandField Or ButtonField Progr...