I have gridweb which I allow users to enter data within it. I then loop through the rows and compare
the value in gridweb worksheet against entries contained within a separate datatable.I do this via this code:
DataRow result = dtPI.Select(“partCode = '” + row[“Item Number”].ToString()“’”);
This works ok if the user types the values in. If however the data is copied in, even when
its identifical the Select method on the data table fails and does not return
If you then manually type the the same value in underneath it then it works fine. Am I missing something obvious regarding the pasting of data into a gridweb control?
Where do you place DataTable.Select() method (i.e., your line of code) to filter data). If you are using an ASP.NET button, you need to sink events for the button’s click, see the sample line of code (in bold) below:
Page_Load(object sender, EventArgs e)
//if first visit this page clear GridWeb1
Button1.Attributes[“onclick”] = “GridWeb1.updateData(); return GridWeb1.validateAll();”;
Thanks for the suggestion, I eventually fixed it by changing the code to this:
DataRow result = dtPI.Select("partCode = '" + row["Item Number"].ToString() + "'");DataRow result = dtPI.Select("partCode = '" + row["Item Number"].ToString().Trim() + "'");<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your feedback and using Aspose.Cells.
It is good to know that you were able to sort out this issue. Let us know if you encounter any other issue, we will be glad to look into it and help you further.