|
You are welcome
|
|
|
|
|
I've searched around CodeProject and the boards but haven't found a solution to my problem.
I have a DataGridView that is unbound.
Based on selections in the first column from a ComboBox, other cells in that row may be set to ReadOnly.
What I would like to do is skip over any ReadOnly cell when the user presses Tab (or Shift-Tab).
I can get the selection to go where I want it to go, but the input focus still goes to the next cell even if it is ReadOnly.
Example: The current cell is [0, 0]. Based on what I selected, the next cell ([1, 0]) is ReadOnly. I press Tab. What I want is for the selection and the input focus to move to cell [2, 0].
If I set the .CurrentCell to [2, 0] and then set .CurrentCell.Selected = true, I get the selection to highlight in the right spot, but the input focus still goes to cell [1, 0].
How do I completely skip over a specific cell? As an added bonus, it would be nice if when the user clicks on a ReadOnly cell, that the selection and input focus goes to the next cell instead of the ReadOnly cell. Can it be done? If so, how?
I hope what I'm describing makes sense.
Thanks.
|
|
|
|
|
listen,
i don´t know if you can set a cell to readonly (or not) like you do in datagridview.
Did you considered in setting values not in the DGV? i set dgv to readonly and get/set values in textboxes, comboboxes from dgv currentrow, i have 20 columns in dgv but only 14 textboxes or whatever, the ones i want to edit.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi all,
I want to add a TimeSpan, in milliseconds into DateTime variable. I've try this.
DateTime da = dtStart + new TimeSpan(0, 0, calTimeStamp));
For different calTimeStamp give the same value, that is dtStart as the output. No time is added there. Can you someone tell me where I'm going wrong.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
1. There is an extra closing bracket.
2. As DateTime is struct dtStart will not change but da will store result of the addition.
|
|
|
|
|
Ya, that bracket is added by mistake. Sorry about that.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Glad to help you
|
|
|
|
|
Two things:
1) Make sure calTimeStamp does not equal zero because the following works fine for me:
int calTimeStamp = 30; //so that I know I have a value
DateTime dtStart = DateTime.Now; //I need a start time
DateTime da = dtStart + new TimeSpan(0, 0, calTimeStamp); //this adds 30 seconds to dtStart
2) Using TimeSpan(0, 0, variable) gives you seconds not milliseconds.
For milliseconds you have to use TimeSpan(days, hours, seconds, milliseconds);
|
|
|
|
|
David Fleming wrote: 1) Make sure calTimeStamp does not equal zero because the following works fine for me:
Yep, this is the issue. I'm doing this process in a loop and each time calTimeStamp set to zero.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Is calTimeStamp the number of milliseconds , seconds, or minutes? It looks like it's seconds based on the constructor overload you used. (Your variable names kinda suck.) I always use the last overload so that there's no question about what the value represents.
DateTime da = dtStart.Add(new TimeSpan(0,0,0,calTimeStamp,0));
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
How can I disable print job notification for all users in windows xp sp2
programmatically in c#?
|
|
|
|
|
|
You forgot joke icon for your post.
|
|
|
|
|
Hi All,
I want to call C# Dll in Javascript.
How can I use Method of this DLL using Javascript.
Regards
Sunil
|
|
|
|
|
|
Dear all,
I have a c# application like Form1.exe.
How to hide it form vista task manager application list?
In XP, when i set ShowInTaskbar to false, there is no
Form1.exe in the application list.
But in vista, i can see Form1.exe in the application list.
What is different between XP and vista behavior?
I want to ensure no user closed my application uncareful.
Thanks a lot!
modified on Tuesday, September 30, 2008 4:18 AM
|
|
|
|
|
why would you want to do that? Looks like a suspicious application. Users usually don't close application from task manager and if a user wants to do so it means that the app really deserves it.
|
|
|
|
|
Thank for your answer.
But i modify my message.
I am sorry for my expression.
|
|
|
|
|
You can't. If you do a search here on CP you will see this question has been answered several times in the last few days.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Can anyone help me?
Iam trying to embed an html file to my mail application. But the html file is display as an attachment. Pls send me a solution to display the html file as mail's body.....
Thanks in advance
Praji
|
|
|
|
|
|
Problem were not solved.
In place of giving like
string body = ";
body += "";
body += "this is some HTML text";
body += " ";
i want to give a file name containing all these.. So pls help...
|
|
|
|
|
I don't think specifying just file name will result in the same behavior you need. But If you know name of the file, yo can read its content using StreamReader class and use it according to you needs.
|
|
|
|
|
Could u pls help me for that... Send me the code..
Thanks
|
|
|
|
|
Read the documentation for StreamReader class and it should be obvious to you how to do it.
KP_Prajilal wrote: Send me the code..
Oh yes, I will.
|
|
|
|