Tutorial :infragistics ultragrid pasting from excel


I'm using infragistics net advantage for .net framework. I have a really weird error with their ultragrid. I will try to explain it:

On my ultragrid I have 5 columns. I am trying to paste 11 rows and 5 columns from Excel. If I leave entries in cells empty of the LAST column and the row BELOW row 6 (i.e rows 7-11) I get the following error:

Error performing Paste operation. Further information: Object reference not set to an instance of an object.

Continue with the remainig cells?

It throws this error 5 more times (number of the remainig rows). Then it thows another error:

Error performing Paste operation. Further information: Invalid selection. The selection must berectangular

However it actually perform the pasting itself. The funny thing is, if I enter something into ANY of those cells it works.

Moreover, this error is thrown ONLY if i'm pasting more than 6 rows :))

I have no idea what's going on. So any help would be appreciated

Thanks, Marat


Together with the paste operation void ContextPaste_Click(object sender, System.EventArgs e) you have to use event _AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) of ulragrid and here create objects and bind it to that list which is used as a DataSource for Ultragrid.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »