Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
receiving drag-n-drop from PivotTable field list
I'm able to receive drag-n-drop from the PivotTable field list. However, the
data I get on the drop event is a MemoryStream with 12 bytes. See the code below for an example of the byte array. What is that drop data? How can I interpret it or load it into the appropriate structure or detect which field was dropped? private void txtCalcFormula_DragEnter(object sender, DragEventArgs e) { e.Effect = DragDropEffects.All; } private void txtCalcFormula_DragDrop(object sender, DragEventArgs e) { try { e.Effect = DragDropEffects.All; if (e.Data is System.Windows.Forms.DataObject) { string sFormat = "Excel_Pivot_Table_Fieldlist_Format"; DataObject dataObj = (DataObject)e.Data; if (e.Data.GetDataPresent(sFormat)) { //receives a MemoryStream which is 12 bytes similar to: //4 144 97 9 215 0 0 0 228 60 0 0 System.IO.MemoryStream stream = e.Data.GetData(sFormat) as System.IO.MemoryStream; StringBuilder sb = new StringBuilder(); foreach (byte b in stream.ToArray()) { sb.Append((int)b).Append(" "); } stream.Close(); MessageBox.Show(sb.ToString()); } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } } |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot ... Drag Multiple Fields from Field List? | Excel Discussion (Misc queries) | |||
PivotTable Field Value List Update | Excel Discussion (Misc queries) | |||
Corresponding Data From PivotTable Field List | Excel Programming | |||
Drag and Drop from List to Tree View | Excel Programming | |||
Can I alphabetize a PivotTable Field List? | Excel Discussion (Misc queries) |