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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hide

Thread ID:

Created:

Updated:

Platform:

Replies:

124889 Jul 6,2016 11:54 AM UTC Jul 7,2016 11:48 AM UTC ASP.NET Web Forms 1
loading
Tags: Grid
Hrvoje Voda
Asked On July 6, 2016 11:54 AM UTC

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

Mani Sankar Durai [Syncfusion]
Replied On 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, 
[GridFeatures.cshtml] 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 
 
<input type="text" id="txtName" name="Name" value="" /> 
  <asp:Button Text="Submit" runat="server" OnClick="Submit" /> 
 
[GridFeatures.aspx.vb] 
 
 
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, 

Regards, 
Manisankar Durai. 

 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;