Hi all,
In my ultrawingrid I turned on AllowMultiCellOperation, and have am having trouble copying/pasting rows. The cols that are really just text paste in just fine. But 3 of my cols are int valued, with text displayed to the user. When the paste operation gets to these cols, I receive the error:
"Error performing Paste operation. Further information: Unable to convert the value [displayedtexttouser] to the column's data type: Illegal data value. Continue with the remaining cells?"
Is there a way I can get the row Copy process to copy the value, and not the display text? Or from the other end: is there a way I can get the Paste process to internally translate the display text into the int values of the column?
Thanks for any suggestions,
cdj
If the copy and paste are working inconsistently like that, then it's a bug. I'm pretty sure something like this was recently fixed, though. Are you using the latest Service Release?
Hi Mike,
I am using version 8.3.20083.1009 and have a similar problem ie I'm attempting to paste data from Excel into a grid that uses ValueLists (from ultrawindropdown controls) to display text but stores numerical values, and Excel only has the text available.
I have narrowed the problem down a bit. It seems that if Excel has a number or date formatted as text, somewhere between when it is copied and pasted into the grid, it is being re-formatted as number or date, and, as the grid is expecting text, a paste error occurs.
The fact that ValueLists are being used doesn't seem to be a factor.
Is there a way to interrupt the paste routine to ensure that correct datatypes will be used?
Thanks,
Richard
Hi Richard,
If the grid's are appearing in the component tray, it means that Visual Studio can't find the grid's Design assembly. Make sure your application does not have a reference to Infragistics2.Win.Design.
You might also want to check and make sure the project references are all correct and that your project isn't referencing other versions of the assemblies - in the licx file, for example.
Hi,
I am using net adv 10.2 service release, with net 4.0 (c#)
Its gives me the same error when i paste string data from excel to grid, the columns which have value list assigned to them, it gives error for them.
The values being pasted are valid values still it gives me the data type error.
some more details about my problem - add column with string datatype , the style is Drop dwon list, the style is Drop dwon list, try pasting valid values from excel to that column in ultragrid
The paste functionality in the grid will act as though the user is typing into the cell. So if you copy a value from some other application, such as Excel, the text that is pasted into the grid cell has to be valid as though the user is entering it. In the case of a DropDownList cell, the text would have to match an item in the DisplayMember field of the dropdown. Are you attempting to paste the DisplayText into the grid or the DataValue?
I beleive that only the DisplayText will work and DataValue will result in an error. But I could be wrong.
If that does not help, can you post a small sample project demonstrating the behavior you are seeing?
Thanks Mike for the quick reply.
Please find below my code to bind ultra drop down to ultra grid column.
I am just setting the data binding to dropdown, so i think i am trying to paste display test.
Can you please go through the code and point of problem if any?
Also, please suggest if there is some better way to bind data set to ultra drom down.
private void gridSelectionRules_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
foreach (UltraGridColumn column in this.gridSelectionRules.DisplayLayout.Bands[0].Columns)
if (column.EditorComponent == null)
UltraDropDown dropDown = new UltraDropDown();
DataSet valueSet = GetValidValues(column.Key);// some function that returns me dataset with valid values.
if (valueSet != null)
dropDown.SetDataBinding(valueSet, null);
}
if (dropDown.DataSource != null)
column.ValueList = dropDown;
column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
I have not looked at this issue since my last reply, since no one replied with the information I needed.
Are you using DropDownList style? If there an item on the list with no DisplayText?
Did you get chance to look into the copy paste issue when the string.empty is valid value for a column?
Please reply asap. I am stuck with this.
Is there an item on the list with no DisplayText so the user can select an empty item? If not, then this will not be possible. In DropDownList style, only values that exist on the list are valid.
I am stuck with a small copy paste issue in UltraGrid.
For a column in ultra grid whose ValueList is UltraDropDown, its datatype is string, and the default value is string.empty.
The valid values for column are say "" and "ABC", when i copy row with "ABC", the paste does not give any error.
When i copy row with "" , and paste a row, it gives me error for that column as "Unable to convert the value ' ' to the column's data type: Illegal data value"
Can u please help with this.
I am using .net 4.0 and net advantage 2010.2.
Okay, that all makes sense, then. The text you were trying to paste into the cell was not matching the text of the items on the list because of the trailing spaces.