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

Conditional display of Command item

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 20 Oct 2011, 05:04 PM
Hi All, I've a grid with self-referencing hierarchy. I can put the 'add new record' bar at the top of each table thus:

<MasterTableView CommandItemDisplay="Top">

However, I'd only like to display the bar for the top 2 levels and not any deeper levels. How could I do this. Thanks!

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Oct 2011, 08:12 AM
Hello Julian,

One suggestion is to set the commandItemDisplay as none from aspx and set it as true for the first two levels. Here is the sample code.

C#:
protected void Page_Load(object sender, EventArgs e)
{
  RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
  GridTableView detailtb = RadGrid1.MasterTableView.DetailTables[0];
  detailtb .CommandItemDisplay = GridCommandItemDisplay.Top;
}

Thanks,
Princy.
Tags
Grid
Asked by
Julian
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or