I developed an application in C # where I have 4 text boxes and a datagrid with 4 columns and multiple rows and a button.
The button should generate an xml file.
I can create the xml file and write the data from text boxes, but not the DataGrid.
Anyone can help me?
At this moment i have this code:
In the button action
XmlTextWriter writer = new XmlTextWriter("teste.xml", Encoding.GetEncoding("ISO-8859-1"));
Writer.Formatting = Formatting.Indented;
How about foreaching the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.rows.aspx">Rows</a>[<a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.rows.aspx" target="_blank" title="New Window">^</a>] collection of the grid, writing the contents of all the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.columns.aspx">Columns</a>[<a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.columns.aspx" target="_blank" title="New Window">^</a>] using the method you already used?
I don't think you can unless the height to width ratio of the picture box exactly matches that of the image. Your resulting image will either be distorted or too wide/narrow for the picture box. This article[^] explains the issue and offers a solution which may help you; the code is C++ but should be easy to understand.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
Thanks. The solution shown in the C++ article shows how to size the image and then it's just a matter of setting the PictureBox ClientSize to the image size. This seems to size the image correctly and maintains the ratio.
I have an array of UserRights (class that holds the rights for an individual table) called arrTables and an array of controls called arrControls (10 of each type of control needed). The arrControls are displayed/listed on a Windows form (TableName, ViewRights, EditRights...) so that the data for 10 tables can be viewed at one time. I've bound the data to the form controls using the following code:
When I try and display the form to the user data from the 10th table stored in the arrTables array is displayed in all 10 sets of controls. I learnt that the CurrencyManager holds the value of the Current possition and that is the reason for these results.
Is there a way around or an alternative way to implement this without hacing to use a datGridView or other list control?
Last Visit: 31-Dec-99 18:00 Last Update: 20-Sep-23 21:51