How to add a new row showing textboxes at the last row of the last page??


Edited by SomeNewKid. Please post code between <code> and </code> tags.


Hi, when I'm on the first page of the datagrid and want to add the new row in the datagrid, how can I show texboxes at the last row on the last page of the datagrid?
If I click Add button when I'm not in the last page, then if I go to the last page, the new row is added but it's not in a textbox and I need to click Edit to show textboxes and update...
If I'm on the last page and click Add button, it adds a new row and shows textboxes at the last row automatically.
so the problem is when I'm not in the last page of the datagrid..
I appreciate any thoughts and ideas... please help me.. thank you!
This is what I did:
-------------------------------------------
private void Page_Load(object sender, System.EventArgs e)

{
if (this.IsPostBack)
{
dsCategoryDetail1 = (dsCategoryDetail)Session["dsCategoryDetail"];
}
else
{
this.oleDbDataAdapter1.Fill(this.dsCategoryDetail1);
Session["dsCategoryDetail"] = dsCategoryDetail1;
this.dgCategoryDetail.DataBind();
}
}
private void btnAdd_Click(object sender, System.EventArgs e)
{
DataRow dr = dsCategoryDetail1.CategoryDetail.NewRow();
dr["CategoryDetailName"] = "(New)";
dr["CategoryID"] = "1";

dsCategoryDetail1.CategoryDetail.Rows.Add(dr);
Session["dsCategoryDetail"] = dsCategoryDetail1;
dgCategoryDetail.CurrentPageIndex = dgCategoryDetail.PageCount - 1;

dgCategoryDetail.EditItemIndex = dgCategoryDetail.Items.Count;
dgCategoryDetail.DataBind();
}
private void dgCategoryDetail_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
dgCategoryDetail.CurrentPageIndex = e.NewPageIndex;
dgCategoryDetail.DataBind();
}
0
Luna202
7/10/2004 1:45:46 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

0 Replies
693 Views

Similar Articles

[PageSpeed] 4

Reply:

Similar Artilces:

How to stop the last detail row to print on next page together with the group trailer and summary even the second last page has lot's of space for the last row but not for the summary...
Hi, Can anyone please help me on this : My reports have quite a lot in the group trailers and summary, so that the last detail row will print on the last page with the trailers and summary even though the second last page has a lot of spaces for the detail, but just not enough for the trailers and summary. Therefore it looks very odd that there are lots of space in the second last page, and clients thought the report is finished while the last detail row is printed on the every end page. How can I force the report to fill up the second last page before printing the las...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

last detail row will print on the last page with the trailers and summary even though the second last page has a lot of spaces for the detail
Hi, Can anyone please help me on this : My reports have quite a lot in the group trailers and summary, so that the last detail row will print on the last page with the trailers and summary even though the second last page has a lot of spaces for the detail, but just not enough for the trailers and summary. Therefore it looks very odd that there are lots of space in the second last page, and clients thought the report is finished while the last detail row is printed on the every end page. How can I force the report to fill up the second last page before printing the las...

First Row, Next Row, Prior Row, Last Row
I have a SQL Anywhere 7.0 Database, have a table Product_detail which contains Column Name Datatype width Null Default batch_id char(10) No None prod_id Integer No None employee_id Integer No None quantity Integer No None price Numeric (14, 2) No None Its primary key is batch_id I have a Freeform Datawindow with this table I want to provide the first row, next row, prior row and last row Ho...

does anyone know how to do that, when I click the last row of the gridview, the gridview will automatically add an empty new row for me.
does anyone know how to do that, when I click the last row of the gridview, the gridview will automatically add an empty new row for me.   thanks hi there,the only I could think of for now is is enbale footer rowthen hide it onpageload so when last row click set footer.visible to true  ...

Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row.
What is the best way to show a gridview row highlighted once selected and keep it highlighted once the mouse moves over a different row? Thanks, Steve hi,you can use <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="#FFFFFF" /> plz let me know if i misunderstood you Thanks for your help. One problem; however, is that after the row has been selected and I check the "grid.SelectedIndex" it has a value of -1 and not the index of the row that was selected on the grid. What do you recommend? Thanks, Steve hi, sorry i din...

Showing GridView's row containing textboxes (all textboxes of the row) yellow when one of the textboxes is selected.
I have a gridview where each row's cells contain textboxes (for providing I/O into the gridview) The problem I need to solve, I think, is with textboxes that make up the cells of the grid. When I select one of the textboxes that make up the cells of the gridview, then I want the whole row, each of the row's textboxes, to be highlighted in yellow showing that row as being selected. Thanks, Steve sholdorf: I have a gridview where each row's cells contain textboxes (for providing I/O into the gridview) The problem I need to solve, I think, is with textboxes that make up the ...

