|
how to apply different color for datagrid columns.which property can be set for this.i have set the background of the header with an image.i want to set different color for all the columns.can anyone help me in this regard.
pintoo
|
|
|
|
|
This should help you. You will have to modify it for use, however. That way you will have to do a little work . This method takes a row index, then loops through the columns for that row in the dataGridView , and then sets the backround color to light gray.
private void HighlightSelectedRow(int iRowIndex)
{
for (int c = 0; c <; yourDataGridView.Columns.Count; c++)
dataGridView1[c, iRowIndex].Style.BackColor = Color.LightGray;
}
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi
How to include a chm file into a .net application and how to associate the index of the chm file to the form in the application.
Any one who knows the solutions please help me do this.
Thank you in prior.
|
|
|
|
|
Use HelpProvider component in Visual Studio 2005.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi,
I am trying to install a .pfx certificate in personal folder using a C# application. Every thing goes fine and certificate is installed. I can see that certificate in the Personal folder of both Current User and Local machine. But when i try to run my application and use that certificate, it throws exception with the message:
The credentials supplied to the package were not recognized
Stack Trac at System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface SecModule, String package, CredentialUse intent, SecureCredential scc)......
But when i import this cert manually, it works just fine. Below is the code i am using for installing the certificate:
Dim cert_personal As X509Certificate2 = Nothing<br />
Try<br />
cert_personal = New X509Certificate2<br />
cert_personal.Import(Application.StartupPath & "\Chain\Personal.pfx","My Password" , (X509KeyStorageFlags.UserKeySet Or X509KeyStorageFlags.Exportable))<br />
Catch ex As Exception<br />
MsgBox(ex.Message)<br />
End Try<br />
If cert_personal Is Nothing Then<br />
Return False<br />
End If<br />
<br />
''XXXXXXXXXXXXXXXXXXXXXXXX PERSONAL XXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br />
Dim store As New X509Store(StoreName.My, StoreLocation.CurrentUser)<br />
Try<br />
store.Open(OpenFlags.ReadWrite)<br />
Dim findVal As String = cert_personal.Thumbprint 'Thumbprint <br />
Dim certColl As X509Certificate2Collection = store.Certificates.Find(X509FindType.FindByThumbprint, findVal, False)<br />
<br />
If certColl.Count <= 0 Then<br />
store.Add(cert_personal)<br />
<br />
End If<br />
Catch ex As Exception<br />
MsgBox(ex.Message)<br />
Finally<br />
store.Close()<br />
End Try<br />
<br />
And almost same for installing in Local machine. The complete chain is also fine. But the problem is still there.
I can't use CertMgr since this cert is from a third party which is not , as per my info, supported by that.
Any suggestion, code sample, advice would be highly appreciated.
Thanks in advance,
Wasif Ehsan.
|
|
|
|
|
Has anyone been successful in impementing the ObjectPicker dialog and getting
additional attributes by using C# + Interop?
The problem comes in when you need to marshal the string array and while reading
the attribute values back ino the managed code.
Thank you very much for any advise here.
Thanks,
...G.
|
|
|
|
|
hi
how can i get the Battery and Memory Level in C# code for PPC ?
how can i make Sounds in c# code for PPC ?
thanks alot for any Help
|
|
|
|
|
pls help me with the code for A* algorithm for finding the shortest path between two points
|
|
|
|
|
|
Member 4756709 wrote: the shortest path between two points
Is a straight line.
Couldn't resist....
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Only on a 2D/3D surface. In 4D spacetime, it's a geodesic.
Cheers,
Vikram.
"If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy
|
|
|
|
|
Wasn't me that gave your the 1 vote...
Doesn't Pythagoras work in any number of dimensions? The geodesic would just be a visualization of it, right?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Pythagoras is only correct in euclidean geometry. It's not the number of dimensions that matters, it's the flatness that does. In flat space a geodesic is a strait line. In curved space a strait line isn't always the shortest path.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
hmm....the straight line is always not possible with blockages along the path between source to the exit...i dont want the shortest path b/w two points but the shortest out of every available path....
|
|
|
|
|
Try here[^]. Lots of A* implementations are there
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Hi all. I have project compress file using C#. I'm using name space IO.Compression and i saw this code on Internet but it is compress to file bigger than source file. Can you help me, please.Thanks for your help.
<br />
public void CompressFile(string inputFileName, string outputFileName)<br />
{<br />
byte[] buffer = new byte[4096];<br />
if (File.Exists(inputFileName))<br />
{<br />
using (FileStream inputFile = File.Open(inputFileName, FileMode.Open), outputFile = File.Create(outputFileName))<br />
{<br />
<br />
using (GZipStream gzip = new GZipStream(outputFile, CompressionMode.Compress))<br />
{<br />
int n = 0;<br />
while ((n = inputFile.Read(buffer, 0, buffer.Length)) != 0)<br />
{<br />
gzip.Write(buffer, 0, n);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
<br />
public void UncompressFile(string inputFileName, string outputFileName)<br />
{<br />
byte[] buffer = new byte[4096];<br />
if (File.Exists(inputFileName))<br />
{<br />
using (FileStream intputFile = File.Open(inputFileName, FileMode.Open), outputFile = File.Create(outputFileName))<br />
{<br />
using (GZipStream gzip = new GZipStream(intputFile, CompressionMode.Decompress))<br />
{<br />
int n;<br />
while ((n = gzip.Read(buffer, 0, buffer.Length)) != 0)<br />
{<br />
outputFile.Write(buffer, 0, n);<br />
}<br />
}<br />
}<br />
}<br />
}<br />
Le Trung Hieu
|
|
|
|
|
What sort of data are you trying to compress? If it's something like an image file (Jpg, PNG, GIF, etc) then this data is already compressed, and a zip compression is unlikely to compress it further. The data ends up bigger since it has to add the zip header at the beginning of the output data.
|
|
|
|
|
Thanks for your reply.I was tried it with *.exe file.And one more question , how about compress,decompress multi-file in the folder?Thanks so much.
Le Trung Hieu
|
|
|
|
|
Depending on the type of file, you will get different compression results. Also, files that are already compressed usually get larger when compressed again.
Using the GZipStream class you can only compress/decompress a single file. That is the way the GZip protocol is designed. If you want to compress multiple files into a single archive you will need to use a Zip protocol.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
I have created C# Class Library (MySample.DLL)
I have set [assembly: ComVisible(true)]. I have also checked "Register for COM interop" check box under Project properties. The class library is also registered using regasm.exe and also the .TLB file is generated (tlpexp.exe)
Now i'm trying to load this library in a VC++ program at RUN TIME. VC++ program know only the dll name (MySample.DLL).
I'm using an API LoadTypeLib(MySample.DLL). But this gives an error TYPE_E_CANTLOADLIBRARY (The type library or DLL could not be loaded.)
But When i specify the tlb name instead of dll name then the call LoadTypeLib(MySample.TLB) is success.
But my VC++ program will get the .dll.
Could you pls help.
Thanks in advance
|
|
|
|
|
Hi all,
I have a error on using Impersonator class in c# .net. The error was "A required privilege is not held by the client". My system OS is windows 2000 advanced server. How to fix this error when changing my Impersonator class?
Note:The same Impersonator class is working fine another system which is in Windows 2000 advanced server.
Is there any changes in IIS?
Thanks in advance.
Regards,
Rameshkumar Thirumalaisamy
|
|
|
|
|
Have a look at this[^] post. Does it help you any?
|
|
|
|
|
Hi,
I need a help urgently, if any one can sort it out... I want to display the winforms datagrid dataset into
(1) pdf file
or
(2) on Microsoft Report Viewer control using RDLC.
I have a screen that displays two different dataset with two different datagrid. Using that screen results, I have to print or convert it into the PDF file...
......
Kind Regards,
Madhusudan Kushwaha
|
|
|
|
|
Just a little tip: if you say your problem is urgent, it will get ignored.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi, my friends.
I have a question with my web services. he have two functions, the intellisense in the windows application show me this function whit the parameters of each one. But it does,t work.
The error message is terrible:
System.Web.Services.Protocols.SoapException was unhandled
Message="System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Cannot serialize the DataTable. DataTable name is not set.\n at System.Data.DataTable.WriteXmlSchema(XmlWriter writer, Boolean writeHierarchy)\n at System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter writer)\n at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)\n at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_SearchResponse(Object[] p)\n...........and much more.
thanks.
|
|
|
|