I'm trying to figure out what design object to use for my forms application.
I want to make a forms application that looks like below image.
I have so far used splitcontainers for the layout and three gridviews with separate DataSources querying the same table but with different where clause for eatch gridview. This works fine but when i click a row in any of the three gridviews i cant have that data show on the right side becaus i can only get data from one datasource on my labels and textfields etc.
I guess that i should use one datasource but in some way have different where clause to each gridview but i've tried it and i only end up with the same data in all of the gridviews.
If it's to complicated to get together i would instead have a new form window apeare with a click of a button. So if i select one row in any of the gridviews and then click edit a new forms window will open for me to edit data in. How can i do that?
Please advice me how i should try to build the application.
For example; Dont use gridviews use this or that instead. Dont use splitcontainers use this instad. Use bindingsources... etc.
I really appreciate any help you can provide
Related
I am trying to show the sum of totals for different kind of invoices on a web page.
I am using detailsview control, however it does not show all the data in one page. When I enable paging the other types of invoices can be seen on 2nd and 3rd pages.
My SQL command is:
SELECT CARI_HESAP_KODU, FATURA_TURU, SUM(KDV_MATRAHI) AS TUTAR FROM LNX_STD_6_016_01_SLSINVOICES WHERE CARI_HESAP_KODU=#mKodu GROUP BY FATURA_TURU, CARI_HESAP_KODU
When I run it from SQL I get the proper results:
But when I run the page and test detailsview I get:
So I have two questions:
1. Is it possible to show the results as columns (as in SQL view) instead of rows?
2. Is it possible to show all the records in one page?
Thanks in advance.
As stated in the comments by Esko, the details view only shows one record at a time. The details and Grid views are fast easy ways to display data, however if you wanted to customize how data is displayed, a more generic repeater would be the next logical choice, you would just have to do the formatting yourself.
Check out his article or google "asp.net repeater":
https://msdn.microsoft.com/en-us/library/zzx23804(v=vs.85).aspx
When I used to program in web forms a lot, I used repeaters even when a details or grid view would have done the job, because they are much more flexible and easier to maintain when someone asks for changes.
Cheers.
I have a page with around 20+ controls. Within this page I have a partial View which I am using to create an editable grid. This grid has Add New Row/Remove Row buttons on click of which data entered in the textboxes in grid row gets added to the grid.
Whenever I click these 2 buttons, my page is getting refreshed due to which whatever data is being entered by the user in the 20+ controls of main page is lost.
I have tried hopelessly searching for solutions quite some time, but still trying my luck out here. Any ideas are appreciated.
Well I recommend you to use full jquery mechanisms to add or remove rows. You can easily add or remove HTML elements. All you have to care about is to maintain the numbering system. I suggest you to use a view model that contains a list of objects that you need to add or remove. At first render it normally by providing list of objects (from database or other source, if required). After this define your add and remove buttons to type button and play with jquery to add remove table rows or even divs. After adding or removing required element, reorganize your numbering. At submit you can use either full postback or ajax postback. If Any confusion, let me know.
Here's my problem. I am trying to add usercontrols dynamically to different rows of a GridView.
Let me explain the scenario further. Let's say, I have a page where the user can place orders for different kinds of items. The order form for each item is different in layout and code, and has its own usercontrol. There is an "Add More" button, which lets the user add an extra row to the GridView, while the kind of form that gets appended is selected by the dropdown list (see picture below).
What I am trying to do is - have a separate UserControl for each one of these forms, and then have the UserControl added (or maybe I should say "bound") to the GridView. Every time a new row is added, I plan to re-bind the GridView, including rows from above, to maintain all the rows.
The problem is - the main page cannot know what fields there will be inside each individual UserControl (they can be anything, really, and down the road, newer UCs could be added). So my main question is - how do I bind the data to the GridView, when I do not know what to bind? Is there any way to bind the data from inside each UserControl itself?
I hope my problem and question are clear enough. Thanks for helping.
I currently have a gridview with data that is binded from the database. This data is suppose to be editable and deleteable.
Is it possible to create a form within the grid view?
ie when you click on an item in the gridview, everything below or above moves down/up to create some room for a new editing pane with two dropdownlist and a few icons for delete/update.
Any suggestions?
The gridview itself has some features to edit, add, delete etc. Check this out http://msdn.microsoft.com/en-us/library/ms972948.aspx. It has kind of a learning curve though, so you must read to be able to do cool stuff with the Gridview.
I have seen that sort of functionality with Telerik's grid controlTelerik ASP.NET Grid.
You can open a modal popup on eidt/insert if your form fields are many otherwise gridview's inbuilt editing would do just fine.
Add edit update gridview records using modal popup
I have created a databinding treeview which binds with multiple tables and display hierarchical data. I stole much of the mechanism from http://www.codeproject.com/KB/tree/dbTree.aspx if it interests you.
I first merge(outer join) all the datatables into a big datatable, then databind the treeview and bunch of textboxes to the big table. User can click on a node in the treeview and see corresponding info in the textboxes. So viewing part is nice.
Now coming to updating, deleting, adding info via textboxes entries, is there a way the user can make changes via the textboxes, and immediately reflected in the big table and individual tables ?
Thanks!!
You are joining information in a kind of view and I understand that this view is stored in memory while you fill your tree. So, if you do any kind of change in the data inside the tables that composes your view, you must reload it.
If you are working with an web app, it is going to be something natural, because each user interaction will do a new request to create you view.