|
Article relates to
|
RadGridView for WinForms, Q2 2010
|
|
Created by
|
Nikolay Diyanov
|
|
Last modified
|
July 27, 2010
|
|
Last modified by
|
Alexander Georgiev, Telerik
|
INTRODUCTION
When RadGridView displays hierarchical data, you expand/collapse child levels in the hierarchy with the help of GridGroupExpanderCellElement containing an expand/collapse image. However, when you do not have child data for certain rows, you may not want to show the expand/collapse images in the GridGroupExpanderCellElement.
SOLUTION
First of all, we will create a method which returns
true if there is child data and
false if there is no child data for a parent row:
Next, we will subscribe to the
ViewCellFormatting and ChildViewExpanding events of RadGridView. In ViewCellFormatting we will hide the expand/collapse image while in the ChildViewExpanding we will prevent a row from being expanded if there is no child data:
Please
Sign In
to rate this article.