• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

Wingrid cell text copying to another cell..but it comes with column names also.

HI,
 I am using wingrid, and i diplayed a table information in that grid. In that when ever i selects one cell text..and then trying to copy that information into the another cell, it copied with Cell Column name also. I want only the cell text, not with column name.

e.Layout.Override.CellClickAction = CellClickAction.CellSelect;

i am using this property in Intialize row event.

And i am using Ctrl+c and Ctrl+v keyborad operations for copying and pasting. I am providng code for this..plz check this once..and give me advice.
Plz help on this.
private void FormulaGrid_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                switch (e.KeyCode)
                {
                    case Keys.C:
 
                        if (e.Control == true)
                        {
                            if (FormulaGrid.Selected.Cells.Count == 1)
                            {
                                System.Windows.Forms.Clipboard.SetText(this.FormulaGrid.Selected.Cells[0].Value.ToString());
                            }
                        }
                        break;
 
                    case Keys.V:
 
                        if (e.Control == true)
                        {
                            if (FormulaGrid.Selected.Cells.Count > 0)
                            {
                                foreach (Infragistics.Win.UltraWinGrid.UltraGridCell cell in this.FormulaGrid.Selected.Cells)
                                {
                                    cell.Value = System.Windows.Forms.Clipboard.GetText();
                                }
                            }
                        }
                        break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

Open in new window

0
raghu_apps
Asked:
raghu_apps
1 Solution
 
MogalManicCommented:
If you are using a DataGridView you can set the property ClipboardCopyMode to:
public enum DataGridViewClipboardCopyMode
{
    Disable,
    EnableWithAutoHeaderText,
    EnableWithoutHeaderText,
    EnableAlwaysIncludeHeaderText
}

 

 

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now