|
Hi, I new to C# so I have one question. On my dialog form I placed DataGridView and resize it on whole form. I populate grid with query which returns four rows total. My grid is larger and remaining space is grayed, how to force datagridview to draw empty row's to populate rest of the control?
Also, how to hide first column, the one in which moderators signs is shown (the star, right arrow...) because I'm using datagridview as read only and do not allow any modification upon control?
Big thanks!
|
|
|
|
|
I don't know if the DataGridView supports populating empty rows. If you don't like the grayed space use the BackgroundColor property.
To remove the RowHeaders set the RowHeadersVisible to false .
Eslam Afifi
|
|
|
|
|
It doesn't meter if the color of the remaining space on DataGridView is grayed or some other color. The thing is it looks odd, little bit annoying I should say.
It's more natural to see data table style and no meter if some or all rows are filled. I thought it can be done (and I still do).
Thanks for yours replay.
|
|
|
|
|
hi everyone!
i would like to get all active directory entries for all users.
i know how to get the name for all users in active directory for example.
so lets say a user has 50 entires in ad, then i do have to call them one by one using the property name e.g. "givenname" and so on.
i would like to create a two dimensional array which contains all infos for all users out of the ad.
but i have no clue how to get the property names into an array.
it should be something like this:
List < string > Propertylist = new List < string >();
(the spaces have to be removed in the braces but otherwise it won't show up here!)
Then convert them to an array and use them to write the property to a file. Something like that:
<br />
StreamWriter ConsoleFile = new StreamWriter("adproperty.txt");<br />
<br />
DirectoryEntry entry = new DirectoryEntry("LDAP://DOMAIN");<br />
DirectorySearcher DSearch = new DirectorySearcher(entry);<br />
<br />
DSearch.Filter = "(&(objectClass=user))";
<br />
<br />
foreach (SearchResult sResultSet in DSearch.FindAll())<br />
{<br />
for (int i=0; i < propertylist.count; i++) <br />
{<br />
string value = sResultSet.Properties[PropertyList[i]][0].ToString();<br />
ConsoleFile.WriteLine(value);<br />
}<br />
}<br />
ConsoleFile.Close();<br />
so value will pass through names like "givenname", "title", "company", "mail" etc.
and my array looks like this
user1,givenname
user1, title
.....
user2,givenname
user2,title
......
user3,givenname
etc.
Because otherwise I would have to add one line for each property by hand.
e.g. ConsoleFile.WriteLine(sResultSet.Properties["givenname"][0].ToString());
Does anyone have an idea, how to get all propertys (by name) into a string array to use it in a loop?
I found a way to get the number of them but i found no way to get their names into a string array.
Thanks!
Stephan.
modified on Monday, March 10, 2008 3:13 PM
|
|
|
|
|
closed, i found a solution to this.
if someone is interested in the solution, please let me know.
stephan
|
|
|
|
|
there was just no way no one knows tis so i assumed i lost you for the weekend ( hence the 'move' )
i "know" i did this once long ago, but for the life of me i can neither recall how nor find it on the web. any help would be greatly appriciated. (not sure if it's a IE7 vs IE 6 thing (im that lost))
i have a WebBrowser control on my form and i would like to invoke the "Send page by email" functionality. i tried stuff like
<br />
int WM_COMMAND = 0x0111;<br />
int ID_IE_FILE_SENDPAGE = 279;<br />
m_NullPointer = IntPtr.Zero;<br />
m_hWBShellDocObjHandle = (IntPtr)0;<br />
<br />
HandleRef hr = new HandleRef(this.web, this.web.Handle);<br />
IntPtr ret = SendMessage(hr, (uint)WM_COMMAND, (IntPtr)ID_IE_FILE_SENDPAGE, m_NullPointer);<br />
and stuff like
<br />
web.Document.ExecCommand(......<br />
none work.
please point me the way
|
|
|
|
|
I have a need to create a hook for a C# application. The app writes data on a form via System.Drawing.Graphics::DrawString() method. I need to figure out what it writes to the form and act upon based on that. The application is written by another company, and I have no control over it.
For a Win32 application written in C++, I would create a global CBT hook. Previously I've created Win32 Hook that injects my implementation for TextOutW, TextOutA, ExtTextOutW and ExtTextOutA. I then figure out what is written to the window inside those methods.
Question I have is "is there any way to intercept the DrawString() method call" or is there any other way to accomplish what I need to do?
Any help you can provide will be greately appreciated.
Thank you.
|
|
|
|
|
I don't know it will work for you, but I've heard TypeMock.NET can intercept method calls to anything.
You can also check out PostSharp[^] or other IL-weaving/Aspect-oriented-programming tools to intercept method calls.
|
|
|
|
|
I need to figure out what is written via DrawString() on the form without changing behavior of the application. Which means that I must call DrawString() my self after intercepting the method call. However, TypeMock.NET does not seem to let me do that. I am very interested in how it figures out injection point and injects a Mock type, though.
PosSharp seems to require source code, which I do not have.
|
|
|
|
|
Hi All,
I have a question regarding C# data structure.
My scenario is following:
I have a file that contains millions of today's viewing records(>2GB). What I need to do is -- for each viewing record, I need to find/search the matching viewing record from yesterday's file ( these viewing files are created daily ). Using SQL Server is just too slow for this( and I just need to find one matching record among millions ), and the files are probably too big to load into memory. What is the best approach to balance memory and speed? Any suggestion would be much appreciated.
|
|
|
|
|
I don't think you can beat SQL Server.
Alternatively, you could make your own indexing system for the files.
|
|
|
|
|
cheq326 wrote: Using SQL Server is just too slow for this
SQL is to slow for this --- for what it is designed to do?
Seriously, anything you do won't beat SQL.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Justin Perez wrote:
Seriously, anything you do won't beat SQL.
I can think of specialized ways to outperform SQL, especially if the records aren't in SQL to begin with. The question is whether it's worth the money (and time) to do it.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I'm no database guru, but isn't this exactly the kind of thing you'd want to use SQL server for?
Standards are great! Everybody should have one!
|
|
|
|
|
cheq326 wrote: Using SQL Server is just too slow for this
Have you tried defining some indexes? If the database is designed properly there shouldn't be a performance problem for this.
Loading a file with that much data is going to be very costly in terms of memory use and performance as well.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
If a Relational Database is to slow for you then you better give the job to Google
led mike
|
|
|
|
|
Maybe I didnot state it clearly enough. I am looking for something like a HashTable, where I can find the record with a provided key, so that I dont have to join tables and then do a select statement to select that one record from the DB.
I personally have not tried the SQL Server method cuz I was told that it was too slow for the task(The team has tried it before). Is there any data structure out there that might fit this scenerio? or SQL Server is the only way?
|
|
|
|
|
cheq326 wrote: or SQL Server is the only way?
Of course not. It is however the best conventional method.
cheq326 wrote: I was told that it was too slow for the task(The team has tried it before)
From my experience I would want to confirm that. If they already did a research project to look at that approach you should be able to look at the project and run it etc. You may find that that they did not do something as simple as creating the appropriate index(s) to support the requirements.
Also what about the hardware, OS and Database tuning? Perhaps the machine was not appropriate to the requirements. If you have 2 gigs of data then you could use a large server (memory and processors) and possibly configure the Database to use enough physical memory to keep the records in memory at all times. I don't know squat about tuning a Relational Database and possible the OS to run one, but I would find an expert and exhaust that approach before I jumped into considering anything else.
led mike
|
|
|
|
|
Hi,
I would like to get the value of a cell in a datagrid. I tried the ff code but it gave me an error:
string value = dgOutput.CurrentCell.Value.ToString();
Please help.
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
What was the error?
Maybe check to see if the currentcell value is null?
string value;
if(dgOutput.CurrentCell.Value == null)
{
value = "null";
}
else
{
value = dgOutput.CurrentCell.Value.ToString();
}
|
|
|
|
|
If you want to access a cell other than the currently selected
dgOutput.Rows[rowindex].Cells[columnindexORname]
Eslam Afifi
|
|
|
|
|
Not sure if this is 100% the right place but...
A year ago i released and app using clickonce and a test certificate. I have just made a change and found that the certificate had expired, so i created a new one. Now none of the users can use the app (it trys to download the new version on startup) unless i uninstall and reinstall. This is not a good option as most of our users are on remote sites
How can I get round not having to reinstall it for everybody?
|
|
|
|
|
I'm not sure. I'd try posting this question at the MSDN forum for ClickOnce.
|
|
|
|
|
Hi,
I want to open a Word(.doc) document in a Multiline textbox. Is this possible?
Thank you
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
Illegal Operation wrote: I want to open a Word(.doc) document in a Multiline textbox. Is this possible?
Not directly.
You would have to write code to read the contents of the word file then transfer it into the text box.
|
|
|
|