|
thanks ... that's what I wanted in the first place.
modified 30-Nov-21 21:01pm.
|
|
|
|
|
try using the split instead of the trim
|
|
|
|
|
was using C# to parse
if any one has prior experience.
|
|
|
|
|
|
What exactly is the question? I can't make anything useful of the two posts you created in this thread.
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hi,
I know its last thing on a Friday but I hope someone can help.
I need to loop through every cell in a datagridview and make sure that each value is not null.
Looping through the cells isn't a problem (I don't think), I used a for loop with another nested inside, the inner loop taking care of the column index and the outer loop holding the row index.
What I can't do is check the contents of each cell as there is no suitable method in DataGridCell.
Please can anyone help?
Thanks
Scott
The loop code used if anyone is interested.
for (int i = 0; i <= rowCount; i++)
{
for (int j = 0; j <= colCount; j++)
{
DataGridCell dgc = new DataGridCell(i, j);
}
}
Scott
|
|
|
|
|
Are you looking for something like this...
grvMain.Rows[0].Cells[1].Text;
I hope this helps. I have worked quited a bit with gridviews so let me know if I misunderstood your question. If you have controls you are attempting to check in the cells it should look more like this...
((TextBox)GridView1.Rows[1].FindControl("txtProviderID")).Text.
Regards
|
|
|
|
|
I am trying to get data from the DataView in my form and put in a variable, preferably a string, that I can put manipulate and put into a document. My problem comes when I try to get the data from the DataView. Also, is there any way to configure settings so that users can only select the whole row, not individual cells?
-Fred
|
|
|
|
|
As far I can remember, in order to get a cell value you can use following snippet but please verify spellings with intellisense as I just typed from my memory.
string a = instanceDtataGridView.Columns["columnName"].SelectedRows[0].ToString();
To Select whole row, you can set the "Selection Mode" property of Datagrdiview, choose "Full Row Select". Again, I just typed the property name from my memory, you can find out easily about this property in the property editor of gridview.
Emran
|
|
|
|
|
I asked this a few days ago, but still haven't received a good answer.
How do I open an external application in a form? For example, I have a form called Form1. I want to run Foo.exe INSIDE OF Form 1. An answer to my previous quote understood it to be the equivalent of an IFrame in html. This sounds about right. But there's gotta be a way to do it in C#!!!
I know now that you can view .pdf's in a form, so it must be true you can open any application in a form...
Please help!
John
|
|
|
|
|
JohnBond311 wrote: I know now that you can view .pdf's in a form, so it must be true you can open any application in a form...
Not true at all. Some applications don't even have a user interface, to start with. Most applications have their own form, and you can't open a form in a form.
The application has to be created specially for being used as a component in a form.
---
b { font-weight: normal; }
|
|
|
|
|
JohnBond311 wrote: but still haven't received a good answer.
Perhaps, but you've probably received a 'right answer'. We don't change the laws of software here, we just report on them.
JohnBond311 wrote: so it must be true you can open any application in a form...
That's an astounding leap of faith. I know it's possible to buy real estate, therefore I should be able to buy the Grand Canyon. That's what you just said.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
JohnBond311 wrote: I know now that you can view .pdf's in a form, so it must be true you can open any application in a form...
No, the reason you can view a pdf in annother app is because Adobe wrote a pdf reader COM component and that component was then embedded into the application. The PDF viewing is not due to the stand alone acrobat reader being embedded.
|
|
|
|
|
Everyone else might shoot me for this...
But, it's "kind of" possible. Not every application will support this and this is by no means(!!) a supportable solution, so don't even think of selling this to a customer or doing a company-wide deployment with it.
You have to launch the application you want to "host" first, then wait for it to create it's parent window. Once created, you have to use the Win32 API functions FindWindow, FindWindowEx, or GetWindow to get the window handle of the main form of the target application. Once you have that, you can call the API function SetParent[^] and the window handle of YOUR host window to re-parent the application window into your own form window. If you want to move that hosted window around in your form, you'll have to call the API functions, like SetWindowPos, to move it around and resize it.
KEEP IN MIND THAT THIS IS NOT A SUPPORTABLE SOLUTION!! IF YOU USE IT AND HAVE A PROBLEM, WE'LL DENY WE EVER TOLD YOU ABOUT IT!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
*grin* See, we didn't tell him that because we knew he would ignore the caveats.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hence, the very large disclaimer! :->
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for your response. It's nice to get a response that that doesn't assume I'm an idiot. Seriously, was all the sarcasm necessary? I don't feel it's appropriate to belittle someone when they have a valid question. Of course I left out the details of viewing a pdf (I knew it was due to a COM component), but that doesn't mean I didn't know the details.
But thanks, Dave Kreskowiak. I will use your suggestion... and don't worry, this is just for my own computer.
John
|
|
|
|
|
Most people don't know about this little trick. Hell, I didn't know about until about 3 months ago. I've found it has limited uses, such as, what happens when the user quits the application? Test your code thoughly through every possible action.
The number of quality questions comming from people that "have a clue" is pretty low. I'd say the number of questions that we get from script kiddies, newbies, and wannabes, trying to do something WAY beyond their skills/understanding of Windows, is about 15x that of people who actually have any kind of clue about how Windows works. Next time, I'd recommend differentiating yourself from "the crowd" by putting a little blurb in about your experience and what you think you have to do to get something to work.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Good advice, thanks.
As far as your suggestion, SetParent works great for making a window a child of another window of the same application (for example, you can parent a notepad window within another notepad window), but it appears that cross-application parenting doesn't work with this method. Thanks for your suggestion though, I really appreciate it.
Any other ideas out there, supportable or not?
John
|
|
|
|
|
Like I said, it's of limited usefulness and doesn't work for all windows/applciations. But, it's the only solution out there. The only other way to do it is if the application you want to "host" has a COM component you can use.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: The number of quality questions comming from people that "have a clue" is pretty low. I'd say the number of questions that we get from script kiddies, newbies, and wannabes, trying to do something WAY beyond their skills/understanding of Windows, is about 15x that of people who actually have any kind of clue about how Windows works.
Im not like that am i? i ask quite a few questions... not like this but y'know...
|
|
|
|
|
JohnBond311 wrote: Seriously, was all the sarcasm necessary? I don't feel it's appropriate to belittle someone when they have a valid question.
I don't really think that someone tried to belittle you, you only got replies to the question that you asked. Perhaps the replies were way below your knowledge level, but not below the level that you showed in the question. Judging only from your original question, you seemed rather clueless about components and how applications work.
Also the comment about not recieving a good answer to your previous post did make you look like someone who asks things that is impossible, but not being content with the answer that it's impossible asks the same question over and over.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: Perhaps the replies were way below your knowledge level, but not below the level that you showed in the question. Judging only from your original question, you seemed rather clueless about components and how applications work.
Agreed. In the future I will try to explain myself further in detail. I posted in haste earlier, hoping for a quick answer. I was offended by the Grand Canyon remark, and I still fail to see the benefit one would receive from such a statement. But as I said, next time I'll be more thorough.
Guffa wrote: Also the comment about not recieving a good answer to your previous post did make you look like someone who asks things that is impossible, but not being content with the answer that it's impossible asks the same question over and over.
Again, haste is to blame. I shouldn't have used "good" and I meant to thank the persons who initially responded. I started this new thread because my old one had been buried under all the new posts. I did not intend to give the impression of asking over and over. I am happy with the responses from this post, aside from the Grand Canyon remark.
Although, I'll admit it is a rather funny analogy.
John
|
|
|
|
|
JohnBond311 wrote:
Agreed. In the future I will try to explain myself further in detail. I posted in haste earlier, hoping for a quick answer. I was offended by the Grand Canyon remark, and I still fail to see the benefit one would receive from such a statement. But as I said, next time I'll be more thorough.
As Dave's said the large majority of new posters are relatively clueless, and that fair or not anyone new to the board tends to be percieved that way until they demonstrate otherwise. I'd no idea Dave's solution existed, and your pdf example using a technology that wasn't generalizable made you appear less skilled.
|
|
|
|
|
I need find out how to create a virtual partition in C# (or if it's impossible, in C++). So WinXP should think there is one more partition on my hard disk, or that there is another hdd connected or smth. I need to be able to load the actual partition the same way daemon tools load the iso images, from a file...
How do i do that? Any clues?
Thank you.
bunny EATING rabbit
|
|
|
|