i need to know what control in asp .net 2.0 to use to get this layout:
i need to display 8 videos at a time using 2 rows with 4 columns, but the control should also have paging (to display 8 items per page).
i've thought of using a formview but the paging for formview is per one article content / datarow only.
i'm also thinking of using gridview but i am not so sure if i can get this layout.
any thoughts please.. very much appreciated.. thank you!
For the above scenario i think yo can make use of DataList control of ASP.NET which can help you to make the controls in columns and rows order. You will have to create a Paging Programatically.
I am giving you the link which can help you to create a paging with Repeater Control.
Preferred: http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=345
http://www.developer.com/net/asp/article.php/3646011/ASPNET-Tip-Creating-Paging-for-a-Repeater-Control.htm
http://www.codeproject.com/KB/webforms/Aspnet_Repeater_Control.aspx
Related
I manage a project and as you know asp.net has many types of data control, I am confused which control should be used in what condition. Which is better control in what situation. Should I still use repeater control because grid view is advance control.
A repeater allows you to have your items repeated both horizontally and vertically unlike a GridView which only by default repeat the items vertically.
The best way to understand the two is if you need a simple grid displayed use a gridview.
If you need to do additional formatting or display data from the database with additional graphics, labels, not in a grid type form than use a repeater. You can easily adjust the repeater to by as dynamic as you need it to be where as a grid view is a simple grid.
With a repeater you will click on the page SOURCE of the .Cs or .vb file and you will see 4 templates. Anything HTML you put in those templates will repeat with the data.
Around 2010 I ran into so much trouble with the GridView, I asked a (now former) Microsoft evangelist for advice. He strongly recommended not to use the GridView ever. Then I stopped and life got easier.
I need a gridview such that when I click on a row to edit it, the data shows in a formview within that row. The user can then make updates within the formview. I am not able to find a suitable example that can do something like this. Can somebody please point me to an appropriate example that does this.
Note that I am using ASP.NET.
Thank you.
Here is an example from Kendo , You can download and use their tools for free with limited support.
Kendo Inline Editing Grid for ASP.Net
I am trying to learn about ways to layout my data from a database using ASP.NET and C#
I can layout my data without any problem in rows using things like the GridView control, as the below image illustrates.
However I want to layout all of the information that would normally be in 1 row, in 1 cell.
So for example, each row would have 3 cells, each cell containing all of the information from 1 database row, as the image below illustrates.
Is there any way to do this with the existing ASP.NET controls, for example with a Gridview, or do I have to just build the table myself?
Any help would be greatly appreciated.
You can achieve this using asp.net DataList server control. Its very similar to Repeater except you can also display data horizontally using RepeatColumns property. For more detail on using please have a look at http://www.builderau.com.au/program/dotnet/soa/Formatting-data-in-columns-with-ASP-NET-s-DataList-control/0,339028399,339270702,00.htm and http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.repeatcolumns.aspx
I'm attempting to build a page that displays the same set of information of different "items" in a grid or table. It's akin to a shopping page that displays products in for e.g. a 4 by 3 table.
I came across datagrid and gridview but they display grouped information according to columns and each row representing one item only.
Is there a control that displays data in a very basic grid format instead of tabular form, preferably with built in pagination abilities?
Many thanks in advance
You will want to use a DataList or a Repeater, as those controls allow you to specify the exact HTML you want for each item. Unfortunately, neither of those have built in pagination, but honestly, the built in pagination in the GridView is of questionable usefulness, since it only works if you use a specific data source or load everything from the database up front.
I'm not sure what you mean, you want a basic grid, but gridview doesn't work for you. But in any case, check out the repeater. It will require a bit more work to built a template for your items, but it's very flexible and can handle what you want.
I'm using the Repeater control on my site to display data from the database. I need to do pagination ("now displaying page 1 of 10", 10 items per page, etc) but I'm not sure I'm going about it the best way possible.
I know the Repeater control doesn't have any built-in pagination, so I'll have to make my own. Is there a way to tell the DataSource control to return rows 10-20 of a much larger result set? If not, how do I write that into a query (SQL Server 2005)? I'm currently using the TOP keyword to only return the first 10 rows, but I'm not sure how to display rows 10-20.
You have to use the PagedDataSource, it allows you to turn a standard data source into one that can be paged. Here's an example article
This isn't a way to page the data, but have you looked into the ListView control? It gives the flexibility of repeater / data list but with built in paging like the grid view.
And for paging in sql, you would want to do something like this
This was answered here.