|
I have datagridview binded with data. datagrid columns are in AutoSort Mode. now i sort the grid with one column, say ProductId. int the datagrid i have procut id with "a,c,d".after sorting DESCENDING order the order is "d,c,a".Now i am adding new product , say "b". after adding i tab out from procut id cell. now, since that columns is alreay in sorted the product "b" goes in between "a" and "c" automatically. due to this behaviour i am loosing currentrow index.
Can any one post me solution how can i over come this issue.
what are the possible fixes to current row index.? or How can i restrict the behaviour of automatic data sort.?
Regards,
Prasad
|
|
|
|
|
At a guess, I never edit in a grid, you could turn the sort off when you start add/edit a row and turn it on when editing is completed.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am having a DataGridView on a C# windows form, say frmOne, which has several rows of records on this DataGridView, what i want to do now is that when i click 1 row record out of those records in the DataGridView, how can i send the cell values to another form's textbox, say frmTwo. Below is an example:
On frmTwo:
txtClient.Text = frmOne.DataGridView.(whatever things that i dont know how to map at this stage).
Thanks in advance.
Andie
|
|
|
|
|
For goodness sake learn to use google or the MSDN Help.
for google 'pass data between forms c#' gets a whole shedload of hits.
next learn how to use a datagridview by the same method.
Then, AND ONLY THEN, ask a question when you have done some work and are actually stuck in your own code.
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.”
|
|
|
|
|
dude, i dont need this sort of instruction and if you dont know to plot a guidline for the other members in here, i doubt you should be here. Why don't you just go to the place that really belongs to you, such as a forum for complaining etc.
Guess what, i fixed myself just after 30 mins i posted the message. And i am willing to share my knowledge with others as long as they shoot me an email if they go the similar issues.
|
|
|
|
|
The fact that you fixed within 30 minutes of posting the question just confirms that you should not have posted the question in the first place.
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.”
|
|
|
|
|
true, the thing is that i just wanted to some one point me to the right direction rathern than waste ages of my time to figure out. the ones suggestion don't have to post the exactly code, just some direction and idea, and i think this is the meant of this forum.
Anyway, too much junk comm regarding this issue. the ones who give always be appreciated, no matter right or wrong.
|
|
|
|
|
But I did point you in the right direction. I gave you a search phrase, which, had you used it might have set you on the road to a solution, and then suggested how to proceed from there.
Just because the first sentence of the post appeared harsh it doesn't mean that I am not willing to help.
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.”
|
|
|
|
|
I am new to C#.net...
I wanted to know the idea of sharing the video across local area network
|
|
|
|
|
Hi,
I am using the Sharpmap to plot points on the shape file and jpeg file.
I was able to plot points on the shape file.But while using the jpeg file I was not able to correctly place the coordinates the image gets small and coordinates are placed outside.Please tell how to place coordinates on jpeg file. I had included raster layer though
|
|
|
|
|
Hi,
I am getting more than one Table from different DataBase and manualy marging into one table.
this procedure taking more time.so i need to improve performance.
if i use DataTable.Merge method it's merging.it's add new row in same table.
can one help me
Thanks
|
|
|
|
|
Why are you merging them? What is the eventual goal?
|
|
|
|
|
becuase database not on same machine so i can not put join in stored procedure.so what i am doing.get all data from all database and merge then creating dataview on merged data and fillter it.
thanks
|
|
|
|
|
If they are both SQL Server you can link the servers.
Otherwise, yeah, you'll need to do it manually. I've never done that, but it sounds like an interesting challenge.
|
|
|
|
|
I want to replace the value of src attribute of html source code.
for example the html source code is
<img src="C:\script\link.png">
<img src="C:\script2\link.png">
<img src="C:\script3\link.png">
and i want to replace the folder path ("script" or anything) to C:\myfolder\
How to replace this
Thanks in advance
modified on Monday, February 9, 2009 11:33 PM
|
|
|
|
|
the replace method of the string class will work fine for that, or you could use regex if need be.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Could you give me some example to do this using regular expression?
thanks
|
|
|
|
|
Hello everyone, I am a beginner at C#. My problem is as follows:
1. I am coding a server app running on a single proxy server.
2. We have got a client app on each client machine which pings the server (using UDP)
3. For the first ping, server app creates a new entry in the existing linked list (using IPAdress)
4. For each such entry, it starts a timer (should run for 60 sec.)
5. If any client app pings again within 60 secs, its timer should be reset. Timer Code should be non blocking.
6. If timer expires, corrosponding IPAddress Node should be removed from Linked List.
How do I implement this specific timer functionality? I will have to start 100 timers for 100 clients! And that too, each timer should have its own identity... IPAdress!
Please help. Waiting anxiously for reply.
Thank you.
|
|
|
|
|
I wouldn't. I would prefer a database, but a Dictionary would work too.
On each ping, I'd update the database or Dictionary for the pinger with the current time. Then periodically, enumerate the list, removing any entries where the time is expired.
|
|
|
|
|
But if I use a dictionary/database, how do I decrement the timer for each entry after each second? Since, in general, the number of entries may be large, how do I ensure that the decrement of the first entry and the last entry takes place within that same second?
|
|
|
|
|
You don't, you simply compare the time of the last ping with the current time and remove any entries that are older than some threshold.
|
|
|
|
|
I am relatively new to design patterns and LINQ to SQL and have come across a bit of a bump, mainly due to a lack of understanding on my part.
The situation i have setup at the moment is i am using DDD and so have my Domain/Model layer with all my domain objects contained therein, and my Infrastructure layer where i am trying to implement the Respoitory pattern. In my database i have tables such as BATCH, SITE and COMPANY, with BATCH having columns such as SiteID and OwnerID which are GUID types related to the ID's columns of the SITE and COMPANY tables respectively.
I have:
public interface IRepository < t >
{
IList < t > GetAll();
T FindBy(object key);
void Add(T item);
void Remove(T item);
}
public class BatchRepository : IRepository<batch>
{
...
}
</batch>
What would be the best way to go about pulling a more rich set of information than just the Batch object with only GUID data?
Previously, i would of used a SQL query that used JOIN to get the Company.CompanyName using Batch.OwnerId etc...
But now, the Repository returns only the plain BATCH object from the database, and obviously then iterating through each of these Batch objects and querying the DB AGAIN for the OwnerName, SiteName etc based on the Batch.OwnerId , Batch.SiteId data is wasteful...
Should i be creating additional domain layer objects such as BatchResult that has a more rich set of data properties and making the repository return that type instead?
Thanks in advance for patience with my ignorance
modified on Monday, February 9, 2009 10:51 PM
|
|
|
|
|
I am reading a table in from one access Database and storing it in a DataTable(or DataSet if easier)
I then want to update an empty table in another database with the data in the DataTable.
the two tables have the same fields
I know I can read the DataTable row by row and add the data to the 2nd database but I am wondering if there is an easier shorter way.
here is the code I am currently working on, (not sure that it will work all of the DataTable/DataSet examples I have found only are working with pulling data and updating from a single database.
DataTable HashTable = new DataTable();
Classes.SeedsDB seed = new Classes.SeedsDB();
seed.GetHashTable(ref seedDBPath, ref HashTable); //Opens 1st Database and stores the Table in HashTable
OleDbDataAdapter Adapter = new OleDbDataAdapter("SELECT * FROM BadHashTable",MAconn);
OpenAccessDB(); //Opens 2nd Database holds connection string that works in other Methods in the class
OleDbCommandBuilder Cmdbld = new OleDbCommandBuilder(OSAppsAdapter);
Adapter.Update(HashTable);
CloseAccessDB();
|
|
|
|
|
I prefer to just use a DataReader to read from one and copy to another.
Simply using the Update won't work, as you've found. The rows have the wrong status for that, you'd have to change their status. It's kind of the opposite of AcceptChanges. I'm not sure you can, I haven't tried it. I'll have a quick look.
[Later] See
DataRow.SetAdded Method
Changes the Rowstate() of a DataRow to Added.
modified on Monday, February 9, 2009 11:45 PM
|
|
|
|
|
Thanks for the help I ended up using the DataTableReader and got it working.
|
|
|
|