|
I want to add a new line to one of the Datagrid Column Value.
How do i do it
Suppose i have Mike and Bond
and i want Mike and Bond in different lines but in the
same column.
Thanks
Kal
|
|
|
|
|
Hello
Correct me if I'm wrong, but I don't think it's possible.
Regards
|
|
|
|
|
You can set DefaultCellStyle.WrapMode = DataGridViewTriState.True.
So, you can enter value to cell as "Mike" + Environment.NewLine + "Bond".
BUT, in this case if some other cell width is small its value will be wrapped as well.
To avoid this you can leave DefaultCellStyle in its default value and set individual cell's style only.
Vitaliy Tsvayer
Tikle
|
|
|
|
|
Hello,
I have a project in Visual Studio that references some external "Debug" dll's. It works fine in "Debug" mode.
I want to rebuild this project in "Release" mode. Visual Studio complains that it cannot find the "Release" version of those external dlls. When I try to add the "Release" version of that external dll it complains that a reference to this dll (Debug version) already exists in this project. Replacing the the "Debug" version of the external dll with its "Release" version lets me rebuild my project in "Release" mode.
I was wondering if there was a way around this, instead of switching the versions of the external dll's I use (between "Debug" and "Release") everytime I want to do a "Debug" or "Release" version of my project.
I've never seen this before, it usually just finds the right dll by default. It suprised me.
Thanks and Regards,
Ramanan
"One of the Georges," said Psmith, "I forget which, once said that a
certain number of hours' sleep a day--I cannot recall for the moment how
many--made a man something, which for the time being has slipped my
memory."
|
|
|
|
|
Hello
AFAIK your project shouldn't care if the version of the external dlls is debug or release. Did you make these dlls?? Maybe you referenced them by the project?? Try cleaning things up:
1- BACKUP YOUR PROJECT -sorry for the uppercase;)-
2- Remove all references to the dlls
3- Copy only the dlls files to your project's folder
4- Reference to the new dlls in your folder
5- Make sure "Copy Local" property is set to true
Regards
|
|
|
|
|
I am looking for a good tutorial for C# for the web, for someone that has never touched an ounce of C code in his life (ASP, VB, HTML, some Java). If anyone knows any that are useful, and have been in the same situation I am, please post them here. I have a book and have been going through it, but I'm still not grasping the fundamental and required things a C# wep-page should be built around; any tutorials that compare C# to ASP or HTML and teach it comparitively would be wonderful. Thanks in advance!
Jesse "Soot" Myer
jessemyer06@aol.com
|
|
|
|
|
Hello
If you want general lessons about C# try This link[^]
If you want only web development Try these videos[^]
For more google for "C# tutorials"
Regards
|
|
|
|
|
I have a dataset of items (UPC, price, quantity, name) that I would like to combine based on like items. For example, all items with the same name, I would like to combine so that the quantity and prices are changed accordingly. Are there any built in functions that will let me do this? Or do I have to create a routine which will sort the dataset, create a new set, and then go through the old dataset and combine like items and then add to the new dataset?
thanks!
|
|
|
|
|
I guess this would be more of a datarow combining/merging question./..
|
|
|
|
|
Hello
jeweladdict wrote: Are there any built in functions that will let me do this?
Well, maybe you're talking about Stored Procedures?
Anyway, here is an approach to do something like what you want -even though I don't like it but I can't really think of something better-.
1- Make a datagridview and feed it with your table
2- Sort it according by the name -if that's what you want
3- Iterate through the rows comparing each row with its previous one -except the first row of course-
4- Find similar rows and combine their values, then delete the second one
NB. You don't have to make the DataGridView visible to the user
Please, if someone has a better approach post. I believe there should be a better way. but this should work!
Regards
|
|
|
|
|
that works like a charm. Thanks!
|
|
|
|
|
Hello
An Even much better approach is to use the DataView class instead of a DataGridView!! Sorry that such a simple solution didn't cross my mind , I've been awake for almost two days now!!
Regards
|
|
|
|
|
I am using a datagridview control. I want to select multiple cells that contain numbers and add them. What would be the best way to do this?
Thanks.
|
|
|
|
|
Hello
int Sum = (int)MyDataTable.Rows[RowIndex].ItemArray[Index].Value + (int)MyDataTable.Rows[SecondRow].ItemArray[SecondIndex].Value;
And so on...
Regards
|
|
|
|
|
If I understand you right, you use DataGridView control with MultipleSelect set to true and when you select some cells you want to add numbers within them. To do that you can handle SelectionChanged event like below:
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
foreach (DataGridViewCell cell in dataGridView1.SelectedCells)
{
}
}
BUT, be carefull to check whether selected cells has an integer value!
Vitaliy Tsvayer
Tikle
|
|
|
|
|
Thanks for your help. That worked great.
|
|
|
|
|
??
A strange request i know, but there it is.
|
|
|
|
|
You're kidding, right? Or am I missing something? I hope you're asking if it's divisible by 9.
if( str.Length % 9 == 0 )
return true;
else
return false;
Or the old way:
if( (float)(str.Length / 9) == (str.Length / 9.0) )
return true;
else
return false;
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Yeah, sorry divisable.
Well the keys are next to each other arn't they?
|
|
|
|
|
Hello, I have a problem and may be you can help me. I've a DLL in a WS and the same DLL in a winform. I need to invoke a WS method that return for example a Person object, from the winform. The problem is that it can't convert the WS.Person to the DLL.Person. How can I convert that type? I try to cast but I still the errors.
Thanks a lot !!
|
|
|
|
|
What error do you get?
Vitaliy Tsvayer
Tikle
|
|
|
|
|
The error is Cannot convert the type WS.Person to Dll.Person
|
|
|
|
|
|
Well, first let me explain the reason of this problem.
When you add WebReference to the WebService, proxy class is created with all the types that come from WSDL(generated by ASP.NET for your WebService). BUT, although generated classes have the same fields as your original class from DLL, they are abolutely different entities, that is why you cannot cast from WS.Person to DLL.person for instance.
One of the solutions would be to modify the generated proxy class so that return type of the WebService method is the class from your shared DLL and not generated one. You need to modify Reference.css under Web References.
Another solutions is to write code that takes WS.Person class and creates new DLL.person class by copying all the fields, etc. You could use reflection to shorten the code as all field names are the same in both types.
Maybe there are more elegant solutions, but hope this helps.
Vitaliy Tsvayer
Tikle
|
|
|
|
|
Hi,
In the Font object I can see no way to retrieve the filepath for a font. (I need to do this as some third party loads fonts from the filepath).
My knowledge of the Win32 API is very scratchy. Is there anyway I can retrieve the filepath for a font in .NET or is there a method on the Win32 API I can invoke to retrieve this information.
Thankyou
|
|
|
|