|
|
|
Before using MVC it should be clear concept of model view controllar..
For best practic you must read MVC patterns then implement.
Naresh Prakash
|
|
|
|
|
i want to aply client side validation on the gridview for that i want to retrive the values of template checkbox of gridview how i can get the values of check boxes in a java script function
|
|
|
|
|
I have a generic list List<classname> and I want to pass it to another method which does not know the type of the list. I have tried List<object> to no avail
<br />
private void GetList()<br />
{<br />
List<clsproduct> Products = oProd.GetRecordList(-1);<br />
lvLoadList(lvProd,Products)<br />
}<br />
<br />
private void lvLoadList(ListView oLV, List<object> oList)<br />
{<br />
}<br />
</object></clsproduct>
This code that fails with invalid argument
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: which does not know the type of the list
Then you can make that method generic.
private void lvLoadList<T>(ListView oLV,List<T> list)
{
....
} Now you can write
List<Product> Products = oProd.GetRecordList(-1);
lvLoadList<Product>(lvProd,Products) Mycroft Holmes wrote: This code that fails with invalid argument
Because List<Product> is not List<object>
|
|
|
|
|
N a v a n e e t h wrote: Because List<product> is not List<object>
You've confused me there. Product is an Object . Everything is an Object (well nearly everything ).
Of course Object is not a Product . Is that what you meant?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: Product is an Object. Everything is an Object (well nearly everything Smile ).
Of course Object is not a Product. Is that what you meant?
No. List<Product> is not List<object> . List<Product> is a collection of products and List<object> is collection of objects. I mean, both will be considered as different types even though product is derived from object.
Still confusing?
|
|
|
|
|
N a v a n e e t h wrote: Still confusing
No.
The light-bulb came on a split second after I hit the post message button. I was too embarrassed to modify the post.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
For more information on how generics works on .NET, check this[^].
|
|
|
|
|
Covariant interfaces in C# 4.0 attempt to address this problem - you can write IEnumerable<object> v = new List<string>();
Regards
Senthil [MVP - Visual C#]
_____________________________
My Home Page |My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Yeah that's cool. I forgot that
|
|
|
|
|
Thanks Navaneeth, I now have a generic listview loader from a List<t>. Not sure of the benifits of generics over datatables yet but working on em!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Not sure of the benifits of generics over datatables
Type safety. That's the biggest advantage.
|
|
|
|
|
Hah you're talking to an ex VB dev here, type safety indeed.....
Everythings a variant, that's theway to go.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I am currently developing a program in VS 2005 C#.
In the program, it shows a live video on a sequence of IO (cylinders, sensors) actions.
The live video is being displaying with a PaintDelegate thread and a callback that I copied from the sample program of the frame grabber manufacturer.
And the sequence of IO is being performed with a backGroundWorker, in which the sequence repeats for 5 times with a for loop.
After leaving the program to run for more than 24 hours, it is noticed that the live video will freeze. After checking with the frame grabber manufacturer, I was told that their sample program should have no problem to run a non-stop live video for 24/7.
So now, I am kind of suspecting that it is the problem with the backGroundWorker, with its resources keep accumulating until it occupies the whole memory of the CPU.
In this case, how should I solve this problem? Should I do a backgroundWorker.Dispose();
every time?
The tool tip on backgroundWorker.Dispose(); says that it releases all resources used by the System.ComponentModel.Component.
What does it means by all resources? Are the boolean type flags considered as the resources too?
If the boolean type flags are released, what state will they become after the .Dispose()?
|
|
|
|
|
There could be a lot happening. I would just try to dispose of everything that you can afford to (dispose anything you are done with for a bit or period). That should rule out memory leak type issues.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Dear All,
I am using Data Grid control and want to edit record in data grid by selecting one record and clicking on edit button all data should appear in text boxes like data is
name
class
address
all information should come into different text boxes when select one record in data grid and click on edit button.
Thanks in advance.
Sajjad ali
|
|
|
|
|
ASP.NET has a very good example of this on their site. The principle is close for a windows app if you are doing that.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
yes i am using window application
then what you will suggest .
Thanx
|
|
|
|
|
Then you are using a DataGridView - get it right and it is easier to fix.
Bind your DGV to the table and bind the text property of the textboxes to the relevant fields of the table.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
yes i am using DataGridView when i code like
Text.Text1 = dgvStudinfo.item.add(0,0).value
to add value to text box this code i done in vb.net but c # not supporting it.
this is the confusion.
|
|
|
|
|
I assume you have bound the dgv to a datatable. So do this for your textbox
Text1.DataBindings.Add(new Binding("Text", oTable, "ColumnName"));
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Dear i am sorry to say i am not understanding what you suggest and please send me code with description.
Thanks
|
|
|
|
|
Sajjad Leo wrote: please send me code with description
Mycroft has already given you the code.
If you do not understand it, then google or use MSDN to look up the parts you don't understand.
If you just use code 'given' to you by other people, you will never make a programmer. Do a little work!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|