Computer problems,Computer help
*AX SOFT>>>Programming & Design

ASP ==>grid views?


In a normal way gridviews are binded to a datatable, but since i want to use my business logic layer (BLL) I want to use objects of my classes. Is there any way to bind my gridview to an array of objects?

Yes, you can. The DataSource property in .Net 2.0 and up can accept anything with an IEnumerable interface, and it will use your public properties to auto-populate columns. E.g.

List<MyBusinessObject> myList;
dataGrid.DataSource = myList;

Arrays implement IEnumerable, so it should work too.

If you want automatic support for inserting, deleting, etc. you'll need to look into the IBindable interface.

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • PLEASE HELP me start writing this PROGRAM in JAVA?

    Damn that's a large program. Might I ask what it's for? So, unless you are familiar with event listeners and things that respond to user input using the keyboard, I recommend you plac...

  • Help with a very simple C# code.?

    Bashar Y was almost there :) but it's a little different. In C# it would be: textbox1.Text = this.Width.ToString(); or Height of course, like he said. Make sure you don't forget T...

  • BlueJ (java) help! due today!?

    System.out.println("Does not look easy, may be you can contact a java expert live at website like ...

  • I hate movie maker...?

    Press cntrl-alt-delete and go to task manager.... close everything. Then, open the file. if this does not work, u saved it on a corrupt file or something.

    ...
  • Help with C++ please! my program is not working why? please help me! To start with, i get alot errors...?

    I can't quite understand your assignment. It sounds to me like what you are supposed to do is collect the number of registrants for an unknown number of companies, calculate each company&#...

  • I'd like to add to my tech related blog. What articles and tutorials etc would you like me to write about?

    Isn't it great how no one bothers writing a serious answer? I thought it was a good question actually. Maybe our blogs could complement each other? Cross linking, commenting on each other'...

  • I want a topsite script for my website. I was wondering if anybody could recommend a good free one?

    Hi there, Aardvark has a nice free topsites script, however I don't about integrating it into your wordpress theme. It does have fully customizable skins so I would think it wouldn't b...

  • Website Layouts?

    Well, I think I stumbled upon your question because it had the word "WordPress" in it... but you might like this site anyway. It has some pretty impressive "skins" not just for ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster