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
Hi Mike,
I have already mentioned that I am using VS2010, Infragistics 10.2 in earlier posts.
I saw the sample sent by you, which does not give error.
Some change was required in the code itself.
1. To ultra grid, the dataset containing valid values was assigned which has white spaces at the end of string. When I export the data from grid to excel, the spaces remained untouched but while pasting it from excel to grid, the spaces trimmed. I trimmed the values copied it in a list if string and attached the list as data source.
2. The data type of column is set to string.
This resolved my problem. Please check attached sample to reproduce the behavior. Copy first row and paste on second row.
Hi,
It's very hard to build a project out of a code snippet like this - there's too much missing information like what version of Visual Studio you are using and what version of the controls.
So I created a small test project of my own to try this out and it works just fine for me. I am attaching my test project here.
All I did was run it, select the text in the TextBox ("Grape") and press CTRL+C to copy it. Then I clicked on a cell in Column 1 of the grid and pressed CTRL+V and it works.
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;
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?
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