This is a migrated thread and some comments may be shown as answers.

RadGrid display none column sets successors to display none

3 Answers 402 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Remi
Top achievements
Rank 2
Remi asked on 18 Sep 2009, 02:25 PM
Hello,

I'm having issues with the RadGrid. I'm loading data in a Grid and at times, certain columns need to be hidden dynamically.

For example, the user selects such by "A" and we want to hide a column because that data is not related to search "A" but the rest of the columns are.

The issue is when the hidden column, using display none (because you may want to interact with the column still; javascript, print, etc.), has successors (columns that follow) everything gets hidden.

For example, a grid has columns A, B, C, D. You set column "B" to be display none via C# in the code behind of an aspx page and now columns B, C, D disappear as well. Think of it as the display none property / setting of column B cascades through columns C and D.

Is this a bug and if so is there a plan to resolve it in the next release?

Thanks, assistance is appreciated.

3 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 18 Sep 2009, 02:35 PM
I currently have a RadGrid implementation that hides/displays single grid columns frequently and this is working for me:
 
RadGrid1.MasterTableView.GetColumn("columnName").Display = true
//or 
RadGrid1.MasterTableView.GetColumn("columnName").Display = false

I'm not sure if when you reference to display none you are indeed setting .Display = false or not, but this works for me :)
0
Remi
Top achievements
Rank 2
answered on 18 Sep 2009, 03:52 PM
Hello, thanks for the assitance. We have tried your suggestion and are still experiencing the same issue.

Here is a clarification to the issue;  
 

Grid has columns A, B, C, D

if (searchType == "searchTypeA")
    this.RadGridCowListings.MasterTableView.GetColumn("ColumnA").Display = true;
else
    this.RadGridCowListings.MasterTableView.GetColumn("ColumnA").Display = false;

When ColumnA is Display = false ColumnB inherits display = false.

Can you test using this same scenario. Technically you shouldn't need to specify a search type, just hard coding the values should achieve the same issue we are facing. Perhaps it's our usage. We've tried several different ways and are finding the same result.

Any assistance is appreciated. Thank you for the code example.



0
Schlurk
Top achievements
Rank 2
answered on 18 Sep 2009, 04:22 PM
That is very odd. Like I said, the code that I posted works for me - a single column becomes hidden and no other columns are affected. It could perhaps be your implementation - you're not using this in a loop or anything like that? You could try having a new page with your basic grid and no client or server-side functions. Then in the page load you could set this:

    protected void Page_Load(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.GetColumn("name").Display = !RadGrid1.MasterTableView.GetColumn("name").Display; 
    } 

This would let you see if any RadGrid would create this behavior on your end since the column will be visible or invisible on every page load.
Tags
Grid
Asked by
Remi
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Remi
Top achievements
Rank 2
Share this question
or