How to drag and drop column values in a table/grid? - asp.net

I have an existing Silverlight application that allows one to click on a column cell and drag to the left or right in the row. When this is done the value from the original cell is copied into the "dragged over" cells (there could be more than one). At the same time, a message is sent to the server to trigger a database update.
I now need to port this application to ASP.Net and make it tablet friendly. I have searched high and low and looked at the various grid providers and through jquery plugins but have not been able to find something that already does this. Any ideas on existing solutions or how to get started otherwise?
Thanks!

Related

Separate HTTP requests for each dropdown or a single request for a fat FormViewModel?

If the view which serves for creating an item contains some dropboxes / checkboxes / whatever with values from the server, should it send separate requests for filling up those controls with values (one request per each collection of data) or it is better to have a single api endpoint that returns all of the necessary data for filling up the form on front-end?
For the sake of simplicity, I've simulated here an example: Say we're building an app for a car servicing company where clients can make appointments:
Should the front-end app make 2 get requests to api/models and api/services, or these collections can be returned from the server in a single response (from api/appointments/createformdata), What are the best practices regarding to this?
Thank you in advance!
Well, since in your example, both combo boxes need values, then I would load up on first page load. There would be no need for separate requests unless those combo boxes are dependent on data in the form, and then in that case you have no choice but to wait for user input to determine that.
so, say you have two combo boxes, and the 2nd one is cascaded by the 1st combo choice? Well, the first combo box does not change - so load it up at page load time, and you have to do that anyway. No use writing out separate events or code to load that first combo that MUST be loaded in the first place.
however, the 2nd combo box? Well, since its values are based on the first one, then once again, you have no choice, do you?
So, I don't see any real use case, that if two combo boxes are independent to each other, then I see next to no reason why separate requests would be required, and that just loading up both combo boxes on first page load would not suffice here? (then you don't need ANY separate requests).
Now, if there is some kind of tab, or UI and the user can't see nor use the combo boxes right away, or may never even select say some tab out of a tab control? Well, ok, in that case then you speed up the page load by not filling out the combo boxes until such time the user gets to that part of the form (maybe some pop dialog, or maybe some kind of wizard steps).
But, once again, if the two combo boxes are not dependent on each other? Then I see no reason to use two requests or events to load up both of them. But then again, it would beg the question as to how you did in the past load up the combo boxes anyway?
I mean, if each combo box was some ajax call, then keep using two of them, and keep the two requests. Since attempting to merge, or put two ajax calls that fill out two combo boxes as one call is a pain, and does not follow a re-use design patter. The result is messy code, and worse force you to write code that does two things.
I mean, if you build a nice general routine to call + fill out the combo box, then continue to use that code to fill out the 2nd one. I would not blow up really nice working code to somehow fill out two simple combo boxes on a page and attempt to use one request for that filing out of the combo boxes.
And as I stated, if the combo boxes are in plain view from the start of the page load, then code behind on first page load is the place to do this unless some rather huge performance issue were to crop up. As a result, you now don't have ANY separate requests to fill out the combo's, do you?
But then again, a combo box is good for what, 30, maybe 50 choices tops, and after that, you need a different UI, and thus once again, you don't have a problem performance wise by doing this either way, do you?
And if you are trying to fix or avoid a performance problem? Then you putting too many choices into the combo box, and that is the wrong ui choice, and then once again, you don't have this issue, do you?

Read from sqlserver and insert each line values to a table cell programmatically or from design

I am working on a Dotnetnuke module and i try to read the products i have in my sql server database.
I managed to read the data from the asp tools LinqDataSource and ive inserted them in listview etc. This is now what i need.
The ideal would be if i could read from database my table, and for each row on the db.table to dinamically create a asp:table cell in the design. The asp table ould be 4x5. so 4 columns and 5 rows, and each cell would include an image and the text i load from the database(the image wont load from db, its the same image for all products).
Also if there are more than 20 products then a 2nd page is created with the rest, and page navigation at the bottom.
this is the result i want.
I didnt try much programmatically as i dont really know how to start this. Only from design i tried a few things but they are like a listview so it doesnt help much.
Any ideas or suggestions people?
I managed to make the interface of the picture i provided and made all products clickable, all this from the design view with a ListView.
You can ask if you want any details

Setting ControlID to be used for AutoIT

