AD
Administrator
Syncfusion Team
January 12, 2007 11:17 AM UTC
Hi Leema,
I think the record you are trying to delete is not there in the underlying datasource. Please try this code to delete the record from grid.
int rowIndex = 1;
if( this.gridDataBoundGrid1.Model.RowCount -1 > rowIndex )
this.gridDataBoundGrid1.DeleteRecordsAtRowIndex(rowIndex,rowIndex);
Best Regards,
Haneef
AD
Administrator
Syncfusion Team
January 12, 2007 11:30 AM UTC
Hi,
Error is coming in "PrepareViewStyleInfo", When i delete.
In "PrepareViewStyleInfo" i have written like this. My grid display is in multiline view [1 datarow equal 2 lines in grid ]
CurrencyManager cm = (CurrencyManager)this.BindingContext[this.DataSource];
CLIBidSheet aBidSheet = (CLIBidSheet)(cm.List);
CLIBidItem dr = (CLIBidItem)aBidSheet[((e.RowIndex-2) / 2)];
can you suggest me a solution.
AD
Administrator
Syncfusion Team
January 12, 2007 11:47 AM UTC
Hi Leema,
Could you please use this code snippet to access the CLIBidItem from CLIBidSheet in a PrepareViewStyleInfo event.
CurrencyManager cm = (CurrencyManager)this.BindingContext[this.DataSource];
CLIBidSheet aBidSheet = (CLIBidSheet)(cm.List);
int index = (int)((e.RowIndex-2) / 2);
if( index >= 0 && index < cm.List.Count)
{
CLIBidItem dr = (CLIBidItem)aBidSheet[index];
//Your related code here
}
Let me know if this helps.
Best Regards,
Haneef
AD
Administrator
Syncfusion Team
January 12, 2007 12:06 PM UTC
Thanks,
Its working.