My question might be little strange but I am new to web - based programming. In windows based application, if I need to let the user to edit and view the table then I am using the datagrid. In web - based, there is GridView but it is read only tool. I want to see if there is any tool like this in asp.net. Can you please help?
Thanks
Have a look on the ListView control, basically, It lets you specify methods to show, update, edit and delete records from your datasource.
There are a lot of examples for it. Here's a nice article
If you want your end users to have a little bit better experience then you should consider the alternative to use a javascript based grid, which is a more modern way to build a grid. Then everything executes smoothly in the web browser without the need to post back and reload the page, and the server will only be called when it's really necessary (loading data, saving data) but not when you change a row when it´s being edited, or if you do incremental searches.
My favorite is the Slickgrid. And here is a cool Slickgrid example with Async post rendering.
If you choose the server control way (ListView etc) you will have a lot of postbacks every time you sort, change editing mode in cell or edit data.
Look at this question if you want some more examples of javascript grids.
Related
I need to implement an editable datagrid which allows to get and edit data from single table and joined tables as well. I use SQL Sqerver 2008 db and Linq to SQL.
Shall I use a ASP.NET GridView control or may be go for Silverlight? Are there any jQuery + AJAX frameworks for it?
What approach would you recommend?
Thank you.
Any one of the items you listed will work. Your question needs some more description as to what you want to accomplish.
If you want to accomplish an interactive grid that has flash like apperance then use Silverlight or depending on how interactive Jquery, if you want to have seamless integration with your database and no page reloads occur then use Jquery / AJAX. The ASP.Net gridview alone will be your most limiting as it will create a page refresh but it will work great if your just showing the user their data and need them to update it accordingly.
I would recommend using Jquery / Ajax as I like the non refreshing and no page reloads jquery has to offer.
There are quite a few ways to achieve this, including Robert's solution of implementing an editing solution using jQuery.
If you're prepared to use a third party solution, Telerik make a particularly good set of controls for ASP.NET and AJAX, one of which is a grid.
Here's an example of one of their grid controls. There's support for joining tables and edit on click.
There are many others on this page which would achieve the desired result.
I've got a table from an existing LabView VI (ewww!) that I need to replicate in C#. The table is shown in the image below. Each field will be populated with data returned by status queries to an external device, likely from within a dedicated status thread (when I implement it...). Is there any control, or direction I should take when extending an existing control for the table-like display of my query results? DataGridView seems like overkill for this, but the table layout container populated with TextBox controls seems inelegant. I'd like some insight, if anyone can offer it. Also, please feel free to shut me down if this has been asked already (though my search turned up nothing I could relate to...). Thanks.
DataGridView is the only suitable control here. Anything else either doesn't have enough grid editing capabilities (like ListView) or is fugly-slow like individual controls in a TLP.
I'm just wondering if anyone can help with this problem I have?
I have a form view and don't like the current paging that is provided by microsoft. So in the pagertemplate I am adding a button in for Next, Previous etc. Is it possible to create an ajax paging method without using the horrible update panels? Is it possible to have a pager method that gets the event args etc?
When the user clicks next it should populate the form view and two other controls on the page. So say I click next to go to page two, this will get the ID from the List, this Id should also be passed onto the other controls on the page.
Also, if anyone has any suggestions for using a better control please let me know!
If anyone has an answer, suggestion or site that could help, please let me know!
thanks all!!
Louis
How's your javascript? This kind of thing is quite trivial once you get used to writing ajax calls from javascript. I'd recommend using something like jquery as a wrapper around the ajax call. Look at the jquery documentation.
How you implement the server side depends on what framework you're using. It's very natural if you use MVC, but if you use WebForms then you probably want a .asmx webservice.
If you don't want to get into javascript then an updating form region is the kind of thing that update panels are quite good for - although I agree they are 'horrible' in that they're a bit of a lazy way of doing ajax.
Do you have any idea how to present all rows from let's say table with the possibility to click on particular row and open that way another window to edit?
I've got no idea how to create this. I would like to avoid access like creation by built-in wizards in Microsoft Visual Studio 2008.
Perhaps you know where I can find more information.
Execute a query which retrieves an overview of the records that you want to display.
When you double-click a row, you retrieve the records that represent that entity, and display it in another window...
That's in a nutshell how you could do it.
For a web application you may want to look at this Walkthrough as MSDN. You can find a winform walkthrough at MSDN as well. Though you say that you prefer doing it without the designers, I suggest that you go through the walkthrough using the designer and look at the code that it produces as a sample of how you could do it by hand. You could then adapt the example as needed for your purposes. For more references try googling "master detail view."
well i would use wpf with a stackpanel of listboxes
the rows are dynamically added to the stackpanel.
the listboxes contain textfields that are databind -ed to mouseclickevents and onchanged events.
http://dotnetslackers.com/articles/silverlight/WPFTutorial.aspx
Somewhere on net on one Blog I read a sentence that is "DataGridView something like Boeing 777, but what is goal when I do not know how to fly.
Before I goo deep in creating my projects I wanna know is there alternative for DataGridView in C#.
Something like jQuery in WEB api.
The favors things which I am looking for is that is simple for using, if its posibile to be freeware and looks smoth and modern.
Best regards
Admir
If you want to fly one person across town you can learn to fly a Piper Cub. If you want to fly hundreds across an ocean you need to learn to fly a 777.
There are many ways of displaying data in WinForms applications; which one is best for you depends on what you're trying to do. If you want to show a fixed, non-editable, non-scrollable list of data you can use a DataList; simple and limited. If you want to add scrolling you can output the data to a scrolling textbox.
If you want to handle a scrolling grid of multiple rows with multiple, resizable, editable columns you will need to move to a DataGrid or DataGridView.
There are many alternatives to DataGridViews; simpler controls provide fewer features and more functional controls are more complex.
I have implemented the datagridview extensively as an unbound control in a windows forms project using Visual Studio 2008. Looking back, implementing this control has consumed a large amount of time, mostly because it is loaded with bugs and peculiar behavior that should have been fixed rather than just 'documented'. A good data grid control is essential to any application of substance. I would recommend looking for a third party alternative from a company that is more interested in getting it right rather than just getting something out there.
The DataGridView is perfectly easy to use without going too deep. If all you want to do is display data in a grid, create a DataGridView and turn off features like adding and editing rows. The fact that it's got all of these incredibly complex features is really only an issue when you start needing to use them - and in that case, you'll be glad you're using it.
DevExpress has a really good gridview.