Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

GridViewTemplate

$
0
0
Hello Bill,

Thank you for writing.

I suppose that you use the RowSourceNeeded event. This event is used in load on demand approach. Hence, data will be loaded when it is requested, e.g. click the expander item in the parent row. If no data is available for the child template only one row will be displayed: the new row. However, if you set the GridViewTemplate.AllowAddNewRow property to false, there would be none rows for rendering. As a result the child template is not displayed at all because it is supposed to be empty. In order to display the empty template showing only the columns, you can set the AllowAddNewRow property to true and hide the new row in the ViewCellFormatting event:
private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.Row.HierarchyLevel > 0 && e.Row is GridViewNewRowInfo)
    {
        e.Row.Height = 1;
    }
}

If it does not suite your requirement it would be greatly appreciated if you provide a sample code snippet which produces the undesired result. Thus, we would be able to investigate the precise case.

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 94857

Trending Articles