|
Hey asif,
I suppose you are looping first and then find the row to delete and then you delete the row.
Please do that...Loop through the grid from backward and then remove the row.
Hope this help..
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
asif, my friend, its quite easy
DataGridView.Rows.RemoveAt(9)
Becoming Programmer...
|
|
|
|
|
how can i make my computer screen finger touch screen responsive
|
|
|
|
|
Using C#, you can't. If you can, it involves buying hardware, obviously. Just buy a touch screen.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello if anyone can please give me just a tiny sample of how I'd do this, not just what to do I will be so grateful.
Just so you know. I have been googling for days on this and I'm not sure what to do as I am still pretty new to c#.
This is what I want to do. I have a dataset and datagrid(search results table) displaying results like this.
Siann Skills1
Siann Skills2
Siann Skills3
I want it to show this
Siann Skills1,Skills2,Skills3.
I have my select statement, then I have created a new datacolumn as I was told to do as below. Now after that, what do I do? How do I get all the skills in one column. I know I have to concatenate, and I have tried searching the net, but I can't find anything useful. is there any possibility for an example?
dgSearchResults.Columns.Add(new DataColumn("skills", GetType()));
|
|
|
|
|
You need to change your SQL so that you generate groups of skills for the one name, then you can render it easily from there.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks but apparently I can't for some reason.
I think I need a for each statement. It is just I don't know exactly what to put in there. I have
foreach (DataSet1.EmpSkillsRow empskillsRow in empskillsDT.Rows)
{
}
Apparently then I have to create an empty string and then another text string and then for each loop fill the particular cell. Basically every time a TechnicalSkillID belongs to the same EmployeeID, then display in the TechnicalSkills column in one cell. No one seems to know how this is done in C#. We all know what to do but not how exactly. Do you know?
thanks kindly really.
|
|
|
|
|
If you're using SQL Server 2005, I'd say this[^] is what you need.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks that looks really useful. I'll try it out. (will prob take me a while to convert it into what i need) but I'll let you know how I go.
|
|
|
|
|
oh I thought I had 2005 but I was just told that the back end is still 2000.
So is there any other option?
Sorry.
|
|
|
|
|
I'm not sure, I'd suggest asking in the SQL forum.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I got a response from the sql forum but I worked it out myself. Let me know if you want my answer.
I have another simple question but I will post a new message.
|
|
|
|
|
How do i change the web browser page with the combobox'd selected item?
|
|
|
|
|
This would best be asked in the ASP.NET forum
only two letters away from being an asset
|
|
|
|
|
I used to be able to find the answer in the help pages for C#, not in ASP.
I'll check anyhow.
|
|
|
|
|
You question involves webbrowsers and combobxes. Web Development or ASP.NET would be more appropriate that C# for this type of question. Read "How to get answers" at the top of this forum.
only two letters away from being an asset
|
|
|
|
|
A while back I was looking for a program that could make cursors so that I could make one to use in a program I was making. I looked all over the internet, but couldn't find a free program that could do this (Well, some were free, but they either watermarked the icon or were only 30 day trials). So I came to the Code Project to see if they had any articles on icon making, and I just couldn't find one. And so I resorted to making a program myself. After about a week I had a good-looking cursor-making program (tell me if you want to see it). I didn't think it was that hard, and now I'm wondering... do you guys think I should write an article on the cursor (and icon, since they're almost identical) file format?
I wish I could drive...
|
|
|
|
|
If you can write an article, and you think others can benefit from it, then go ahead!
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Hi, if I have a URL for an image, whats the best way to load it into an image/bitmap class so that I can modify and save the image to the disk? I can load a web image into a picturebox using the loadAsynchronous method, but this seems a little in-elegant as I do not need to display the picture, just load it and modify it.
Thanks for any help.
|
|
|
|
|
You could use WebRequest[^] to download the image into a Bitmap class
WebRequest request = WebRequest.Create(URL);<br />
HttpWebResponse response = request.GetResponse() as HttpWebResponse;<br />
Bitmap bmp = new Bitmap(response.GetResponseStream());
only two letters away from being an asset
|
|
|
|
|
Usually when I'm joining a bunch of things to make a string, I'll just do like string a = pt.X.ToString() + ", " + pt.Y.ToString(); . I was just wondering if this was considered bad code or something, because any example I see where they are joining things together like this, they use something else besides this. Should I be using something else to join things like this? (Wow that was a lot of "this")
I wish I could drive...
|
|
|
|
|
I sometimes just use String.Format(....) ...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Because strings are immutable if there are several concatenations involved it is better to use StringBuilder[^]
For small efforts I might consider String.Format for readability
only two letters away from being an asset
|
|
|
|
|
For a single statement like that, there is no better method.
The compiler turns that statement into:
string a = String.Concat(pt.X.ToString(), ", ", pt.Y.ToString());
This will allocate a string buffer with the correct size and copies the data from each string to it, so it causes a minimum of overhead.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
You should use a string builder
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|