[asp.net] How to hide a TemplateField column in a GridView

protected void gvLogMessageDetail_RowDataBound(object sender, GridViewRowEventArgs e)  
    { 
      if (e.Row.RowType == DataControlRowType.Header)   
        {  
            if (rdlForImportOrExport.SelectedIndex == 1)  
            {  
                e.Row.Cells[3].Visible = false;  
                e.Row.Cells[4].Visible = false;  
                e.Row.Cells[5].Visible = false;  
            }  
            else  
            {  
                e.Row.Cells[3].Visible = true;  
                e.Row.Cells[4].Visible = true;  
                e.Row.Cells[5].Visible = true;  
            }  
        }    
        if (e.Row.RowType == DataControlRowType.DataRow) //skip header row  
        {  
            try  
            {  
                if (rdlForImportOrExport.SelectedIndex == 1)  
                {  
                    e.Row.Cells[3].Visible = false;  
                    e.Row.Cells[4].Visible = false;  
                    e.Row.Cells[5].Visible = false;  
                }  
                else  
                {  
                    e.Row.Cells[3].Visible = true;  
                    e.Row.Cells[4].Visible = true;  
                    e.Row.Cells[5].Visible = true;  
                }  
                }  
            catch  
            {  
                ClientScript.RegisterStartupScript(GetType(), "Expand", "<SCRIPT   LANGUAGE='javascript'>alert('There is binding problem in child grid.');</script>");  
            }  
        }  
    }  

Examples related to asp.net

RegisterStartupScript from code behind not working when Update Panel is used You must add a reference to assembly 'netstandard, Version=2.0.0.0 No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization How to use log4net in Asp.net core 2.0 Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state How to create roles in ASP.NET Core and assign them to users? How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause() ASP.NET Core Web API Authentication Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0 WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery

Examples related to .net

You must add a reference to assembly 'netstandard, Version=2.0.0.0 How to use Bootstrap 4 in ASP.NET Core No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization .net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible Update .NET web service to use TLS 1.2 EF Core add-migration Build Failed What is the difference between .NET Core and .NET Standard Class Library project types? Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies Nuget connection attempt failed "Unable to load the service index for source" Token based authentication in Web API without any user interface

Examples related to data-binding

Angular 2 Checkbox Two Way Data Binding Get user input from textarea Launch an event when checking a checkbox in Angular2 Angular 2 two way binding using ngModel is not working Binding ComboBox SelectedItem using MVVM Implement Validation for WPF TextBoxes Use StringFormat to add a string to a WPF XAML binding how to bind datatable to datagridview in c# How to format number of decimal places in wpf using style/template? AngularJS - Binding radio buttons to models with boolean values

Examples related to gridview

Simple Android grid example using RecyclerView with GridLayoutManager (like the old GridView) Android Recyclerview GridLayoutManager column spacing Get the cell value of a GridView row add new row in gridview after binding C#, ASP.net Check if list is empty in C# How to refresh Gridview after pressed a button in asp.net Putting GridView data in a DataTable How to get row data by clicking a button in a row in an ASP.NET gridview Change header text of columns in a GridView Twitter Bootstrap and ASP.NET GridView

Examples related to exception-handling

Catching FULL exception message Spring Resttemplate exception handling How to get exception message in Python properly Spring Boot REST service exception handling java.net.BindException: Address already in use: JVM_Bind <null>:80 Python FileNotFound The process cannot access the file because it is being used by another process (File is created but contains nothing) Java 8: Lambda-Streams, Filter by Method with Exception Laravel view not found exception How to efficiently use try...catch blocks in PHP