|
|
I'm tasked with helping a developer finish up a web page that collects information about an order and populates some SQL Server tables. ASPX with C#. I'm not a C# guy, but my main job here is to keep him on task, interface with the dept. that will need this, and validate the data design. At present, there are some issues with postbacks. He does a good bit of validation, mostly to ensure fields aren't blank, and posts back upon exit of a good many fields. One problem is retaining focus after postback. The user enters a value, presses tab, and a postback occurs. Instead of the focus moving to the next field, there seems to be no field with focus after the postback, which forces the user to click in the next field with the mouse. So instead of being able to tab to fields as expected, the user keeps having to use the mouse to get the focus to the appropriate field. This is not very desireable at all. Another issue is what fields cause a postback. An example would be a field that can be empty (zero), but if it's >0 another field needs to be populated. The postback occurs after the first field and an error message is displayed next to the second field saying it can't be empty, yet the user hasn't even had a chance to enter anything in that field. This is most likely a simple fix of where the validation originates from (the second field instead of the first), but the programmer seems to think this is hard to do or not doable. I may have to dig into C#, but some help here would be appreciated.
Thanks,
Russell
|
|
|
|
|
Try posting on the ASP.NET forum, you might have better luck.
|
|
|
|
|
Alright, I'll try that. Thanks.
|
|
|
|
|
Defination OF Glbalization in IT
Feature of Globalization In C#.Net
Feature of Globalization in Sun Java
Benefits of Globalization
DisAdvantage of globalization
images for glbalization
future of globalization
|
|
|
|
|
Got a new homework assignment?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Well it seems so, use google its much more easier hehe
|
|
|
|
|
|
|
This seems to be your first post and you didn't even bother write 'Globalization' down properly or ask the questions in a more 'inquisitive' manner, rahter than just copying and pasting :p
However, you are lucky, I just solved your first question:
Click Here...
|
|
|
|
|
Hi Rekha,
I'd like to tell you that there are a set of rules[^] that you must follow to post a query here. Unless which, you may not receive replies that you can use. However, since this is your first post, I'll attempt to answer your query.
Rekha Achariya wrote: Defination OF Glbalization in IT
Globalisation is the process of getting your software ready to be available for the global market (Or rather building it carefully such that it is international market ready, with the first release itself). MS Centric developers have a tendency to call this process as "Internationalisation". This may not mean opening offices around the globe, but means that you develop your software in a way such that it can "adapt" itself to be readily available (or morphed) for several different languages/cultures with very minimal efforts (usually a rebuild, specifying the new language and changing resource settings accordingly).
Rekha Achariya wrote: Feature of Globalization In C#.Net
Feature of Globalization in Sun Java
Probably you wanted to ask what features are offered by [insert language here] for making globalisation easy? Well, .NET offers aplenty such that there are books on this topic. It cannot be discussed in a forum reply like this. However, you could start here:
Introduction to International applications in C# .NET[^]
Globalising and localising applications (.NET)[^]
Additionally, search Google, Wikipedia and MSDN. There are plenty of resource and tutorials available. I'm sure you can find some.
Rekha Achariya wrote: DisAdvantage of globalization
I cannot think of any disadvantage of writing an application that is Unicode ready (or Internationalisation ready).
Rekha Achariya wrote: images for glbalization
Sorry?
Rekha Achariya wrote: future of globalization
The world is slowly moving towards Unicode. Visual studio does an Unicode build by default (this comment is with respect to native code. -- .NET is always Unicode ready). Globalisation is important if you would like to have international customers.
Also, I'm not a very kind guy by any stretch of imagination. But since this is your first post and I want you to come back to this community...
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Pick any three of the list and work it out, 3 pages minimum per topic:
definition of search engines
advantages of solving problems yourself
research = creativity + sweat
benefits of Google
do I have any future in a creative domain?
how good am I at flipping burgers?
the interdependence of language features and programmer lazyness
the great challenges of the 21th century
|
|
|
|
|
Hi, all,
I am doing a project like this. I have ten or more PictureBoxes, and I have customed methods for both MouseDown and MouseUp of those PictureBoxes, then when I MouseDown one PictureBox and MouseUp the other, I need to change the color of those PictureBoxes between these two. I am thinking to do this by one method like ColorChanged() , and I want this method can always change color of those PictureBoxes even though user trigger the MouseDown and MouseUp events over and over, is this possible? Pls, give me some coding suggestions! Thank you! Best Regards.
------------------------
I won't never ever give up!
|
|
|
|
|
Leapsword wrote: Pls, give me some coding suggestions!
What have you tried already?
Show us some code that is giving problems with an explanation of the exact problem.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
Here is part of the code for that user control which I am working on. Truely there are some bugs here, but never mind. What I need to know is how I can code in that ColorChanged() method so that I can change the color of those PictureBoxes in between. Thank you and BR!
public DateTime getTimeAt(int x, int y)
{
DateTime selectedTime = new DateTime();
Random rnd=new Random();
int hour = (y - 10) / 20 + 8;
int minute = Convert.ToInt32((x - 25) / 50) * 10 + rnd.Next(1,9);
if (minute>59)
{
minute = 59;
}
selectedTime = DateTime.Today;
selectedTime = selectedTime.AddHours(hour);
selectedTime = selectedTime.AddMinutes(minute);
return selectedTime;
}
private void OnMouseDown(object sender, MouseEventArgs e)
{
StartTime = getTimeAt(e.X, e.Y);
Updating();
}
private void OnMouseUp(object sender, MouseEventArgs e)
{
EndTime = getTimeAt(e.X, e.Y);
Updating();
}
public void ColorChanged(int x, int y)
{
}
public void Updating()
{
maskedTextBox1.Text = StartTime.ToString("hhmm");
maskedTextBox2.Text = EndTime.ToString("hhmm");
}
---------------------------
I won't never ever give up!!
|
|
|
|
|
There are two approaches that spring to mind, but before I suggest them would you please confirm the impression I got from your first post.
You want to do this when the user presses the mouse button in one picturebox (MouseDown), moves the mouse (without releasing the button) to another picturebox and then releases the button (MouseUp).
Please confirm that I have understood this correctly.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi, Henry,
Thank you for your quick reply! YES! That's what I mean, I really need your help. Thank you so much.
I won't never ever give up!!
|
|
|
|
|
Option 1 (probably the easiest)
Declare two class level PictureBox variables, one for the first (mousedown) and one for the second (mouseup).
In the MouseDown and MouseUp event handlers, identify the PictureBox where the event occurred and assign it to the correct variable.
Add a call to ColorChanged() at the end of the MouseUp handler
I'll do the MouseDown , from that you can work out how to do MouseUp
private PictureBox firstBox = null;
private PictureBox secondBox = null;
private void OnMouseDown(object sender, MouseEventArgs e)
{
PictureBox pb = sender as PictureBox;
if (pb != null)
{
firstBox = pb;
}
else
{
firstBox = null;
}
StartTime = getTimeAt(e.X, e.Y);
Updating();
}
after making the changes to MouseUp your ColorChanged() should firstly check if firstBox or secondBox is null, and if so return (nothing to do if you don't have two PictureBoxes ). then it is simply a matter of firstBox.BackColor = Color.Blue; (same for secondBox), or however you want to set the color.
I won't give you the second idea unless you don't think this will work as it is far more complicated.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Heh,
Great! Thank you, Henry! I will try this option now. After I do this, I will post what I got here then, pls keep an eye on this post. Thanks a lot.
Liang
I won't never ever give up!!
|
|
|
|
|
Hi,Henry,
I am sorry to say this. But it seems we had some misunstanding, I guess I need you option two. In my project, I have more than two PictureBoxes, and I want to make it to have the function that user press button on one PictureBox without releasing(MouseDown), and move to another one, then release it(MouseUp). But there might be also PictureBoxes between these two PictureBoxes. Here I cut a sample picture of part of my design, I hope you can give me some help.
Oh, NO! I can't insert a picture into this post. Damn.
Henry, if you still confuse what I am saying cuz my english is so sucks. Could you pls reply me by e-mail: sunly917@gmail.com. I can send the picture to your mailbox.
Thank you and BR!
Liang
|
|
|
|
|
I'm afraid that Option 2 would not help in the circumstances as you now describe them, since it was simply a more complicated way to do the same as Option 1.
The only way to do what you want, in the way that you want to do it, that I can think of, is to slightly modify the code I have already given you. Basically what you need to do is to handle the MouseMove event of the control hosting your PictureBox es. Each time the event fires it should iterate over all the PictureBox es and test if the cursor location is within the PB pb1.Bounds.Contains(e.Location) , or similar and if so, add it to a list and break out of the iteration. Therefore instead of the firstBox and secondBox you will need a collection, I would suggest List<PictureBox> . Don't forget to Clear() it on MouseDown and to add the first and second boxes to it. then in your ChangeColour iterate over the collection and do your recolouring stuff on each PB in it.
The problem with doing things in the way that you want is that if the user moves the mouse very, very quickly, one of the PBs could get missed.
[Edit]
An alternative to my suggested MouseMove approach, would be to calculate a path from the MouseDown point to the MouseUp point and then test for a PB at intervals along that path. The interval would depend on the size of the PBs.
[/Edit]
[Edit * 2]
You could of course combine the two approaches. Have a class level GraphicsPath instance, on MouseDown create a new GraphicsPath e.g. myClassLevelGP = new GraphicsPath() . Make a note of the MouseDown point. myClassLevelStartPoint = e.Location; . Then in the MouseMove handler.
myClassLevelGP.AddLine(myClassLevelStartPoint, e.Location);
myClassLevelStartPoint = e.Location;
Then in the MouseUp handler put the same two lines of code.
What you will end up with is a GraphicsPath containing lots and lots of tiny lines, tracking the path the mouse has taken.
Then in the ColorChange method you will have to iterate over the points contained in the path (look up GraphicsPath.PathPoints and GraphicsPath.PathData for suitability), and for each point iterate over the PBs and pb.Bounds.Contains(point) as mentioned above.
That's a lot of points * a lot of PBs and could take some time, not to mention the problems from fast mousing mentioned above.
You might be better off by rethinking your approach. For example, allowing users to Ctrl-Click on the PBs they want to recolour adding them to the list. They would of course have to click a button or something to trigger the recolouring and any click without Ctrl should clear the list.
[/Edit * 2]
I hope that at least part of my ramblings is of use.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi, Henry,
Thank you so much. Though I still don't think what you told me to do is the way in which I can handle my project, your talented thoughts have refreshed my brain a lot. As you said, I may really need to rethink how I could do this project. Anyway, what I expect to do is a time period selector, you know, similar to GOOGLE calendar, but not for recording daily events. I only want to make a similar WINSFORM application that users can catch a period of time and return the StartTime and EndTime, later on, maybe I would do that collection recording each period to a ListBox each time user trigger the Mouse Events. I have collected information referred to this for a long time, and there is an article here in CodeProject named DayView Calendar, but that is quite different, and since I am not so good at GDI, it's also difficult for me to understand how it was modeled.
But, really, thank you for your kind help. Hope we will always keep in touch.
Br!
Sincerely Liang
|
|
|
|
|
string connection2=ConfigurationManager .AppSettings ["conn"];
OleDbConnection con2 = new OleDbConnection(connection2);
OleDbDataAdapter da_detail = new OleDbDataAdapter();
DataSet ds_detail = new DataSet();
con2.Open();
string query = "select * from DOCTORFORM where NAME = '" + DropDownList1.SelectedItem.Value + "' ";
OleDbCommand pay_cmd2 = new OleDbCommand(query,con2);
da_detail.SelectCommand = pay_cmd2;
da_detail.Fill(ds_detail ,"details");
DataTable detail_dt=ds_detail .Tables ["details"];
GridView1.DataSource = detail_dt;
GridView1.DataBind();
this is how am getting the values into gridview.is there any other way without doing databind.
|
|
|
|
|
Why do you think your approach is not good ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
it works fine for one time binding.but if i want to append to datas to the exinting ones.like adding more rows of data every a button is clicked.it doesnt work.can u give some tips on that
|
|
|
|
|