|
Are you using a GridView or a DataGridView (win or web).
This article helped me with a DGV [^]
|
|
|
|
|
I am using a DataGridViews on Windows forms.
Had a look at the article, but it does not handle my problem: sortable, with comboboxes, and adding/deleting rows.
Essentially, the question: which is the best way to handle the list of values that must be displayed in the combobox column - use a dictionary or a struct and sort the dictionary/struct when the grid is sorted, or maybe some other method.
I started off using an ArrayList of int, but then I have no reference to sort it to the same order as the grid. So it has to be an ArrayList of a struct that stores the value that must go in the combobox and a value from some other column in the grid so that I can sort the ArrayList to the same order. And it starting to boggle my mind!
|
|
|
|
|
Nigel Mackay wrote: And it starting to boggle my mind!
I have only once EVER used a combo in a DGV, I'm of the school that says you do not edit data in a list control, I allow this to vary only on the most trivial operations so sorting a DGV with a combo in it is (and will stay) outside my scope.
If your underlying data is a datatable/view then sorting should not be an issue if you bind to the text rather than the ID. Then how do you deal with the 'I sote the ID' problem.
|
|
|
|
|
Not making the data in the gridview editable could very well be the the answer to my problem.
Use the grid, sortable, for viewing and for finding the row to edit, and then using Add, Delete and Edit buttons to open dedicated forms for the three tasks. The row number doesn't have to used per se, a suitable value can be extracted from the grid in order to decide which record to Edit. And I still have the row number to put the edited values back into the grid. Deleting just needs confirmation. Adding can gather the data and then insert a row into the grid programatically.
Will go that route - it just means creating a few more forms - 6 to be exact.
Maybe the problems associated with what I was trying to do explains why I can find no info about it.
|
|
|
|
|
Nigel Mackay wrote: 6 to be exact
Meh - I've got hundreds of the bloody things for editing....
I put the id value I want into column[0] and set visible to false - I then know exactly where to find my edit id. I have also been known to chuck the datarow into the tag property if I am manually loading the DGV (I consider this cheating but it does make locating the record simple)
I use doubleclick on the cell/row to initiate the edit operation and also have a toolstrip with AED buttons.
|
|
|
|
|
Senario:
Dataset is loaded i try to modify and call my webservice save method.
Dataset.tables[0].Rows.Count() is 1.
Once i call the getchanges() i cannot get the changes dataset is null.
What can the problem be.
I tried to call AcceptChanges After loading but still same problem.
SYS_WS sysws = new SYS_WS();
sysws.SaveWindowCompleted +=new SaveWindowCompletedEventHandler(sysws_SaveWindowCompleted)
sysws.SaveWindowAsync((SYSDataset)dsSystem.GetChanges());
;
|
|
|
|
|
Hello.
I'm creating a setup package which is developed by .Net framework 3.5 and I have to include a compelete package of .Net framework 3.5 beside my setup package.
I was really confused because the programe I've developed, is very simple and I've used some simple components like textbox and combobox. but when I want to create setup package, I have to include a package of .Net framework that is about 300mb!
Is there any way to include some parts of .Net Framework that are needed?
Help if you have any idea...
|
|
|
|
|
Including the .NET Framework setup will not work and the user will not be able to use it in the installation. So its better you Ship them sepately and ask the user to install the Framework first and after your Application.
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.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
tanx Vuyiswa.
You are right and I can include .Net framework package in my setup to be installed automatically before installing my setup. but I don't need to include all components those are included in framework package(like web components or advanced services that is supported by framework 3.5).
I've really used textboxes and comboboxes and I've never used some advanced technologies like Ajax mobile service and so on...
the question is: is there any way to include .Net framework 3.5 partially?
tanx again...
<arash>
|
|
|
|
|
saberimanesh wrote: the question is: is there any way to include .Net framework 3.5 partially?
No.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Am very sorry to say this
There is no Way.
Just let your users install the Framework and after your Application Setup. Its not a Pain
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.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
No, there is no good way to do this and definately not a free one. There are tools out there that will include just the required parts of the .NET Framework in your app, eliminating the need to install the .NET Framework, but you need to shell out some serious $$$$ to get them.
|
|
|
|
|
Not unless you're willing to spend upwards of $1000 for the privilege. There're at least 2 companies selling software to do that if you are.
The latest nation. Procrastination.
|
|
|
|
|
saberimanesh wrote: I was really confused because the programe I've developed, is very simple and I've used some simple components like textbox and combobox. but when I want to create setup package, I have to include a package of .Net framework that is about 300mb!
Yes, but if you wrote that program in C++, it would have been a lot more work. And if your program was a lot more complex, your installer would still be 300MB. There's no way around that.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
tanx Christian.
so we should be sorry for microsoft because my exe file is about 50mb and the client who use this pachage, are not familiar to computer as enough as I need...
|
|
|
|
|
saberimanesh wrote: so we should be sorry for microsoft because my exe file is about 50mb and the client who use this pachage, are not familiar to computer as enough as I need...
I'm sorry, I can't make head or tails of this. However, while the framework is pretty bloated, I can see how Microsoft wouldn't bother with the work to break it into sections. Otherwise, when another .NET app tries to run on this computer, instead of checking if 3.5 is installed, it would need to work out if it had all the parts needed. And from the point of view of Microsoft, they just want the whole framework to be out there, anyhow.
Your installer, including the framework, will fit on a CD. Most people have internet bandwidth to download it if they don't have it, you can write an installer that downloads it if needed, so not everyone has to download it. It's not complicated, and it's pretty self evident if you think about it. Microsoft has nothing to gain in complicating the process by breaking up the framework for your convenience.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks alot.
my problem was actually about the size of the package because I'm going to sell it online.
However, would u please give a suggestion about the kind of program that I can solve my problem. I have to convert it to any other languages. I can program with Java-C++-Delphi-.Net-VB and my project is graphical and is about catalog for any occupation.
thanks for ur replies...
|
|
|
|
|
saberimanesh wrote: my problem was actually about the size of the package because I'm going to sell it online.
Well, I'd just do an installer that doesn't include .NET, but downloads it if needed.
saberimanesh wrote: I have to convert it to any other languages. I can program with Java-C++-Delphi-.Net-VB and my project is graphical and is about catalog for any occupation.
Well, if you are scared of the runtime, then you can use C++, and either use MFC and distribute that ( a lot smaller ), or just use the win32 API if you want REALLY small.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Most likely any one who would want to use your software already has .net; so don't worry about it.
On the download page (or whatever) simply state that the app requires .net x.y and let the potential user act as he chooses.
|
|
|
|
|
thanks for ur answer.
the main reason for my question was the size of .Net fw 3.5 package and I was looking for a way not to install that completely and I didn't get any appropriate way.
tanx again.
|
|
|
|
|
i programmatically send and read mail and save the mail into my database.
but i want delete a mail which will delete from my database and also from my mail server.how can i delete mail from mail server???
please help me.
advance thanks
Md Shafikul Islam
|
|
|
|
|
Which mail server are you talking about??
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
linux server using pop3 and smtp
|
|
|
|
|
If you are talking about Exchange server there is a web service of Exchange 2007 sp2,
if you are talking about pop3 mail server you can try connecting to server by simulating telnet from your application and delete mail.
|
|
|
|
|
many many thanks
i am using pop3 mail server i programmatically connect the server and the mail ID but it do not delete the mail would u see the code and answer me the fault.
public MAIL_ERROR Connect(string host, int port, string username, string password)
{
try
{
_conn.Host = host;
_conn.Port = port;
_conn.Connect();
System.Threading.Thread.Sleep(_TimeOut);
return Login(username, password);
}
catch (Exception e)
{
System.Diagnostics.Trace.Write(e.ToString());
return MAIL_ERROR.ERROR_CANTCONNECT;
}
}
public MAIL_ERROR DeleteMessage(int id)
{
if (this._state != POP3_STATE.POP3_LOGGEDIN)
{
throw new MailException("You are not logged into the mail server");
}
string ret = "";
SendCommandSynchronous(string.Format("DELE {0}\r\n", id), out ret, false);
if (ret.Contains("OK") == false)
{
throw new MailException(ret);
}
else
{
return MAIL_ERROR.ERROR_NONE;
}
}
|
|
|
|