|
I have a datagrid showing 200+ records, if user scrolls down to select a row that is off the initail screen, can I set the datagrid to show that part of data around the selected row to avoid user using scroll bar again and again.
Thanks,
|
|
|
|
|
If I understood well, you want to be able to scroll the DataGrid to a certain position.
DataGrid has some protected members that you can use to handle scrolling: VertScrollBar, HorizScrollBar, GridVScrolled, GridHScrolled.
For vertical scrolling I recommend you to do something like this:
public class MyDataGrid:DataGrid
{
public void ScrollToPos(int position)
{
ScrollEventArgs sea= new crollEventArgs(ScrollEventType.ThumbPosition,position);
this.GridVScrolled(this,sea);
}
}
Best Regards,
Daniel Zaharia
|
|
|
|
|
Thanks a lot, your method is working fine. I just put the row index as the position parameter.
Appreciate!!!
|
|
|
|
|
Do any know how to impliment adding a computer to domain using C#. I know you have to import System.Directory.Services.dll Can you please help
thanks
CJ
|
|
|
|
|
Try something like the following:
string domain = ...;
string newComputer = ...;
string groupName = ...;
DirectoryEntry deDomain = new DirectoryEntry("WinNT://" + domain);
DirectoryEntry deNewComputer = new DirectoryEntry("WinNT://" + domain + "/" + newComputer + ", computer");
DirectoryEntry deGrp = deDomain.Children.Find(groupName, "Group");
if (deGrp.Name != null)
deGrp.Invoke("Add", new Object[]{deNewComputer.Path.ToString()});
deGrp.CommitChanges();
|
|
|
|
|
Thanks so much
|
|
|
|
|
I'm starting an application with windows Forms. I know how change the current Culture and since this action every resouces that open, take the new Culture Value( System.Threading.CurrentThread.CurrentUICulture = new Globalization.CultureInfo (String * IdCulture) (...) )
OK that's right, but what happens with the Main Form that is Loaded since the start of execution?
Can I do a Reload or something like that, by anyway, or assing dinamically another ResX File to the MainForm for translate it without Close()?
Advanced thanks, gurus. I expect your answers
|
|
|
|
|
Instead of putting this code in the constructor or something else that initializes controls (default for forms designers), put it in a separate method that re-instantiates the ResourceManager and assigns the localized strings / objects to the respective control properties.
You can also create a ResourceManager for a specific culture rather than setting the current thread's UI culture, but this usually a good idea to do anyway.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'm starting an application with windows Forms. I know how change the current Culture and since this action every resouces that open, take the new Culture Value( System.Threading.CurrentThread.CurrentUICulture = new Globalization.CultureInfo (String * IdCulture) (...) )
OK that's right, but what happens with the Main Form that is Loaded since the start of execution?
Can I do a Reload or something like that, by anyway, or assing dinamically another ResX File to the MainForm for translate it without Close()?
Advanced thanks, gurus. I expect your answers
|
|
|
|
|
I have some code
hehehe
How can I use Explorer control to display it? And how can I add some images in this control in run-time?
Thank u very much ![Rose | [Rose]](https://codeproject.freetls.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
1) Create a new C# Windows application
2) Go in the Toolbox, right-click, add a new item. Choose the "COM components" tab, and select the "Microsoft web browser" (shdocvw.dll)
3) drop the web browser onto the form
4) select the web browser control
5) show the Properties window, click on the laser icon to show all events
6) in front of NavigateComplete, add an event handler, for instance : OnNavigateComplete.
7) go back in the solution tree, right-click and add a reference, browse then choose "Microsoft HTML document" (mshtml.dll)
8) open the C# code
9) add the #using mshtml; statement at the top
10) in InitializeComponent(), add the following code :
object o = null;
Show();
axWebBrowser1.Navigate("about:blank", ref o, ref o, ref o, ref o);
Then, implement your event handler like this :
private void OnNavigateComplete(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
{
IHTMLDocument2 doc = (IHTMLDocument2) this.axWebBrowser1.Document;
doc.body.innerHTML = @"<img src='http://www.arstdesign.com/iconpdf.gif' border=0>";
}
As you can see, the event handler is only here to temporize before the Internet Explorer instance is up and ready. Once it is, we add the html code to render with a simple doc.body.innerHTML statement.
Good luck!
RSS feed
|
|
|
|
|
Thank u very much for your attention. Your help is very userful for me.![Rose | [Rose]](https://codeproject.freetls.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
include icon of the file-type, application that will be invoked when user run that file-type.
thanks.
|
|
|
|
|
|
|
I'm looking for book recomendations for developing against Active Directory with C#.
I've gone through the DirectoryServices namespace documentation in the MSDN library, but it falls short in covering the directory entry properties, etc... or I just haven't been looking in the right place.
Any good books or web references would be appreciated.
Thanks,
Jim
|
|
|
|
|
Hi, I have been trying to look in the msdn library, but found nothing, maybe because i dont know what i am looking for. If you know how to obtain a list of computers in a domain, it would be helpful if you told me, or told me where to look.
Thanks
|
|
|
|
|
In most cases, you can P/Invoke NetServerEnum in the Network Management API. There's no native way in .NET. You could possibly, however, use classes in the System.Management namespace to query WMI if you have an AD WMI provider. I can't remember off the top of my head if one comes with NT by default or now, or if it even exists. That's really about the only way without P/Invoking anything.
You can also use a slew of AD functions, but that will include P/Invoke functions and redefining structs and constants when needed.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Did you check out the System.DirectoryServices.DirectorySearcher class? Looks like it uses ADSI to do its dirty work. Good luck.
Thank you.
Jeff Varszegi
|
|
|
|
|
How can I make so happen? and how can I contact the "popserver" through my code?
please help...
Sashy
|
|
|
|
|
Check this control out http://www.codeproject.com/internet/cpop3conn.asp?target=email#Retrieve
You might also want to search a bit more on codeproject, as there are lots of pop3 apps.
|
|
|
|
|
Well i am not an very experienced programmer i think i might need to take a look at an application using this. And can I use those principals specified in the artical???..cause I´m not working on a .NET application, but an Windows appl?
thanks for your response! 
|
|
|
|
|
First thing: pick up a book on programming in C#/.NET. You'll definitely need it because this isn't a drag-n-drop solution and real skill is needed.
Second thing: C# (Csharp as you called it) only targets the .NET Framework. If you don't understand this, you're bound for trouble. You should not only read a good book on this but look over the first few topics in the .NET Framework SDK documentation to understand what .NET is.
Programming isn't something you can just jump into with any decency. If you want to learn, start basic. Creating an email application - especially one that uses specifications like POP3 - isn't an easy task. Start simple like just creating a simple Windows Forms application with a toolbar and some controls and make it do something.
CodeProject here offers a lot of articles for newbies and experienced developers alike. These forums are great for asking questions if you don't understand something in the documentation, but you should at least check the documentation first. Being able to research a problem is very important in any field - especially in programming. It's also a good idea to look over the .NET Base Class Library (BCL) to see what's available because there's a lot of things that can help, although nothing will solve your immediately problem directly.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
hi,
i want to build a sql statement like following using DateTime field in where clause. but, it return invalid format.
strcmd = "select * from table_1 where datentime = '11/12/2003 17:45:34'";
// where type of 'datentime' is DateTime.
any method to convert a DateTime variable in C# into DateTime field in MSAccess?
thanks,
jim
|
|
|
|
|
AFAIK, you should be able to use the same standard date format as in SQL Server. What about this?
strcmd = "select * from table_1 where datentime = '2003-11-12 17:45:34'";
Thank you.
Jeff Varszegi
|
|
|
|