Completed
Last Updated: 16 Oct 2015 06:49 by ADMIN
ADMIN
Hristo
Created on: 16 Sep 2015 09:53
Category: GridView
Type: Bug Report
1
FIX. RadGridView - data exception when the grid is in hierarchy and Entity Framework is used. The exception is raised for some templates having no data and on the same child level when the AddNewRowPo
Workaround
this.radGridView1.Templates["MyEmptyTemplate"]..AddNewRowPosition = SystemRowPosition.Top

Then handle the ViewCellFormatting event and get notifications when the hierarchy tabs are being clicked.
private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
	GridDetailViewCellElement detailCell = e.CellElement as GridDetailViewCellElement;
	if (detailCell != null) {
		detailCell.PageViewElement.ItemSelected -= PageViewElement_ItemSelected;
		detailCell.PageViewElement.ItemSelected += PageViewElement_ItemSelected;
	}
}

private void PageViewElement_ItemSelected(object sender, RadPageViewItemSelectedEventArgs e)
{
	if (e.SelectedItem.Text == "MyEmptyTemplate") {
		this.SetsGridViewTemplate.AddNewRowPosition = SystemRowPosition.Bottom;
	}
}

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments