Hi, I have a small project in c# to Paste from ClipBoard to DataGridview. In that areas, I need to convert the below
codes, which is very confusion..
Thanks for the helpsCode:private Dictionary<int, Dictionary<int, string>> ClipBoardValues(string clipboardValue) { Dictionary<int, Dictionary<int, string>> copyValues = new Dictionary<int, Dictionary<int, string>>(); String[] lines = clipboardValue.Split('\n'); for (int i = 0; i <= lines.Length - 1; i++) { copyValues[i] = new Dictionary<int, string>(); String[] lineContent = lines[i].Split('\t'); //if an empty cell value copied, then set the dictionary with an empty string //else Set value to dictionary if (lineContent.Length == 0) copyValues[i][0] = string.Empty; else { for (int j = 0; j <= lineContent.Length - 1; j++) copyValues[i][j] = lineContent[j]; } } return copyValues; }
Thanks Again




Reply With Quote
