With this code, the config file(listed below) opens initially into the
datagrid display with only a plus sign '+'.
On clicking that, it becomes expanded to;
-
appsettings
add
When I click on appsettings, it reverts back to '+' On clicking that,
- appsettings add is displayed
Finally, when I click on appsettings this time, the contents of the config
file is displayed.
What is going on here? How could I have the config file load into an
already expanded state?
Thanks -Greg
***************** code ******************************************
dsConfigFile = new DataSet("configfile");
dsConfigFile.ReadXml("c:\\Service.exe.config");
dataGrid1.DataSource = dsConfigFile;
****************** config file ******************************************
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="interval" value="10000" />
<add key="sDbConn" value="Data Source=xxxx;Database=xxxx;UID=xxx;Pwd=xxxx"
/>
</appSettings>
</configuration> 2 2149
When you assign a DataSet to a Windows Forms DataGrid, the default behavior
is to display the + sign. If you want the grid to show one table, bind it
just to the one table of the DataSet and it will display expanded.
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"hazz" wrote:
With this code, the config file(listed below) opens initially into the
datagrid display with only a plus sign '+'.
On clicking that, it becomes expanded to;
-
appsettings
add
When I click on appsettings, it reverts back to '+' On clicking that,
- appsettings add is displayed
Finally, when I click on appsettings this time, the contents of the config
file is displayed.
What is going on here? How could I have the config file load into an
already expanded state?
Thanks -Greg
***************** code ******************************************
dsConfigFile = new DataSet("configfile");
dsConfigFile.ReadXml("c:\\Service.exe.config");
dataGrid1.DataSource = dsConfigFile;
****************** config file ******************************************
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="interval" value="10000" />
<add key="sDbConn" value="Data Source=xxxx;Database=xxxx;UID=xxx;Pwd=xxxx"
/>
</appSettings>
</configuration>
Thank you Peter.
I also found a simpler approach to just load the timer interval from the
config file into a textbox for editing.
XmlDocument myConfig = new XmlDocument();
myConfig.Load("c:\\Service.exe.config");
string strXPath;
XmlNode oNode;
strXPath = "configuration/appSettings/add[@key='interval']/@value";
oNode = myConfig.SelectSingleNode(strXPath);
textBox1.Text = oNode.InnerText;
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:68**********************************@microsof t.com...
When you assign a DataSet to a Windows Forms DataGrid, the default
behavior
is to display the + sign. If you want the grid to show one table, bind it
just to the one table of the DataSet and it will display expanded.
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"hazz" wrote:
>With this code, the config file(listed below) opens initially into the datagrid display with only a plus sign '+'. On clicking that, it becomes expanded to; - appsettings add
When I click on appsettings, it reverts back to '+' On clicking that, - appsettings add is displayed Finally, when I click on appsettings this time, the contents of the config file is displayed. What is going on here? How could I have the config file load into an already expanded state? Thanks -Greg
***************** code ****************************************** dsConfigFile = new DataSet("configfile"); dsConfigFile.ReadXml("c:\\Service.exe.config"); dataGrid1.DataSource = dsConfigFile;
****************** config file ****************************************** <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="interval" value="10000" /> <add key="sDbConn" value="Data Source=xxxx;Database=xxxx;UID=xxx;Pwd=xxxx" /> </appSettings> </configuration> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Darryn Ross |
last post by:
Hi there...
I am trying to display both parent and child details in my datagrid at the
same time but i cannot seem to do it. It's either one or the other, if
anyone has any suggestions on how i...
|
by: Raj |
last post by:
Hi,
When we are sorting the DataGrid Boolean column the grid is becoming
redcross.
I have my own PPMIPDataGridBoolColumn class inherited from
System.Windows.Forms.DataGridBoolColumn. In this...
|
by: John Richardson |
last post by:
I've been bothered for some time about my DataGrid not populating my rows
very quickly. I have about 10K rows loading into the grid.
I create a datatable dt with 2 columns, an ID and a display. ...
|
by: Joanne |
last post by:
Hi,
I have an "interesting" problem with UserControls in a datagrid and I'm
desperate for your help as I work alone and have no-one else to ask. It
is quite complicated but I'll try to keep it...
|
by: Steve |
last post by:
How I can remove an AutoGenerated column? I wnat to inlcude the primary key
in the resultset for creating some custom LinkButtons, but I don't want it
(the PK) displayed in the DataGrid. I tried...
|
by: simon |
last post by:
hello,
new to vb.net, have a few questions about DataGrid. I have a dataGrid
that is working pulling a dataset back from a stored proc and binding
to the datagrid for display
the datagrid's...
|
by: daz_oldham |
last post by:
I am populating my datagrid 'by hand' by that I mean that i am not
using the wizard!
What I would like to know, is if I can format my colums - for example
if I have a column that is returning...
|
by: Rush |
last post by:
I'm new to web development in Visual Studio 2005, and I'm creating a web site
using ASP.NET, and right now its a very simple page with only labels on it.
I have a third party that hosts the site,...
|
by: rn5a |
last post by:
In my application, I want to populate all the directories & files
existing in a directory on the server in a DataGrid. To ensure that
all the directories get listed first followed by all the files,...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
| |