|
You can access one cell of the grid as :
DGField[rowIndex,ColumnIndex]
bye
|
|
|
|
|
hi..
In my application im taking input as a string from user, which is acutually a color name..now is there any way to validate that string wheather it is a valid color or not ?
For ex.
"RED" its a valid color
"REDD" its not a valid color
any help..
Thanks
|
|
|
|
|
You need something to validate it against, what colors are valid? The C# Color class contained ones? or the names of Colors in English?
|
|
|
|
|
Use the Color.FromName method to convert the string to a color. If the name is invalid, the ToArgb property of the color returns zero.
---
b { font-weight: normal; }
|
|
|
|
|
If treelist have open node, and i add new node to treelist - new node not can have focus.
treelist.AllNodesCount = all nodes in treelist - 1 ???
But if all node is close, and i add new node - !!! my new node can have focus!!!
treelist.AllNodesCount = all nodes in treelist !
My code:
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Nodes;
namespace video
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
TLNode tln1 = new TLNode(1, treeList1.Nodes, "dfhdfhgdf", "234523");
treeList1.Nodes.Add(tln1);
treeList1.FocusedNode = tln1;
}
private void simpleButton2_Click(object sender, EventArgs e)
{
TLNode tln1 = new TLNode(1, treeList1.Nodes, "4567rtyu4567", "ertye3456ertye");
tln1.HasChildren = true;
TLNode tln_children = new TLNode(2, tln1.Nodes, "trtr3636yryr", "6868cncn2525");
tln1.Nodes.Add(tln_children);
treeList1.Nodes.Add(tln1);
}
}
public class TLNode: TreeListNode
{
string name;
string url;
public TLNode(int id, TreeListNodes owner, string name_, string url_) : base(id, owner)
{
name = name_;
url = url_;
}
public override void SetValue(object columnID, object val)
{
}
public override object GetValue(object columnID)
{
return "text";
}
}
}
How to do this problem?
Help me please.
|
|
|
|
|
Dima Filipiuk wrote: using DevExpress.XtraTreeList
Ask them 1st! Then if you have no luck, tell us about your pain, and then repaste the original question.
|
|
|
|
|
Hi!
In my project I have a server creating a singleton that answers requests from various clients. Sometimes I need the singleton to delay requests from specific clients while not blocking requests from the others.
Currently Im using a 'while' loop checking for a flag that tells me if the request should wait or be answered but this has the side effect of not allowing any other request to go through until the current one completes.
SingleCall won't work since I need to store status between calls. Using a singleCall object to call the singleton could work but seems ugly.
Any ideas are welcome! Thx!
|
|
|
|
|
Depending on the amount of client queries and also the timeout. Cant you buffer valid client requests in a queue?. Possibly have two threads, one to constantly listen for client queries and validate if the request should go through... then passing this to the Syncronized Queue while the Singleton deals with the current request?
Or do you need the Singleton object to validate the request itself? Again depending on the amount of queries just queue them up in a buffer ready to pass to the singeton. As long as you can clear the buffer before the clients timeout and send a new request it should be fine.
Or what if you notify the client you have recieved the respone and it is in a queue, possibly have a thread periodically reply to the client with ist position.
Darren
|
|
|
|
|
Hum... wouldn't the listening thread block on the first request it should delay?
The idea is that some requests should wait for a flag/event/something before the remote call returns, the problem is that until the current remote call returns the Singleton won't process any others effectively blocking the server on the current call.
As I said, it can probably be done with two objects, a Singleton and a SingleCall (if the SingleCall creates a new instance for each request) where the SingleCall would block (until it got a signal to continue) and not the Singleton. This would imply twice the remote calls and since the SingleCall has no status, a way to read the flag to continue (if only I could send an object reference to the SingleCall...)
There must be an easier way to do this...
|
|
|
|
|
Who can tell me aboat retrieving the H.D.D serial number in C#?
|
|
|
|
|
http://www.codeproject.com/csharp/hard_disk_serialno.asp?df=100&forumid=33442&exp=0&select=939821
|
|
|
|
|
|
Hi all,
i'm running this shellcontrol...
TempPath = "C:\Program Files\Progressive projects\Progress\ReportTemplates"
TempName = "ClientRecordCardHairFo-Pdf.xsl"
public void shellControl2()
{
if(CustCd != "")
{
string command = "\"" + Convert.ToString(TempPath) + "\\fop.bat" + "\" " + "-xml " + "\"" + Convert.ToString(TempPath) + "\\ClientRecordCard.xml" + "\" " + "-xsl " + "\"" + Convert.ToString(TempPath) + "\\" + Convert.ToString(TempName) + ".xsl" + "\" " + "-pdf " + "\"" + Convert.ToString(Salon.Library.GlobalVariables.Reports_Path) + "\\ClientRecordCard.Pdf" + "\"";
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
// /c switch sends a command
startInfo.Arguments = Convert.ToString(command);
// redirect messages to this program
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
//don't execute using shellexecute API
startInfo.UseShellExecute = false;
//Don't open command prompt window
startInfo.CreateNoWindow = true;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
if (output.Length != 0)
shellControl1.WriteText(output);
else if (error.Length != 0)
shellControl1.WriteText(error);
}
}
Thing is,it stops when it gets to: string output = p.StandardOtput.ReadToEnd();
It doesn't give me an error though. It's realy frustrating
plz help...
He who laughs last...
|
|
|
|
|
This text 'ReadToEnd assumes that the stream knows when it has reached an end. For interactive protocols, in which the server sends data only when you ask for it and does not close the connection, ReadToEnd might block indefinitely and should be avoided.' was taken from MSDN link here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOStreamReaderClassReadToEndTopic.asp[^] it seems like your program is waiting on a termination.
I am not 100% on your code, i know your trying to redirect the response or messages through your program but what if there are none? Maybe you should run the command and have a listener on a seperate thread.
Darren
|
|
|
|
|
So am understanding you correctly,
the program is waiting for the comand prompt to close but it's stuck trying to sen me an output?
He who laughs last...
|
|
|
|
|
i found the problem...
The part where i say:
startInfo.Arguments = Convert.ToString(command);
it gets sent to the command prompt but its not seen as a command and thus does not create an output for me and is stuck waiting.
it should be
startInfo.Arguments ="/C " + Convert.ToString(command);
This switch is for when you send a command.
thank you for putting me in the right direction.
He who laughs last...
|
|
|
|
|
Excellent, glad you fixed it
|
|
|
|
|
What means "Apartment" in C#?
|
|
|
|
|
|
Hi All,
I wanted to know whether there is some technique to find out if a file is being written or not. Means suppose a WAV file is being recorded and i have applied a FileWatcher to the same directory in which this WAV file is created. So now i want to know when the WAV file completes its recording. When it completes it recording i want to copy it to some other directory.
So is there any event or some other technique which can be applied to know this. I had some logic like, i will try to write to the file and if an exception occurs i wont copy it, but the problem is that this is not a good programming practice and what if the file has completed recording, I would corrupt that file in this case. Seems foolish, thats why i didnt cotinued with it.
If some one has some idea about my problem please post reply !
Thanks !
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Instead of trying to write to the file, try reading it. It will fail if there is still a write lock on the file.
|
|
|
|
|
You could read the file attribute 'size' periodically until the size stops increasing.
Or if said process that creates the .wav terminates when it is complete you could monitor running processes on the machine until the wav writing process finishes.
alternativly this article: http://www.thecodeproject.com/csharp/tail.asp[^] mentions 'The most notable piece from below is the way that the FileStream is created to read files that may be open by other processes.' Edit: not sure if i read that right, i think its more a way around reading something taht is already open.
Darren
-- modified at 2:37 Tuesday 30th May, 2006
|
|
|
|
|
I have some source code of html pages , I stored them into a DB (access)
there are some links into their source code, i load them with web browser,(they are linked together ). so how i can manage their links?
|
|
|
|
|
React to the navigate event fired when the user clicks a link. You can then cancel the navigation and update the source yourself.
|
|
|
|
|
can you please explain it in details?
how can i handle these events when there are more than one link in the html page?
thanks
|
|
|
|