﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Thu, 04 Feb 2010 21:23:03 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Scott,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Would you kindly run the sample that I attached ? In that sample, I am using Customer Northwind database. What you can do is, try to copy the whole row and paste it again using "Paste Multiple Rows from Clipboard". In here, I make a validation that every city that equals to London will have a red highlight in their cell.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; I hope it helps and please do not hesitate to ask if you have any other question. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Thu, 04 Feb 2010 19:46:09 GMT</pubDate><dc:creator>sfrench@sierradata.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;Hi Andi,&lt;/p&gt;
&lt;p&gt;Imagine this situation. A user visits the page in order to post 50 very similar looking rows that have been stored in a spreadsheet. They will copy these rows then paste them into the grid. Here is our problem, we do not want the grid to drop rows with bad values because it may be very hard to tell which rows have been dropped. If the user pastes 50 rows but only 30 show up in the grid how are they to know which rows contained the bad values? How will they know which cells within the row require correction? We want the rows to be inserted into the grid but have any bad cell values highlighted. We know how to do our own validation, we know how to blank out the bad cells values, we know how to prevent the row from being inserted. We just have no way to keep the row and mark the bad values. Without this functionality we really can't move forward with this setup. Please let me know about marking these cells that contain bad data.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Scott French&lt;/p&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Wed, 03 Feb 2010 21:41:58 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Scoot,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Actually, we do have a method to prevent invalid data insertion. Here are the sample code that will prevent data insertion to pending changes if it meets its validation. You can put this code in client side OnAddPendingChanges event.&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;if (rowChange.Data[1].NewValue == "Value")
{
   //If it is true, it will undo the changes
   setTimeout(function() {rowChange.Row.UndoChanges();},200);
}&lt;/pre&gt;
&lt;p&gt;    &lt;span style="font-size: 9pt; "&gt; I hope it helps and please let me know if you have any other questions. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Tue, 02 Feb 2010 22:35:52 GMT</pubDate><dc:creator>sfrench@sierradata.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;Hi Andi,&lt;/p&gt;
&lt;p&gt;We aren't having any trouble getting the values and performing our own validation at the cell level. The problem is once we find out a value is incorrect we have no way to mark the cell or row visually to let the user know a change is required. The other issue that needs to be dealt with eventually is why these incorrect values are allowed to be inserted at all... the rules setup by at the column level should stand as Dan stated in his original post. For now we need some kind of method to mark the values we have tested in our own custom code as invalid. Our testing shows there is no row index or cell index provided for any of the rows are created when a multi-row paste function is performed. That means we couldn't use the code you provided that updated the HTML elements. Now you've confirmed the style element doesn't exist for these mulit-paste rows. Are there any options left for marking these invalid cells?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Scott French&lt;/p&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Tue, 02 Feb 2010 21:49:40 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Scott,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Yes, unfortunately using OnAddPendingChanges's 'rowChange' attribute does not support of style property, that is why on my previous code, I was using an element to get the style of particular row and cell. The best workaround, I believe, is by adding validation for each cell. You can get the value of the changed row by using this following code:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&lt;span style="font-size: 9pt; "&gt;rowChange.Row.GetCells().GetNamedItem("Field1").Get("Value") == "ValidationValue"&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; I hope it can help and please do not hesitate to ask if you have any other questions. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Tue, 02 Feb 2010 14:20:08 GMT</pubDate><dc:creator>sfrench@sierradata.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Hi Andi,&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Dan is in meetings today but we wanted to get back to you. We've taken the code you provided and tried to implement it. The problem is we do not know what row/cell indexes we will need to adjust ahead of time. We are doing our validation in the 'OnAddPendingChanges' client side event. We can only access the row using the 'rowChanges' variable. We tried to implement your code using the index values from 'rowChanges' but it is not possible. The cell index does not exist for these cells and these rows always have a position of 0. We tried to assign the style changes directly using rowChanges.Row.Cells.GetNamedItem('CellName').style.backgroundColor = "Red"; but the style attribute does not exist for these pending changes rows, neither does the cellElement attribute. There doesn't seem to be any way to get the index or change the style using OnAddPendingChanges's 'rowChange' attribute. If we are missing something in here please let us know.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;p&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Thanks,&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Scott French&lt;/span&gt;&lt;/p&gt;&lt;/p&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Tue, 02 Feb 2010 04:08:26 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Dan,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Forgive me for the misunderstanding the situation. I am understand now. Here is the sample code to change the background color of the pending changes on WebGrid. However, before do so, on BatchUpDateSetting, you will need to set HighlightChanges="false".&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;setTimeout(function() { ISGetObject("WebGrid1").RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE).rows[19].cells[2].style.backgroundColor = "Red"; }, 200)&lt;span style="font-family: 'lucida sans unicode'; white-space: normal; font-size: 9pt; "&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p&gt;     &lt;span style="font-size: 9pt; "&gt;On that code, I go to the last row of WebGrid, which is the 19th rows and get the second cell to change the background color into red.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;I hope it helps and please let me know if you have any other questions. Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Mon, 01 Feb 2010 11:55:04 GMT</pubDate><dc:creator>danjransom@gmail.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;*Edit: Finally got the video to run, but it was hard to find a player that would open it . . .&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 12pt"&gt;You still do not understand the problem!&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In your video you are just pasting into the add row at the top of the grid. Yes, this applies validation. However, you are actually just pasting a single row - even though you have two rows copied.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Follow the exact steps you showed in the video, but when you are ready to paste - do not right-click in the add row.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Instead, right-click on one of the existing rows. You should see a much larger context menu, including options like "Copy Row" and "Copy Table". The option you want to use is clearly labelled, "Paste Multiple Rows from Clipboard". This is where the problem lies. I've attached a screenshot.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Mon, 01 Feb 2010 03:56:05 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Dan,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Here, I provide a video attachment and you can download it in&amp;nbsp;&lt;a href="http://www.intersoftpt.com/tdn/downloads/CopyPasteValidation.zip" target="_blank"&gt;here&lt;/a&gt;. Would you kindly take a look and correct me if we are not in the same page? I hope it helps and thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Sun, 31 Jan 2010 23:27:22 GMT</pubDate><dc:creator>danjransom@gmail.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;I think you are failing completely to understand the problem with the multi row paste. Here are the steps to replicate:&lt;/p&gt;
&lt;p&gt;1. Open up the sample page you noted above. &lt;strong&gt;NOTE that the "Summary" column is required and that the "Duplicate" column accepts number only.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;2. Right click in the grid and select the option "Copy this table"&lt;/p&gt;
&lt;p&gt;3. Open up a spreadsheet program, such as Excel, and paste the the contents of the table.&lt;/p&gt;
&lt;p&gt;4.  In Excel, change the value for one of the rows in the "Duplicate" column to the text: "this is not a number"&lt;/p&gt;
&lt;p&gt;5. In Excel, in a different row, clear out all text in the "Summary" column.&lt;/p&gt;
&lt;p&gt;6. In Excel select and copy all of the data rows. Here is a sample of data to copy:&lt;/p&gt;
&lt;p&gt;&lt;table width="512" style="width: 384pt; border-collapse: collapse" border="0" cellspacing="0" cellpadding="0"&gt;&lt;colgroup&gt;&lt;col width="64" style="width: 48pt" span="8" /&gt;&lt;/colgroup&gt;
&lt;tbody&gt;&lt;tr height="20" style="height: 15pt"&gt;
&lt;td width="64" height="20" align="right" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; width: 48pt; height: 15pt; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;9309&lt;/span&gt;&lt;/td&gt;
&lt;td width="64" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; width: 48pt; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;Filters&lt;/span&gt;&lt;/td&gt;
&lt;td width="64" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; width: 48pt; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;this is not a number&lt;/span&gt;&lt;/td&gt;
&lt;td width="64" align="right" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; width: 48pt; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;3&lt;/span&gt;&lt;/td&gt;
&lt;td width="128" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; width: 96pt; border-top: #f0f0f0; border-right: #f0f0f0; mso-ignore: colspan" colspan="2"&gt;&lt;span style="font-family: calibri"&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;enhancement&lt;/span&gt;&lt;/td&gt;
&lt;td width="64" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; width: 48pt; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;Future&lt;/span&gt;&lt;/td&gt;
&lt;td width="64" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; width: 48pt; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;option to have attachments auto saved to chosen location&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr height="20" style="height: 15pt"&gt;
&lt;td height="20" align="right" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; height: 15pt; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;12460&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;Selection&lt;/span&gt;&lt;/td&gt;
&lt;td align="right" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;33&lt;/span&gt;&lt;/td&gt;
&lt;td align="right" style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;1&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;blocker&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;span style="font-family: calibri"&gt;Future&lt;/span&gt;&lt;/td&gt;
&lt;td style="border-bottom: #f0f0f0; border-left: #f0f0f0; background-color: transparent; border-top: #f0f0f0; border-right: #f0f0f0"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;7. Back in the sample page, right click in the grid and select the option "Paste Multiple Rows from Clipboard".&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note that there is non-numeric content in one of the rows for the "Duplicate" column and that there is an empty value in the "Summary" column for another row.&lt;/strong&gt; There is no indication presented to the user that any particular pasted rows have bad cells or, better yet, which specific cells are bad.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We need to present to the user an indication that some of the&amp;nbsp;pasted data is invalid - preferably by highlighting the cells or rows&amp;nbsp;in question.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Multiple Row Paste Validation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Multiple-Row-Paste-Validation/</link><pubDate>Thu, 28 Jan 2010 23:00:50 GMT</pubDate><dc:creator>danjransom@gmail.com</dc:creator><category>validate</category><category>grid</category><category>rows</category><category>paste</category><description>&lt;p&gt;The "Paste Multiple Rows from Clipboard" feature sounds great in theory, but in practice we are finding it impossible to implement in a real-world scenario. &lt;strong&gt;As far as we can tell, there is no way to highlight bad data inserted into the grid when using this feature.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For example: we have a grid with a mix of numeric, date, text, and valuelist (dropdown) columns. Some of the fields are set to require input. When users enter data in the new row at the top of the grid all of the cells are validated ensuring good values. However, using the "Paste Multiple Rows from Clipboard" feature,&lt;strong&gt; users can put in values that are in no way valid&lt;/strong&gt;, i.e. text in a date field, dates in a numeric field, value list items that are not in the list, and &lt;strong&gt;even&amp;nbsp;NULL values in a required field&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Despite the extremely limited amount of documentation on this feature, we have been able to apply some of our own validation using the &lt;span style="font-size: 13px"&gt;OnAddPendingChanges client event. However, even though we can blank out celss&amp;nbsp;or apply default values to the added fields, we can find no way to highlight these bad cells to inform the user of the invalid data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px"&gt;It would be great if we could just run row.Vaidate() or row.GetElement() but we can't access the rows inserted by the multiple row paste feature using GetRow(#) or any other meathod.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How can we highlight (with color) specific inserted cells to denote bad pasted values?&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>