Hi Mr. Haneef
I have made the changes that you have suggested to me, but the same problem still persists. Would you please try running this solution on your machine? I hope that you will get to the problem and suggest me the proper solution.
Regards
Mirza Imran Nazir
>Hi,
The reason is that GridData.RowCount property is not set properly in a grid. You can use this code snippet to set Data.RowCount property.
void Grid_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
try
{
if (e.RowIndex != -1 && e.ColIndex != -1)
{
RowObject currentRowObject = (RowObject)((VirtualDataSource)Grid.Tag).RowObjects[e.RowIndex - 1];
string textToSave = e.Style.Text;
((RowElement)currentRowObject.RowElements[e.ColIndex - 1]).RowElementData = textToSave;
if (textToSave == "OR" || textToSave == "AND")
{
this.gridDataSource.AddNewRowObject();
this.Grid.ResetVolatileData();
this.Grid.Data.RowCount = ((VirtualDataSource)Grid.Tag).RowCount;
this.Grid.RefreshRange(GridRangeInfo.Row(e.RowIndex + 1));
}
}
}
catch (Exception ex)
{
throw ex;
}
}
Here is a modified sample.
VirtualGridDemo.rarBest Regards,
Haneef
VirtualGridDemo0.zip