|
|
A List box has a property called "Opacity",which you can set to a value between 0 and 100 to make your listbox transparent.
Veni, vidi, caecus
|
|
|
|
|
thanks guys.
i find a transparent class in you tube but List box dont have a SCROLL.
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
public class ListBox : Label
{
public ListBox()
{
this.Size = new Size(165, 124);
this.MinimumSize = new Size(25, 25);
this.ForeColor = SystemColors.Highlight;
this.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 0);
this.ScrollAlwaysVisible = true;
}
#region Storage
List<object> lst = new List<object>();
Color SBorCol = Color.DarkBlue, SelCol = Color.DodgerBlue, BorCol = Color.Navy, InBorCol = Color.SlateBlue;
string tmp = string.Empty;
byte SelAlpha = 50;
Size FSize;
int _Index = -1, SIndex = 0;
bool _Focus;
#endregion
#region Overrides
protected override void OnFontChanged(EventArgs e)
{
base.OnFontChanged(e);
FSize = TextRenderer.MeasureText("X", this.Font);
}
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
this.AutoSize = false;
this.Text = string.Empty;
this.BackColor = Color.Transparent;
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
if (e.Button == MouseButtons.Left)
{
this.Focus();
_Focus = true;
_Index = -1;
Point P = this.PointToClient(MousePosition);
for (int i = lst.Count; i-- > 0; )
{
if (i < MaxCount)
{
if (P.Y >= (FSize.Height * i) + 5 & P.Y < (FSize.Height * i) + (FSize.Height + 5))
{
this.Refresh();
_Index = i + SIndex;
this.CreateGraphics().FillRectangle(new SolidBrush(Color.FromArgb(SelAlpha, SelCol)), new Rectangle(5, (FSize.Height * i) + 5, this.Width - 12, FSize.Height));
this.CreateGraphics().DrawRectangle(new Pen(SBorCol), new Rectangle(5, (FSize.Height * i) + 5, this.Width - 12, FSize.Height));
}
}
}
}
}
protected override void OnInvalidated(InvalidateEventArgs e)
{
base.OnInvalidated(e);
tmp = string.Empty;
int Co = 0;
for (int i = SIndex; i < lst.Count; i++)
{
if (Co == MaxCount) return;
tmp += lst[i] + "\n";
Co++;
}
}
#endregion
#region Draw
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawRectangle(new Pen(BorCol, 4), new Rectangle(2, 2, this.Width - 5, this.Height - 5));
e.Graphics.DrawRectangle(new Pen(InBorCol, 2), new Rectangle(4, 4, this.Width - 9, this.Height - 9));
TextRenderer.DrawText(e.Graphics, tmp, this.Font, new Point(5, 5), this.ForeColor);
if (_Index != -1)
{
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(SelAlpha, SelCol)), new Rectangle(5, (FSize.Height * (_Index - SIndex)) + 5, this.Width - 12, FSize.Height));
e.Graphics.DrawRectangle(new Pen(SBorCol), new Rectangle(5, (FSize.Height * (_Index - SIndex)) + 5, this.Width - 12, FSize.Height));
}
}
#endregion
#region UserSettings
public Color SelectBorderColor
{
get { return SBorCol; }
set { SBorCol = value; }
}
[Browsable(false)]
public new Color BackColor
{
get { return base.BackColor; }
set { base.BackColor = Color.Transparent; }
}
public Color BorderColor
{
get { return BorCol; }
set { BorCol = value; }
}
public Color BorderColorInner
{
get { return InBorCol; }
set { InBorCol = value; }
}
public Color SelectColor
{
get { return SelCol; }
set { SelCol = value; }
}
public byte SelectAlpha
{
get { return SelAlpha; }
set
{
SelAlpha = value <= 100 ? value : (byte)50;
}
}
#endregion
#region Functions
public void Add(object Value)
{
if (Value == null) return;
int i;
if ((i = lst.IndexOf(Value)) == -1)
{
lst.Add(Value);
}
this.Invalidate();
}
[Browsable(false)]
public int SelectedIndex
{
get { return _Index; }
}
public void RemoveAt(int Index)
{
if (Index != -1 & Index <= lst.Count)
{
lst.RemoveAt(Index);
this.Invalidate();
}
}
public void Remove(object Value)
{
if (Value == null) return;
int i;
if ((i = lst.IndexOf(Value)) != -1)
{
lst.RemoveAt(i);
this.Invalidate();
}
}
public bool Contains(object Value)
{
return lst.Contains(Value);
}
public void Clear()
{
lst.Clear();
this.Invalidate();
}
int MaxCount
{
get
{
return ((this.Height - 8) / FSize.Height);
}
}
[Browsable(false)]
public object SelectedItem
{
get
{
return SelectedIndex != -1 ? lst[_Index] : null;
}
}
#endregion
#region Disabled Settings
[Browsable(false)]
public override string Text { get; set; }
[Browsable(false)]
public override bool AutoSize { get; set; }
[Browsable(false)]
public new BorderStyle BorderStyle { get; set; }
[Browsable(false)]
public new FlatStyle FlatStyle { get; set; }
[Browsable(false)]
public new Image Image { get; set; }
[Browsable(false)]
public new Image ImageAlign { get; set; }
[Browsable(false)]
public new Image ImageIndex { get; set; }
[Browsable(false)]
public new Image ImageKey { get; set; }
[Browsable(false)]
public new Image ImageList { get; set; }
[Browsable(false)]
public new Size MinimumSize { get; set; }
[Browsable(false)]
public new DockStyle Dock { get; set; }
[Browsable(false)]
public new HorizontalAlignment TextAlign { get; set; }
[Browsable(false)]
public new bool UseWaitCursor { get; set; }
#endregion
#region Scroll Code
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
if (_Focus)
{
if (e.Delta > 0)
{
if (SIndex > 0)
SIndex--;
}
else
{
if ((SIndex + MaxCount) >= lst.Count) return;
if (SIndex <= (lst.Count - 1))
SIndex++;
}
this.Refresh();
}
}
protected override void OnMouseEnter(EventArgs e)
{
base.OnMouseEnter(e);
}
protected override void OnMouseLeave(EventArgs e)
{
base.OnMouseLeave(e);
_Focus = false;
}
#endregion
public bool ScrollAlwaysVisible { get; set; }
}
when write the class then click build solution and make new listbox in toolbox,
can help me to set Scroll??????
|
|
|
|
|
hi'
am developing project on hand held system,my view is : select the file(excel)by clicking browse. then click on upload.
here it's going to that device but after receiving data that device needs to send "$OK#" back to my program how can i receive that . plz help how to do tha
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Excel=Microsoft.Office.Interop.Excel;
using System.IO;
using System.Threading;
using System.IO.Ports;
namespace Hand_Held_Data_Transporter
{
public partial class Form1 : Form
{
int[] stream_buffer;
public Form1()
{
InitializeComponent();
progressBar1.Enabled = false;
progressBar2.Enabled = false;
serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(serialPort1_DataReceived);
}
private void Browse_Click(object sender, EventArgs e)
{
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.Filter = "All Files(*.*)|*.*";
if (fdlg.ShowDialog() == DialogResult.OK)
{
textBox1.Text = fdlg.FileName;
File.ReadAllText(textBox1.Text);
}
}
private void Upload_Click(object sender, EventArgs e)
{
Excel.Application xlApp = new Excel.Application();
Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(textBox1.Text, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
Excel._Worksheet xlWorksheet = (Excel._Worksheet)xlWorkbook.Sheets[1];
Excel.Range xlRange = xlWorksheet.UsedRange;
int rowCount = xlRange.Rows.Count;
int colCount = xlRange.Columns.Count;
progressBar1.Visible = true;
int k = 100 / rowCount;
for (int i = 1; i <= rowCount; i++)
{
String final = null;
String upload1 = null, upload2 = null, upload3 = null, upload4 = null, upload5 = null,upload6=null,upload7=null;
for (int j = 1; j <= colCount; j++)
{
if (j == 1)
upload1 = xlRange.Cells[i, j].Value.ToString();
if (j == 2)
upload2 = xlRange.Cells[i, j].Value.ToString();
if (j == 3)
upload3 = xlRange.Cells[i, j].Value.ToString();
if (j == 4)
upload4= xlRange.Cells[i, j].Value.ToString();
if (j == 5)
upload5 = xlRange.Cells[i, j].Value.ToString();
if (j == 6)
upload6= xlRange.Cells[i, j].Value.ToString();
if (j == 7)
upload7 = xlRange.Cells[i, j].Value.ToString();
final = "$ POST," + upload1 + "," + upload2 + "," + upload3 + "," + upload4 + "," + upload5 + "," + upload6 + "," + upload7 + " # ";
}
if (serialPort1.IsOpen)
serialPort1.Write(final);
serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived);
MessageBox.Show(final);
if (progressBar1.Value < 100)
{
Thread.Sleep(1000);
progressBar1.Value += k;
}
}
progressBar1.Value = 100;
}
private void Form1_Load(object sender, EventArgs e)
{
progressBar1.Visible = false;
progressBar2.Visible = false;
serialPort1.Open();
}
private void Download_Click(object sender, EventArgs e)
{
Excel.Application xlApp = default(Excel.Application);
Excel.Workbook xlWorkBook = default(Excel.Workbook);
Excel.Worksheet xlWorkSheet = default(Excel.Worksheet);
serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived);
string fName = @"C:\STL\Download\Download_" + DateTime.Now.ToString("dd MMM YY HH mm").Trim() + ".xls ";
try
{
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
xlWorkSheet.Cells[1, 1] = "Name";
xlWorkSheet.Cells[1, 2] = "ID Number";
xlWorkSheet.Cells[1, 3] = "Installment";
xlWorkSheet.Cells[1, 4] = "Paid Amount";
xlWorkSheet.Cells[1, 5] = "Due Amount";
xlWorkSheet.Cells[1, 1].Interior.ColorIndex = 39;
xlWorkSheet.Cells[1, 2].Interior.ColorIndex = 39;
xlWorkSheet.Cells[1, 3].Interior.ColorIndex = 39;
xlWorkSheet.Cells[1, 4].Interior.ColorIndex = 39;
xlWorkSheet.Cells[1, 5].Interior.ColorIndex = 39;
xlWorkBook.SaveAs(fName, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
releaseObject(xlWorkSheet);
releaseObject(xlWorkBook);
releaseObject(xlApp);
}
finally
{
if (xlApp != null)
releaseObject(xlApp);
if (xlWorkBook != null)
releaseObject(xlWorkBook);
if (xlWorkSheet != null)
releaseObject(xlWorkSheet);
}
if (System.IO.File.Exists(fName))
{
if (MessageBox.Show("Would you like to open the excel file?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
System.Diagnostics.Process.Start(fName);
}
catch (Exception ex)
{
MessageBox.Show("Error opening the excel file." + Environment.NewLine +
ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
private void releaseObject(object obj)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
obj = null;
}
catch (Exception ex)
{
obj = null;
MessageBox.Show("Unable to release the Object " + ex.ToString());
}
finally
{
GC.Collect();
}
}
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
try
{
String inputdata = serialPort1.ReadExisting();
MessageBox.Show(inputdata);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
} t.
|
|
|
|
|
|
I have to create a web app using ASP .Net and C#. Here we use only IE 8, so I can't use HTML5 and CSS 3 to create this app.
I have to show an organizational chart where data is dynamic and the user has to be able to select a card in the chart and delete it, edit it, and more.
I've been trying with treeview, but it's vertical.
Thank you for your answers, and sorry because the english.
|
|
|
|
|
Good Luck!
That's about all I can say as you haven't asked a question.
|
|
|
|
|
|
Hello
How I can find selected control on any window from mouse click c#
I want to snapshot the object when mouse click
thanks
|
|
|
|
|
Try
private void Control_Clicks(object sender, EventArgs e)
{
Control control = (Control)sender;
MessageBox.Show(control.Name.ToString());
}
|
|
|
|
|
see this
IntPtr hWnd = WindowFromPoint(Control.MousePosition);
if (hWnd != IntPtr.Zero)
{
Control ctl = Control.FromHandle(hWnd);
if (ctl != null)
label1.Text = ctl.Name;
}
it works inside the form I need it ouside the form to snapshot the control when mouse click.
thanks
|
|
|
|
|
That's not going to work. Control will only work with windows in your application.
I take it you're trying to get a screenshot of any window? BTW, every control is its own little window, not just the large thing you see with a titlebar and a bunch of controls on it and drag around.
You can't do what you want using the .NET classes. You have to P/Invoke Win32 functions to do this. For a good example, look at this[^], which refers to this library[^].
|
|
|
|
|
I do not want to snapshot window or fullscreen or region,I want snapshot object when mouse click on that object.
Object capture. The object can be window, control, windows shortcut menu etc.
|
|
|
|
|
You'd need to dive into the WinAPI; getting access to a window (on a low level, everything, including textboxes and buttons, are windows) using it's handle. You'd not be able to map a TButton (from a Delphi App) to a .NET Button, but you should be able to get the dimensions of the window. That is, assuming that it is based on a window.
See, there was a time when these things were expensive and Windows would run out of handles. The easiest solution to lower the amount of windows used in an application was to get rid of the labels and to draw them by hand. You'll find that there's a lot of older apps (and newer games!) that don't use the common control-library at all. If I draw a fake button on a panel and handle a mouse-click on that location as if it were a button, you'd see a button as a user, but would never find one on the form.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You are going to need to set a Global Mouse Hook. There's an excellent article here on CP, since 2004 !, by George Mamaladze on how to do this: [^].
If, by "snapshot" the clicked Control, you mean do a bitmap screen capture: yes, as Dave K. said, you are going to get into heavy use of the Win API and Platform Invoke. Search CodeProject for articles on screen capture.
I suspect (but don't have personal experience with) that once you know the Window (the app) that got the Click, that getting hold of the Control will require some clever coding.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
thanks for your help my friends
I already see the code but it has some issues.
so if you find away to take snapshot of object when mouse click
do not forget me.
thanks again friends
|
|
|
|
|
For an article on capturing a specified portion of the screen - see this article clickety[^] by yours truly.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Hi there,
my question is what might fit better to storing objects.
I have a routine where i save ListViewItems and another for storing objects (selfmade class Resource) into a Dictionary.
But my collegue told me i should use a List<> because they are better.
I missed the why they are better.
So anyone can explain me why they should be better and whats the significant difference?
EDIT:
To explain more specific:
I need a container to store objects of my models that will be generated by Loops according to the data provided by my database.
e.g.:
I have a class Resource
public class Resource
{
MSSQL _dbIMS = null;
SqlGenerator _sqlGenerator = null;
private string _name = "";
private string _firstName = "";
private string _idEmployee = "";
private string _idCalendar = "";
private string _idBenDivFaeh = "";
private string _personalID = "";
private string _phoneNumber = "";
private string _costCentre = "";
private double _costsPerHour = 0.0;
private string _idDivision = "";
private bool _modified = false;
This will be generated after i loaded the values out of the database. Those objects then need to be stored somewhere so i can add them to a ListView.
Later on i will have those ListViewItems related to a advTree with projects and to another with divisions, the ListViewItems can be dragged and dropped onto the advTrees to modify the relation to a division for example.
So where to store the objects of the resource? List or Dictionary?
I hope this is a better explanation
Thanks in advance
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
modified 10-Dec-13 4:32am.
|
|
|
|
|
Explanation about Dictionaries[^]
You haven't provided much info about why you think you need to use a Dictionary - There is a reason why they exist, but there is also a reason why a List type exists.
Dictionaries are usually used to bind unrelated objects - If you need no binding to unrelated objects you better use a List.
A Dictionary may be useful if you want to pair numbers with their textual representation (1 = one, 2= two) etc. but it is going to fail on you if you need to store complex objects.
Veni, vidi, caecus
|
|
|
|
|
List and Dictionary are meant for completely different purposes. It's like saying which is best, Beethoven or a horse? You store the objects in the container that best fits your needs. So, if you need a keyed lookup of your objects for efficient retrieval, a Dictionary is a better bet than a List. If, however, all you need is somewhere to store data and you aren't that bothered about searching for it, a List is a good choice.
|
|
|
|
|
thanks for the explanations and for the great article about dictionarys.
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
Just to add to Pete's answer, you might want to Google for tutorials on "data structures" (which both Lists and Dictionaries are). Each has it own uses, and you can save yourself a stack* of work using the correct one. In my experience List and Dictionary are the two I most commonly use c#, but YMMV, it's worth knowning about the others.
*intended.
|
|
|
|
|
Pete O'Hanlon wrote: List and Dictionary are meant for completely different purposes. It's like saying which is best, Beethoven or a horse? +500
/ravi
|
|
|
|
|
It's often the case that where you want a mapping between items of different Types, such as ListViewItems in a ListView, and instances of your own Classes, that a Dictionary is a very convenient way to enable rapid access from an instance of one Type to the related instance of the other Type ... without casting, or too-clever coding.
A good example would be a combination ListView and TreeView Control: by keeping a Dictionary<ListViewItem, TreeNode>, and a "symmetric" Dictionary<TreeNode, ListViewItem>, you can rapidly synchronize the selection in both TreeView and ListView without translating indexes from one to the other, casting, etc.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
i wanna to show this xml in textbox (same as .xml file) (xml format) and be able to edit it and save.
note : if possible to import this xml to Datagridview:
DataSet ds = new DataSet();
StringReader rr = new StringReader("<root> <steps><step number=\"1\"><positions><position id=\"21\" /><position id=\"19\" /></positions><persons><person id=\"37\" position=\"21\"><systemfolder>4</systemfolder><controls><control fieldname=\"قسمت درخواست مرخصي\" fieldlatinname=\"request part for vacation\" fieldcontrolname=\"pnldarkhast\" editable=\"true\" visible=\"true\" /><control fieldname=\"بخش مربوط به مدير قسمت\" fieldlatinname=\"supervisor part\" fieldcontrolname=\"pnlmodir\" editable=\"false\" visible=\"false\" /><control fieldname=\"چرخه دارد\" fieldlatinname=\"is workflow\" fieldcontrolname=\"checkbox_isworkflow\" editable=\"false\" visible=\"false\" /><control fieldname=\"قسمت مربوط به کار گزيني\" fieldlatinname=\"human resource part\" fieldcontrolname=\"pnlkargozeni\" editable=\"false\" visible=\"false\" /><control fieldname=\"ساعت باقي مانده\" fieldlatinname=\"remain hours\" fieldcontrolname=\"pnlvacationhoursremain\" editable=\"false\" visible=\"true\" /></controls><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>True</attachfile></permissions></person><person id=\"28\" position=\"19\"><systemfolder>4</systemfolder><controls><control fieldname=\"قسمت درخواست مرخصي\" fieldlatinname=\"request part for vacation\" fieldcontrolname=\"pnldarkhast\" editable=\"true\" visible=\"true\" /><control fieldname=\"بخش مربوط به مدير قسمت\" fieldlatinname=\"supervisor part\" fieldcontrolname=\"pnlmodir\" editable=\"false\" visible=\"false\" /><control fieldname=\"چرخه دارد\" fieldlatinname=\"is workflow\" fieldcontrolname=\"checkbox_isworkflow\" editable=\"false\" visible=\"false\" /><control fieldname=\"قسمت مربوط به کار گزيني\" fieldlatinname=\"human resource part\" fieldcontrolname=\"pnlkargozeni\" editable=\"false\" visible=\"false\" /><control fieldname=\"ساعت باقي مانده\" fieldlatinname=\"remain hours\" fieldcontrolname=\"pnlvacationhoursremain\" editable=\"false\" visible=\"true\" /></controls><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>True</attachfile></permissions></person></persons><stepvalidation><conditionfields>37,28,28</conditionfields><conditionexpression></conditionexpression></stepvalidation></step><step number=\"2\"><positions><position id=\"23\" /></positions><persons><person id=\"53\" position=\"23\"><systemfolder>2</systemfolder><controls><control fieldname=\"قسمت درخواست مرخصي\" fieldlatinname=\"request part for vacation\" fieldcontrolname=\"pnldarkhast\" editable=\"false\" visible=\"true\" /><control fieldname=\"بخش مربوط به مدير قسمت\" fieldlatinname=\"supervisor part\" fieldcontrolname=\"pnlmodir\" editable=\"true\" visible=\"true\" /><control fieldname=\"چرخه دارد\" fieldlatinname=\"is workflow\" fieldcontrolname=\"checkbox_isworkflow\" editable=\"false\" visible=\"false\" /><control fieldname=\"قسمت مربوط به کار گزيني\" fieldlatinname=\"human resource part\" fieldcontrolname=\"pnlkargozeni\" editable=\"false\" visible=\"false\" /><control fieldname=\"ساعت باقي مانده\" fieldlatinname=\"remain hours\" fieldcontrolname=\"pnlvacationhoursremain\" editable=\"false\" visible=\"false\" /></controls><permissions><activities><start>true</start><pause>true</pause><stop>true</stop></activities><backpermission>True</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>True</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>False</attachfile></permissions></person></persons><stepvalidation><conditionfields>53</conditionfields><conditionexpression></conditionexpression></stepvalidation></step><finish number=\"0\"><positions><position id=\"7\" /><position id=\"3\" /></positions><persons><person id=\"30\" position=\"7\"><systemfolder>2</systemfolder><controls /><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>False</attachfile></permissions></person><person id=\"56\" position=\"3\"><systemfolder>2</systemfolder><controls /><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>False</attachfile></permissions></person></persons><message>Request_Denied</message></finish><enduser><systemfolder>0</systemfolder></enduser></steps> </root> ");
ds.ReadXml(rr);<br />
StringBuilder sb = new StringBuilder();<br />
ds.WriteXml(new StringWriter(sb));<br />
i get error while importing it to datagridview.<br />
Cannot add a column named 'controls': a nested table with the same name already belongs to this DataTable.<br />
<root> <steps><step number="1"><positions><position id="21" /><position id="19" /></positions><persons><person id="37" position="21"><systemfolder>4</systemfolder><controls><control fieldname="قسمت درخواست مرخصي" fieldlatinname="request part for vacation" fieldcontrolname="pnldarkhast" editable="true" visible="true" /><control fieldname="بخش مربوط به مدير قسمت" fieldlatinname="supervisor part" fieldcontrolname="pnlmodir" editable="false" visible="false" /><control fieldname="چرخه دارد" fieldlatinname="is workflow" fieldcontrolname="checkbox_isworkflow" editable="false" visible="false" /><control fieldname="قسمت مربوط به کار گزيني" fieldlatinname="human resource part" fieldcontrolname="pnlkargozeni" editable="false" visible="false" /><control fieldname="ساعت باقي مانده" fieldlatinname="remain hours" fieldcontrolname="pnlvacationhoursremain" editable="false" visible="true" /></controls><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>True</attachfile></permissions></person><person id="28" position="19"><systemfolder>4</systemfolder><controls><control fieldname="قسمت درخواست مرخصي" fieldlatinname="request part for vacation" fieldcontrolname="pnldarkhast" editable="true" visible="true" /><control fieldname="بخش مربوط به مدير قسمت" fieldlatinname="supervisor part" fieldcontrolname="pnlmodir" editable="false" visible="false" /><control fieldname="چرخه دارد" fieldlatinname="is workflow" fieldcontrolname="checkbox_isworkflow" editable="false" visible="false" /><control fieldname="قسمت مربوط به کار گزيني" fieldlatinname="human resource part" fieldcontrolname="pnlkargozeni" editable="false" visible="false" /><control fieldname="ساعت باقي مانده" fieldlatinname="remain hours" fieldcontrolname="pnlvacationhoursremain" editable="false" visible="true" /></controls><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>True</attachfile></permissions></person></persons><stepvalidation><conditionfields>37,28,28</conditionfields><conditionexpression></conditionexpression></stepvalidation></step><step number="2"><positions><position id="23" /></positions><persons><person id="53" position="23"><systemfolder>2</systemfolder><controls><control fieldname="قسمت درخواست مرخصي" fieldlatinname="request part for vacation" fieldcontrolname="pnldarkhast" editable="false" visible="true" /><control fieldname="بخش مربوط به مدير قسمت" fieldlatinname="supervisor part" fieldcontrolname="pnlmodir" editable="true" visible="true" /><control fieldname="چرخه دارد" fieldlatinname="is workflow" fieldcontrolname="checkbox_isworkflow" editable="false" visible="false" /><control fieldname="قسمت مربوط به کار گزيني" fieldlatinname="human resource part" fieldcontrolname="pnlkargozeni" editable="false" visible="false" /><control fieldname="ساعت باقي مانده" fieldlatinname="remain hours" fieldcontrolname="pnlvacationhoursremain" editable="false" visible="false" /></controls><permissions><activities><start>true</start><pause>true</pause><stop>true</stop></activities><backpermission>True</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>True</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>False</attachfile></permissions></person></persons><stepvalidation><conditionfields>53</conditionfields><conditionexpression></conditionexpression></stepvalidation></step><finish number="0"><positions><position id="7" /><position id="3" /></positions><persons><person id="30" position="7"><systemfolder>2</systemfolder><controls /><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>False</attachfile></permissions></person><person id="56" position="3"><systemfolder>2</systemfolder><controls /><permissions><activities><start>false</start><pause>false</pause><stop>false</stop></activities><backpermission>False</backpermission><selectablepersons>False</selectablepersons><selectableSender>False</selectableSender><selectableStarter>False</selectableStarter><ViewProcess>False</ViewProcess><ViewFinalTillNow>False</ViewFinalTillNow><CanSendToOthers>False</CanSendToOthers><attachfile>False</attachfile></permissions></person></persons><message>Request_Denied</message></finish><enduser><systemfolder>0</systemfolder></enduser></steps> </root>
|
|
|
|
|