We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date


How to hide specific column by index?
in vb.net code behind.

1 Reply

MS Mani Sankar Durai Syncfusion Team July 7, 2016 11:48 AM UTC

Hi Hrvoje, 

We have analyzed your query and achieved your requirement, hiding the columns based on the index. For instance we have passed the index value of column which has been entered in the textbox and passing the value to serverside (code behind) and making the columns visibility as false. 
For your convenience please refer the below code example, 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 
<input type="text" id="txtName" name="Name" value="" /> 
  <asp:Button Text="Submit" runat="server" OnClick="Submit" /> 
Protected Sub Submit(sender As Object, e As EventArgs) 
        Dim value As Int16 = Request.Form("Name") 
        Grid1.Columns(value).Visible = False   //Grid1 is the ID of grid 
    End Sub 

For your kind information, in grid by inbuilt we have Column chooser feature that contains the list of all the columns which are defined in the Columns property. Using this you can control the visibility of columns in Grid. Please refer the below documentation and online sample link, 

We have also prepared a sample that can be downloaded from the below link, 

Manisankar Durai. 


Live Chat Icon For mobile
Up arrow icon