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

Find DetailTable Columns

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 26 Mar 2009, 02:01 PM
I am using Rad Controls 2008 Q3, Visual Studio 2008, C#, and .netFramework 3.5.

I have two issues:

I have a MasterTableView and a DetailTables with two tables.  I need to display or hide the Delete and Edit columns programmatically based on a user's security.  For example, I have set the ID property for the telerik:radgrid control to G.  I can control the columns in the MasterTableView with G.Columns.FindUniqueName("MasterEdit").Visible.  However, when I try to access the DetailTables columns as G.Columns.FindUniqueName("Detail1Edit").Visible, I get the following error: Cannot find column with UniqueName 'Detail1Edit'.   How do I access the columns in the DetailTables programmatically?

I also have the requirement to display or hide the "Expansion" icon that expands the grid to display the the DetailTables, also based on a user's security.  Is there a way to programmatically display/hide this button?


Thank you,
Jack

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Mar 2009, 06:51 AM
Hi Jack

You are getting the error since you are trying to access the detail table column from the master table view. You need to first access the detail table using its name property and then hide the column using the above logic. You can refer the following link to distinguish between the master and detail table.

Distinguish grid rows in hierarchy on ItemCreated/ItemDataBound

Thanks,

Shinu.


Tags
Grid
Asked by
Jack
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or