I am trying to do some automated functional testing for a windows app and I just got my hands on AutoIT. Looks like most (if not all) standard windows applications have a Control ID set. Unfortunately, the Control ID field is blank when i mouse hover using the Finder tool. So looks like the application (written in C) hasnt set a ID to each element?
I've used XCode's UI Automation for iPad apps and we use "setAccessibilityIdenitifier" to uniquely identify each field. I am trying to find out the equivalent for a Windows application.
That begs the question, is AutoIT even the correct tool? All my testing is calculation based. So you can assume 2 input fields and one output. So if the user enters 5, and 2 and hits "Add", I need to check if the output is 7. So i need to uniquely identify each element.
I also noticed when there is a group of elements, when i hover my mouse over the group, i get "Static" as the classname and only the coordinates change when i try to access each element, and every other control like Instance, ClassNameNN all remain the same. Any ideas?
Thanks in advance!
EDIT: Thanks to the AutoIT forum guys, the group issue is fixed - http://www.autoitscript.com/forum/topic/151055-autoit-basics/
I still need to know how to set Control IDs from the application side C code

Flex DataGrid sequencial inserting

I come from the Delphi school. I was really used and pleased with Delphi grids with the plus features of InfoPower. Not just me, my users loves all features that include grids. Some motives for that are:
With grids they have the ability to insert detail information using only the keyboard. Input, Tab, Input, Tab, Input Tab (automatically insert new row), input, tab, etc.
They were able to simply click in a row and edit it´s data.
They could navigate between records using only arrow keys.
In my flex apps I´ve being working arround this quite often, sometimes using a popup to insert data, sometimes using repeater instead of grid. But now I really really need some intuitive, fast way for my users to insert this data.
I am trying to use DataGrid (or AdvancedDataGrid) with inline editors and I am living a real hell to do that. For the last 3 days I am struggling, tweaking and workarrounding in order to try to mimic the features that I had with Delphi.
Main problems are:
DateField simply don´t work as an inline editor. It gets focus but never looses, only with pressing ESC, wich makes me loose the inputed data.
AdvancedAutoComplete: I have a component descendant from AdvancedAutoComplete with a custom browser. The custom browser is a popup, when I try to PopupManager.remove flex raises an exception of a null pointer inside it´s focus managing engines.
I couldn´t get to insert a new line focused in it´s first column when TABing in the last column of last row.
Having all these problems and not getting substantial material to solve them makes me think the (now obvious) fact that it is just not the way grids are intended to work in flex. My question is: what are the patterns used in flex applications to make sequencial, intuitive, fast, keyboard only insertions in a detail?
To answer your question bluntly, there are no specific established patterns to make editing or inserting data in the DataGrid fast and easy. Not being able to Tab between fields is one of the things I really wish Adobe had added to the DataGrid by default.
In order to get the functionality you want, you'll have to do some custom coding and extend/override the DataGrid's default functionality. Switch On The Code has an example up on tabbing between fields, but you would have to build upon their sample a bit further to include features like adding a new row when pressing tab in the last field of the last row in the DataGrid.
You may also want to consider Flexicious. Based on the Flexicious Ultimate demo, it looks like they have the functionality you're looking for (and then some!).

ASP.Net - Possible to edit multi rows in grid, then save all? PLUS...partial postback of single row with new value retrieval from dataset

I need to implement a grid in asp.net that behaves almost exactly like MS Excel.
- can navigate around with arrow keys
- you can edit the cell that currently has focus by simply typing
- supports checkboxes, dropdownlists, etc
One crucial requirement is....I need to be able to somehow, after update of any cell within a row, pass that updated value back to the server, as there is a calculation process that happens using that updated value that can update other cells in the row, and I need to essentially rebind all the cells in the current row with the updated values resulting from the calculation. AND...when I do this, I want to retain focus on the cell that had it after the update of the former cell. Without grid scrolling, etc, etc.
If you're wondering what I'm talking about, just imagine Microsoft Excel, but I need to perform the formula calculations on the server and refresh all cells in the current row with the results....and, not lose focus of my current cell.
I am more than happy to pay $1000 or whatever it is for one of the full blown commercial ASP.Net grid controls, but from the ones I have tried so far, they seem to not be capable of this, at least I don't know how.
Aspose Grid - would have worked great, except it is totally full of bugs
Telerik RadGrid - a colleague familiar with that grid is trying to figure it out with no luck
Farpoint Grid - looks promising but haven't tried it out yet
If anyone has any advice on how to specifically accomplish this, it would be much appreciated.
Have you tried the extjs sample?
It has a commercial licence, but you can try it for free.
I managed to find an example about Excel-like RadGrid by Telerik - if you are interested in it, you can see it here. And good luck with your implementation.
Did you look into using jQuery for this? Look into jQuery templates and ajax.

Resources