|
It sounds like your security permissions is messed up. You say someone else worked on that PC? Then it is likely the administrator didnt 'clean' the previous users permissions, and thus conflicting.
|
|
|
|
|
|
Is this Vista or Windows XP? Is the XML file in the root of c: ?
|
|
|
|
|
I'm using Windows XP. The file is not in the root of c:, however I have also tried to get the Selected Path from a FolderBrowserDialog and I have the same problem.
When I try this in the Windows Application that I inherited I do not have the problem; that's why I think it is an "environment" problem.
Thanks for your help, Lisa
Lisa
|
|
|
|
|
Hey guys,
is it possible to change the color of individual rows in a DataDridView?
The data will be employees loaded into my application, the idea is to keep the row color of active employees white, make inactive - grey, make temporary - light green & make terminated - Red
any ideas where to start?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: is it possible to change the color of individual rows in a DataDridView?
You could certainly do it via the 'CellFormatting' event by modifying the CellStyle.ForeColor and CellStyle.BackColor to whatever you desired. However, in that event you would need to change all the cells in the row to impact the entire row. There might be a way to do it automatically for the entire row as opposed to doing it cell-by-cell.
|
|
|
|
|
yeah cell by cell wouldn't be the best solution for this particular problem because each row has about 20 cells, and there will be a few 1000 rows at a time...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
I need select from list containing product code and name but show only code in combo textbox.
Tried code below but dropdown list shows only code.
How to display both code AND name in selection list ?
using System.Collections.Generic;
using System.Windows.Forms;
class testForm : Form
{
testForm()
{
ComboBox cm = new ComboBox() { DisplayMember = "DisplayMember", ValueMember = "Code" };
List<Product> prodList = new List<Product>();
prodList.Add(new Product() { Code = "001", Name = "Wine", Cb = cm });
prodList.Add(new Product() { Code = "002", Name = "Beer", Cb = cm });
cm.DataSource = prodList;
cm.DataBindings.Add("SelectedValue", prodList, "Code");
Controls.Add(cm);
}
class Product
{
public ComboBox Cb;
public string Code { get; set; }
public string Name { get; set; }
public string DisplayMember
{
get
{
if (Cb.DroppedDown)
return Code + " " + Name;
else
return Code;
}
}
}
static void Main()
{
Application.Run(new testForm());
}
}
Andrus
|
|
|
|
|
hi
override the ToString() function in the product class and return the formated string with both properties.
regards
|
|
|
|
|
Thank you.
I tried code below but dropdown list shows only code.
How to force it to show both code and name ?
Andrus.
using System.Collections.Generic;
using System.Windows.Forms;
class testForm : Form
{
testForm()
{
ComboBox cm = new ComboBox()
{
ValueMember = "Code"
};
List<Product> prodList = new List<Product>();
prodList.Add(new Product() { Code = "001", Name = "Wine", Cb = cm });
prodList.Add(new Product() { Code = "002", Name = "Beer", Cb = cm });
cm.DataSource = prodList;
cm.DataBindings.Add("SelectedValue", prodList, "Code");
Controls.Add(cm);
}
class Product
{
public string Code { get; set; }
public string Name { get; set; }
public override string ToString()
{
return Code + " " + Name;
}
}
static void Main()
{
Application.Run(new testForm());
}
}
Andrus
|
|
|
|
|
try to add only the class object. do not set databindings. then in the selectedindexchanged event
cast the selecteditem to the class object.
Product product = (Product)myComboBox.Items[myComboBox.SelectedIndex];
|
|
|
|
|
Thank you. I tried the code below but TextBox in combo shows name also.
How to show only code ?
using System.Collections.Generic;
using System.Windows.Forms;
class testForm : Form
{
testForm()
{
MultiComboBox cm = new MultiComboBox() ;
List<Product> prodList = new List<Product>();
prodList.Add(new Product() { Code = "001", Name = "Wine" });
prodList.Add(new Product() { Code = "002", Name = "Beer" });
cm.DataSource = prodList;
Controls.Add(cm);
}
class MultiComboBox : ComboBox
{
protected override void OnSelectedIndexChanged(System.EventArgs e)
{
Product product = (Product)Items[SelectedIndex];
SelectedItem = product.Code;
base.OnSelectedIndexChanged(e);
}
}
class Product
{
public string Code { get; set; }
public string Name { get; set; }
public override string ToString()
{
return Code + " " + Name;
}
}
static void Main()
{
Application.Run(new testForm());
}
}
Andrus
|
|
|
|
|
When the code runs, the value of Cb.Dropped is always false. Stepping through.
Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|
|
|
Munna Sarfraz Ahmad,
And the question was?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Thank you for the Copy and Paste directly from the internet.
Dave
|
|
|
|
|
Just a crop-dusting across forums. And they call themselves 'software engineers '.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
What on earth made you think you needed to post that here?
|
|
|
|
|
MarkBrock wrote: What on earth made you think you needed to post that here?
The hot summer has struck and paralysed his brain from thinking coherantly.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hi Vladimir Afanasyev,
I read your article .NET - Diving into System Programming.It is really intresting.You had mention some links in order to gain the Intial knowledge of System found all three of the articles to be very informative. I am working on a little project that requires listing all the drivers for a certain device (much like the device manager in windows does) but I have been unable to accomplish it. Can you point me to a resource that explains this or give a brief explanation of how you could do it ? You mentioned Some of msdn but it does not work
Using Device Installation Functions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/setupapi_071eca3a-0cc3-4962-b3de-65dcf056c761.xml.asp
SetupDiBuildDriverInfoList
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-rtns_dd9aa1be-1a67-4cc6-8a06-5db71eecd322.xml.asp
SetupDiEnumDriverInfo
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-rtns_8d84a225-9dac-4ab3-8c9a-5048284d82be.xml.asp
SetupDiGetDriverInfoDetail
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-rtns_5a2fb98d-54ee-4290-9969-f5e12d77cbcf.xml.asp
SP_DRVINFO_DATA
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-struct_738a1fa5-729a-4464-af75-05591d68eef7.xml.asp
SP_DRVINFO_DETAIL_DATA
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/di-struct_74ef2af7-e982-4041-9c39-605ca316359c.xml.asp
Thanks,
|
|
|
|
|
If this is a reply to an article, you're better off replying in that article's forum - it's unlikely that the particular author will stumble upon this post.
|
|
|
|
|
Under Win32 and COM development<< Windows Driver Kit, you will get all this information.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
How Cud I get a popup in Window Application in asp.net?
|
|
|
|
|
You want ASP.NET in your C# application or launch a C# application from an ASP.NET site in the user's browser?
|
|
|
|