Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
Finding Visible Rows with WebDataGrid
posted

Hi,

I have bound datasource to the DataWebGrid, In which i have more than 15 columns and i want to display only 10 columns, How to do that in code behind.I need to make the visibility  of column at runtime

And also i need to find the Visible Rows, 

foreach(GridRecord item in WebGrid.Rows)

{

if(item.Hidden == false) 

}

Item.Hidden property is not there in GridRecord.

Thanks & Regards,

Developer

Parents
No Data
Reply
  • 18204
    Offline posted

    Hello Tanya,

     

    Thank you for posting in our forums!

    To hide your columns, you will need to access the GridField objects.  You can access the columns through the WebGrid.Columns collection.  Each GridField (column) has a Hidden property that can be used to hide the column.  Please see our documentation for this property below:

    http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=Infragistics4.Web.v14.1~Infragistics.Web.UI.GridControls.ControlDataField~Hidden.html

    Please note, if you have AutoGenerateColumns set to true, you will not be able to use the WebGrid.Columns collection.  In this case, you should access the columns through a databound row.  i.e. WebGrid.Rows[0].Items[0].Column.Hidden.

    As for finding visible rows; rows are not able to be hidden with a property.  All rows that are bound to the grid should always be visible.  Are you referring to finding rows that have been filtered out or that exist on another page?

    If you need any further assistance with this, please let me know.

Children