IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1825.68 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-07-28
[18:48]<drygq>how do i find out (with the onclick event) on what cell a user datagridview?
[18:48]<azyfm>"Not that he was a major character, but Tim Choate also passed away a few years ago. Luckily he's survived by his brothers Zathras, Zathras, Zathras, and Zathras."
[18:48]<drygq>lol..
[18:49]<drygq>how do i find out (with the onclick event) on what cell a user clicked within datagridview?
[18:49]<azyfm>uhm, did you even try intellisense?
[18:49]<azyfm>DGV has a CurrentCell property
[18:49]<drygq>i tried intellisense
[18:49]<drygq>lemme see..
[18:50]<azyfm>and the DataGRidViewCellEventArgs object has a .ColumnIndex and a .RowIndex
[18:51]<drygq>ahhhhhhhh, ok - solved, thanks Arild :-))
[18:51]<azyfm>DataGridViewCell clickedOnCell = grid[e.ColumnIndex, e.RowIndex];
[18:51]<pfjugan>say I have a structure with settings used by various classes and from various threads. where would I declare the variable of that class, in Program.cs?
[18:51]<pfjugan>or a class
[18:52]<azyfm>Why not just use the built-in Settings framework?
[18:54]<pfjugan>can't seem to find anything about it in help
[18:54]<pfjugan>not a single match for settings
[18:55]<azyfm>in the project properties, there's a tab called Settings
[18:57]<pfjugan>I see
[18:57]<pfjugan>can I fill them up during runtime
[18:57]<pfjugan>and change them
[18:57]<azyfm>if scope is set to user, yes
[18:57]<pfjugan>ok thanks
[18:57]<azyfm>but it's generally a framework for persistable settings
[18:57]<azyfm>user preferences, connection strings etc
[18:58]<drygq>im using 'allowusertoaddrows' in my DGV, but after adding a line and then quitting the application / starting it again - the db is not updated
[18:58]<drygq>so i tried -> dgv.Update(); .. without result, what part am i missing?
[18:58]<azyfm>what are you binding to?
[18:58]<drygq>SQLite via ado 2.0 provider
[18:59]<azyfm>I'll rephrase: what kind of datasource is the grid bound to?
[18:59]<drygq>a dataset?
[19:00]<azyfm>right, you'll need to use a dataadapter and call Update on that, then
[19:02]<pfjugan>do you change names of forms, buttons etc to appropriate ones or you just leave them at default name?
[19:02]<azyfm>You find names like Form1, Form2 and button1, button2 in the code of VB6 developers
[19:03]<zyccus>Arild: don't remind me... a co-worker who left recently was fond of such names
[19:04]<zyccus>oh I do that with labels all the time - when they're not going to be accessed
[19:04]<zyccus>never with anything else though
[19:04]<rsdj>hmm, no one who knows how to detect if a socket lost connection (using async sockets)?
[19:05]<zyccus>asmo: you can't - you have to try to read from / write to the socket and see if it fails
[19:05]<zyccus>and yes, it's stupid
[19:07]<rsdj>gah
[19:07]<rsdj>What a lame solution
[19:07]<zyccus>you know who to blame
[19:07]<ymuggt0t0t>yeah there should be a disconnected handler
[19:07]<rsdj>indeed
[19:07]<ymuggt0t0t>lots of .net stuff is underdone
[19:07]<ymuggt0t0t>you cant even ToString a hashtable heh
[19:07]<rsdj>I actually do try to recive (it will get empty packets when the remote end d/c's)
[19:07]<azyfm>sure you can
[19:07]<rsdj>but it dosen't raise an exception
[19:08]<ymuggt0t0t>oh yeah, how do you propose you do that
[19:08]<azyfm>someHashTable.ToString()
[19:08]<rsdj>You can do ToString() on every managed object
[19:09]<zyccus>it's not useful, though
[19:09]<ymuggt0t0t>ummmmmm
[19:09]<zyccus>ToString just gives" System.Collections.Hashtable"
[19:09]<zyccus>what use is that?
[19:09]<azyfm>there's absolutely no guarantee anywhere that .ToString() should be useful or meaningful in any way
[19:09]<ymuggt0t0t>yeah i was about to say
[19:09]<rsdj>So, what's the best way of checking for a d/c with async sockets?
[19:09]<rsdj>Making a background worker that checks or something?
[19:09]<ymuggt0t0t>so just because the method is there, doesnt make me wrong
[19:09]<zyccus>no-one said there should be a guarantee - but sane behaviour would be nice
[19:10]<zyccus>asmo: if you find out, please let me know!
[19:10]<ymuggt0t0t>Hashtable *inherits* ToString from Object, but doesnt have its own version
[19:10]<azyfm>there really is no sane way for a .ToString() to work on a hashtable
[19:10]<ymuggt0t0t>yes there is, you call ToString on the keys and ToString on the values
[19:10]<ymuggt0t0t>look at how python/ruby does it
[19:10]<azyfm>I know how Python does it
[19:10]<ymuggt0t0t>to stringify a dictionary in python you just implement str for your keys/values
[19:10]<zyccus>showing everything in a 'table' would be absolutely fine
[19:11]<azyfm>but in Python, there is a clearly accepted expectation that str(someObj) should be roundtrippable
[19:11]<ymuggt0t0t>roundtrippable ?
[19:11]<zyccus>unfortunately, you can't (yet) break into the existing Hashtable class and fix ToString
[19:11]<azyfm>there is no such thing in .NEt
[19:11]<ymuggt0t0t>you mean without affecting the object?
[19:11]<zyccus>idunn50505: str() presumably means string-encoded-serialise
[19:11]<azyfm>also keep in mind that debuggers display .ToString() on an object
[19:11]<ymuggt0t0t>rikkus: no, thats repr()
[19:11]<azyfm>the expected semantics of a .ToString() method is that it should be very cheap
[19:12]<ymuggt0t0t>maybe they do, but the debuggers works
[19:12]<ymuggt0t0t>I can get the contents of a hashtable in the QuickWatch, i cant using a string function, its stupid
[19:12]<afd>heyyyyyy!
[19:12]<zyccus>maybe the solution is to just make your own global (soon, when you can) inspect() method
[19:12]<azyfm>but no one ever said that ToString() was supposed to give you taht
[19:12]<afd>anyone know how to use xmldoc's cref with generics?
[19:12]<ymuggt0t0t>it doesnt even need to be ToString, there can be a serialize function but there isnt now is there
[19:12]<afd>it rejects both of SomeClass`1 and SomeClass<>
[19:13]<ymuggt0t0t>there isnt ANY way to print the contents of the hashtable in a human readable way period
[19:13]<azyfm>You're the one being stupid, complaining about something not behaving in a way it was never supposed to behave
[19:13]<zyccus>Arild: doesn't matter what anyone said... it would just be nice
[19:13]<ymuggt0t0t>wow ad hominem gg
[19:15]<pfjugan>idunn50505 why not? print it like a tree, with collisions expanding to right
[19:16]<ymuggt0t0t>flounce: no one way to do it without writing extra code
[19:16]<ymuggt0t0t>and thats what libraries are all about, to avoid writing redundant code
[19:16]<pfjugan>oh ok
[19:16]<ymuggt0t0t>they could call it a RenderContents method for all I care
[19:16]<ymuggt0t0t>but there should be a way to do it
[19:21]<currpurjrv>I'm really getting pissed off at Visual Web Developer 2005 Express
[19:22]<currpurjrv>I've got a project built in a previous version of VS that I need to open but the conversion is getting screwed up
[19:30]<gjrvcxnne>how would I go about programatically bringing my application into focus/top-level window?







