Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


web app datagrid questions

Posted on 2004-10-21
Medium Priority
Last Modified: 2010-04-17

     I'm new to web app programming, and am having trouble with a couple of things to do with datagrids.  

1) I set AllowPaging to true and set PageSize to 5 - I get the arrow at the bottom of my grid, but when I click it in the browser, nothing happens.  So apparently I have to program some postback code that changes which page of data to display in the grid.  How do I do this?

2) I can add a "Edit" button to a new column for each row, but is there anyway to just select the row by clicking on it?

3) If not, for #2, then when an edit button is clicked, what variable tells me what index # I'm dealing with in the grid/dataset?


Question by:gleznov
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

Sicos earned 1000 total points
ID: 12379239


Question 1:

You have to the current page index to the selected one. See the example below.

private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
      DataGrid1.EditItemIndex = -1;
      DataGrid1.CurrentPageIndex = e.NewPageIndex;
                DataGrid1.DataSource = //the datasrouce

Question 2 and 3:

See this link: http://www.dotnetbips.com/displayarticle.aspx?id=147


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
In this post we will learn different types of Android Layout and some basics of an Android App.
Simple Linear Regression

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question