|
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Which code is populating the dropdown boxes? What part of the code is slow? If you're searching through a database, have you used the WHERE clause, or are you just iterating over the results when the list is populated?
|
|
|
|
|
thanks for your quick response
me using following query to fill dropdown
"select CountryName, CountryID from CountryTable"
"select CityName, CityID from CityDetails where CountryID = 1"
"select LocationName, LocationID from LocationDetails wherer CityID = 1"
this way the data has been retrive from database
but before that
i want to clearify
at page Load it initialize each control
DropDown1.Items.Clear()
ListItem _Item = new ListItem("-Select Country-",0)
DropDown1.Items.Insert(_Item, 0)
DropDown2.Items.Clear()
ListItem _Item = new ListItem("-Select City-",0)
DropDown2.Items.Insert(_Item, 0)
DropDown3.Items.Clear()
ListItem _Item = new ListItem("-Select Location-",0)
DropDown3.Items.Insert(_Item, 0)
when i change selection of Country drop down
again
DropDown2.Items.Clear()
ListItem _Item = new ListItem("-Select City-",0)
DropDown2.Items.Insert(_Item, 0)
DropDown3.Items.Clear()
ListItem _Item = new ListItem("-Select Location-",0)
DropDown3.Items.Insert(_Item, 0)
this way its coded..
hope you get what i coded on my form
sasmi
|
|
|
|
|
hello,
im looking for a solution with a slight problem that im sure it is possible, but i cant find anything about it on the web.
In my code, im calling a leave event out of a control that check's if the control has made any changes (txtBox, combo Box...) raising a question telling the user that changes weren't saved.
if the user click's on Cancel button, i want him to stay in the control and not actually leave like he initially did.
How can i do it ?
Thanks
private void TabControlChars_Leave(object sender, EventArgs e)
{
DataTable charChanges = null;
if (charsTypeDT != null)
{
charChanges = charsTypeDT.GetChanges();
}
else if (charsDT != null)
{
charChanges = charsDT.GetChanges();
}
if (charChanges != null)
{
DialogResult result;
result = MessageBox.Show("Changes were made without saving !!\n"
+ "All Changes will be lost ...", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
if (result == DialogResult.Cancel)
{
???
}
}
}
|
|
|
|
|
Try setting focus back to the textbox.
You can also place the code in the Validating event and then use Cancel property of the CancelEventArgs there to remain in the textbox.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Your logic should ideally be placed in Cancel button's Click event.
|
|
|
|
|
Sorry, but i didnt get you..
the message Box is created inside the Leave event so how can i put the event in the cancel button click event ?
|
|
|
|
|
I'm sorry, I got your question wrong.
In your case, instead of using the Leave event, use the Validating event and if the user chooses cancel, set e.Cancel = true (e is the ValidatingEventArgs passed to the method).
|
|
|
|
|
i have some data in grid which i want to write to database table on clicking a comand button...tell me esay way to do that?
|
|
|
|
|
Member 590310 wrote: i have some data in grid which i want to write to database table on clicking a comand button...tell me esay way to do that
What is the source of data that you are showing in gridview ? Read those data and put into the database. Or your problem is something else ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
reading data from table and showing it in grid...nw after making some changes in data i want to put that data back to table...
|
|
|
|
|
read the data from the grid
by using this code
gridname.row[index].cell[i].text
and make a query and insert into the table.
Thanks and regads,
Amit Patel
|
|
|
|
|
|
Hi,
I have gridview which contains Column type DataGridViewButtonColumn. I want to set caption of button in two line like
Save
Close.
I have tried to set caption using "Save\nClose" ,"Save\r\nClose" and "Save\f\nClose", but not worked .Please tell me how to set caption using new line?
Regards,
rajesh
rajesh
|
|
|
|
|
Rajesh_K_Sharma wrote: Subject: How to add new line in cell gridview in desktop application
Then why are you asking in ASP.NET Forum ?
Sorry My BAD. I thought I am on ASP.NET Forum. Sorry Again !!!
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
I am new to how to recording video using DirectX in windows application.How can the size of avi be reduced while recording video using DirectShow Library.
Thanks
|
|
|
|
|
What size, the video size (dimensions) or the filesize?
|
|
|
|
|
Hi,
By Size I mean the size of the File like recording 1 minute video produces AVI file of 1GB .I want to compress the File Size.
Thanks
|
|
|
|
|
Hello,
I am looking for a software that can generate Activity diagram from an existing C# source code. I found many solution which can only do round trip engineering with Class Diagram. But I need an Activity Diagram generator. Would anyone please tell me if there is one ?
Regards
|
|
|
|
|
Have you checked with EA ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Rational rose is a software used to generate the UML activity Diagram based on your coding sturcture
|
|
|
|
|
I tried to write a file asynchronously but I can not do it. Could you help me on this issue ?
any recommendations are strongly appreciated
|
|
|
|
|
What is the error you are getting?
|
|
|
|
|
Not without seeing your code and getting an explanation of the problem you're having.
|
|
|
|
|
sorry for unclear explanation of my problem.
the code that I have try is below:
delegateGetInputReportData getInputReportDelegate = null;
getInputReportDelegate = new delegateGetInputReportData(myAccessForm);
base.Invoke(getInputReportDelegate,/*args*/value);
a new delegate method is created on each data receive event.
in myccessForm I try
TextWriter tx = new StreamWriter("Data.txt");
tx.WriteLine(index +" " + s1.ToString() + "0" + s2.ToString() + "\t\t" + str + "\t\t" + p.ToString());
but it causes an exception that file is used by another program I tried to solve problem by using mutex but It does not work.
|
|
|
|