How to positioning in ASP.NET Grid - asp.net

I am new to .NET. I am facing a problem . My question is that I have a data grid control and I am using the asp text boxes in my grid instead of the bound field. In my grid there is a blank row at the top and user can enter the data in these text boxes and after entering the and press the enter I want that my grid is position from the values entered by the user. Means the row at top is matching the data enter by the user.

what is the positioning problem? can you post the code?
select * from trnhst order by xwe4nb desc
the above sql query places the newest on top

Related

How to add and edit record directly on the table widget Google AppMaker?

I have something like this to enter staff details list. Above is the table list. User click button below the table to add new list record. Then fill in the list details on the form beneath it.
My question is how can I just allow user to enter/fill in the list details directly on the table itself. Not only that, also user able edit record whenever the user clicks the records and wanted to change them.
The example I am providing is specifically for a datasource in autosave mode, so you will need to make some adjustments since it appears that your datasource is in manualsave mode. First you will either want to recreate your table and in the table creator choose 'Editable' which will automatically place inputs in your table row vs labels. Alternatively you can just replace all your labels with Textboxes, Dropdowns, or whatever your input should be. See the image of the table creator below:
Since in my example I used a 'Insert Only' form I moved my 'Create Button' and my 'Clear Changes' button inside the formbody, then set the flow direction of the formbody to horizontal and then matched the spacing of the form fields to the same as my table row and dragged the formbody to be between the tableheader and the tablebody(list) element. See the image below:
Again you will want to make adjustments to fit your needs such as rearranging where your 'Save' and 'Reset' buttons appear and in manualsave mode you may be able to skip the formbody entirely since your 'Add Details' button should automatically create a new table row anyways which you will then be able to edit directly in the table, you may just need to find it first but generally new rows should just be added on the bottom of your current datasource page.

limit the record displayed in a view using hook_views_query_alter

i want to change the number of items returned by a view. I changed the code as
$view->set_items_per_page(2);
in hook_views_query_alter();
But it is not showing the required result. But there is color difference after 2 records. Is it required any other settings I put my pager as off in view.
ie Use Pager:off . I want to use this on draggable view table. Is it possible?
Pls help me
if you are only altering the query programmatically and view exist then
1] Go to your view basic settings and click on item to display
bottom of your view you will get the 2 text boxes.
2] In first text box put the number you want, in your case put 2 and leave second text box 0. and hit the update default display button and save your view.

Can we copy the value of one field to another in a repeating table of infopath form?

Hi guys can anyone tell me how to copy a field value in a repeating table to another field when we insert another row. It is just like amazon checkout process. In Amazon checkout process we have to click a check box when our billing address is same as our shipping address.
In this scenario am having one text box and drop down box fields in a repeating table. When am writing something in the text box and inserting another row. here come the problem I have inserted a value in the drop down box, when the value is selected in the drop down box the textbox value from the parent should be copied to the child node. This has to be done without any code behind.
Please help me regarding this issue
You could probably do this using the default value of the child node.
The default value can reference another field either on your main datasource or any secondary datasource.
I would assume that you don't want this updating when the user adds another child node. If that is the case then you will need to uncheck the "Update this value when the value of the foumlua is recalculated."

jqGrid ASP .Net Permanent 'Add new row'

I've been using jqGrid ASP .Net and really happy with it but I required a permanent blank new row at the top of the grid which allows a user to enter a new row on the fly rather than using the add row dialog.
From looking at the trirand forums, this is currently not supported 'out of the box'.
I have seen this forum post http://www.trirand.net/forum/default.aspx?g=posts&t=212 but it doesn't work (alert is shown but nothing else happens) and also requires the user to click the New button rather than the new row always being at the top of the grid.
Any help would be greatly appreciated,
Cheers
Additional Information:
I am wanting a permanent blank row at the top of the grid where the user enters every new row, below this row would be the data already entered (loaded from the database on page load). As the new row is added (when the user hits enter) the row is displayed in the grid (which I gather would also fire the OnRowAdding event for me to insert into the sql server) and the permanent new row would clear its values ready for new entry. I am also using inline editing (which is working fine) and committing the changes to a sql server database. I am populating the grid on load of the page by setting the datasource to a datatable and calling DataBind()
Look at this example which I created for the answer. The example works with local inline editing and fill the grid with empty data at the beginning. You can modify it and fill only in the first line empty data and all other rows fill with "real" data.
Another way: you can just place "New" button above the rows (see Add toolbar in the bottom of the header using jqgrid which describes how to do this) on the second navigation bar. So users will see it immediately. You can also place custom button instead of a standard "New" button. This custom button (for example "+") could just insert a new row and goes in the inline editing mode.
If all this is not what you want, you should include in your question more detailed information which kind of editing you use (inline, cell or form), where you hold the data (local, only on the server or use loadones:true to have a mix data holding).
Ended up solving this problem by inserting a new row to the datatable when I populate the grid as follows:
DataRow dr = dtTimesheets.NewRow();
dtTimesheets.Rows.InsertAt(dr, 0);
grdTimesheet.DataSource = dtTimesheets;
grdTimesheet.DataBind();
Then on the RowEditing method I check if it is the in fact the new row and perform my insert instead of an edit and then reload the grid which puts a new empty row at the top of the grid again.

Using the Tab key to navigate form inputs

I am having some problems with tabbing within my asp.net pages. This project was developed with Visual Studio 2008.
Case 1
I have two html tables. The first table has two rows; the second table has four rows. Within the cells are of each table are asp.net fields, text boxes and radio button lists. I set focus to the first field of table one. I then press the tab key multiple times. The focus moves through the field of table one and then through the fields in the first row of the table two. Then instead of goes to the second row of the table two it return to the table one.
But if I set focus to the last cell on the first row of table two, it tabs through the remaining cells of table two properly. Can you tell me how to get the tabbing to behave properly and go to the cells in there natural order? Note that I am setting the tab index property in the order that I want.
Case 2
On another page I have an html table with a single row followed by a gridview control. The gridview control is writeable and has the following columns: Check Box, Radio Button List, Text Box, Text Box, Text Box and a Check Box List. If I click on one of Check Box, Radio Button List or Check Box List., then press tab, the cursor pops out of the grid and sets focus on the first field of the table outside the grid. But if I set focus on one of the text boxes and tab; then the tab goes through the fields of the grid left to right one row at a time. This later behavior is what I want in both cases. I don’t know why my cursor pops out of the grid when I start with a field other than a text box.
Please help if you can.
Bob
funny, you explain in details your case but you didn't explain what it needs to be explained in order to someone can understand you :)
first of all, is table1 located in the first tab and table2 in second tab?
what do you used for tabs: asp.net tab control, jquery ui tabs...?
what do you mean by 'press the tab key multiple times'? same tab? do you have postback on tab click? what is the focus in your case, and so on and on...
cheers
Have you checked the order of the input elements in your HTML? Generally the tab order follows the order of controls.
If that all looks right, then make sure nothing is setting the TabIndex property - as this will also mess up the tab order.
I pretty much resolve this and I wanted to add the answer for anyone who viewed this thread. The problem was the autpostback on certain fields. Once I disabled autopostback, the problems went away.
Bob
You need to use Javascript and I referred for your a very good example of navigating through Gridview rows with Up/Down keys.
http://www.codeproject.com/Articles/25675/GridView-Rows-Navigation-Using-Arrow-Up-Down-Keys

Resources