Last row of the group printed on new page leaving lot of space
Hi I use PB703 Build 10213 I have a report with a group, where the "NewPage On Group Break" property is enabled! In the trailer of the group I have many text objects that force the trailer to have big height! When I retrieve the report, the last row of the group is printed on a new page together with the trailer, leaving a lot of empty space on the previous page. (I guess that it is trying to print the last row of the group with the trailer on the same page. Since this doesn't fit, it moves to the next page, instead of printing the row, then print the trailer on the s...

last selected be in the last gridview row
I bind a list to a gridview.I want to when a new row add to gridview it be a last row.when i select a product I want the last selected product be the last row of gridview but it isn't.I didn't bind my gridviw to sqldatasource.what should I do? here my gridview source code   ...

How to add new rows in the form of rows
Hi, I can able to insert,delete and update record in gridview but cannot able to insert any new rows in the gird. In windows application we can insert new records(using DataGridView) into the database but not in web page. How to insert the records in gridview like control. Please tell me how to insert records in database in the form of rows. I mean i want to enter 20 records at one time.   Thanks.   Regards ArshadPlease Mark as Answer if the post is helpful to you. hi, Have you set the property AllowUserToAddRows=True; for the datagridview?????  If you are us...

Select first row or last rows!
Dear experts: i would like to know how to fetch in an select statement the first 20 rows from 2 tables. I want to show first 20 the records from sales,members where sales>4000 thank you... "John Vai" <john_vai[at]hotmail[dot]com> wrote: > i would like to know how to fetch in an select statement the first 20 rows SELECT TOP 20 .... Adding ORDER BY is strongly recommended. Dmitri. This TOP 20 doesn't work for sybase , its works for MySQL and i've already tried it. I am using for the moment set rowcount 20 but there should be ...

Delete last row in the last page in dg cause Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
Hi to all, I am not sure how many of you encountered such error. I have created a datagrid with a delete option. When I have a couple of pages lets say 3 pages in each page it has 3 records. So the problem arise when I am at page 3 (final page) and attempting to delete the last record on the last page. I get such error. you can view the error description and the code in the following link. I have posted this quesiton in many newsgroup and got no answer. I hope this datagrid newsgroup will help me solve such issue. thanks again Al http://aalhussein.webhostme.com/Q/dg_delete_last_row2...

PB2.5: how to add a new row on DW and setfocus on specificated field of the new row.
I need to add a row on a datawindow when user press the 'tab' on the last field of the previous row. using dw_1.insertrow(0) in ItemChanged event does'nt work because the focus rest on the "old" line. Someone can tell me instructions to do this ? TIA roberto Roberto; The "tab" on the last field will fire the IC event if data has changed. If you are doing the InsertRow ( ) then, you are almost there in your problem. You may just need to tweak the UI as follows: DW Control IC event ... Long ll_row ll_row = InsertRow (0) ...

Add a new row by duplicating existing row?
How can I add a new row by duplicating existing row? What must I do after triggering the event pfc_addrow()? Should I use datastore to store the existing datawindow values? Thanks. qtran@ladwp.com ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp RowsCopy(.....) is your friend... -- pbm_thisusuallydoesnothelp :-)) "Q Tran" <see_message_body@domain.com> wrote in message news:h33nIbM0$GA.299@forums.sybase.com... > How can I add a new row by duplicating existing row? > What must I do after triggering th...

Web resources about - How to add a new row showing textboxes at the last row of the last page?? - asp.net.presentation-controls

Notes Plus on the App Store on iTunes
Get Notes Plus on the App Store. See screenshots and ratings, and read customer reviews.

Training - Algodoo
Navigation Home For Fun Algodoo Play Algodoo Physics Scenes Demo Buy For Education Algodoo for Education Lessons User stories Solutions Demo ...


Automated Test Design
... tests along with doing ET. Here's my take on a UI test for Alan's app: Open the page Check that text "Total" exists. Check that the 6 textboxes ...

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 11 Jul 2012

Cyprus By Bus Route Planner - Find your bus journey in Cyprus
Cyprus By Bus route planner for finding the best possible bus route between two bus stops in Cyprus. Based on origin bus stop, destination bus ...

Issues - gwen - GUI system aimed at games - Google Project Hosting
My favorites ▼ - Sign in gwen GUI system aimed at games Project Home Downloads Wiki Issues Source New issue Search Search within: All issues ...

ASP.NET Web Forms DynamicData FieldTemplates for DbGeography Spatial Types
... Those templates are simple. Here's the Edit example. You might say, hang on, this is just a text box! I thought we weren't using TextBoxes? ...

uCan Post WordPress Plugin Demo - Cartpauj & iComNow
This is a demo for the uCan Post WordPress plugin by cartpauj. This plugin lets users create posts and site content without having to access ...

Jennifer Semtner [ Web Designer / Developer ] » CSS
If you're using Grails and the Grails UI plugin's autocomplete feature, you may have noticed all of your textboxes have disappeared in Chrome ...

Resources last updated: 11/28/2015 4:46:54 PM