By design, ASPxGridView v7.2 doesn't provide such a property. We have just introduces a GetRow() method in v7.3.
If you wish to obtain row values, use the ASPxGridView's GetRowValues and GetRowValuesByKeyValue methods. If they don't serve your needs, please describe your goal in every detail and we will try to find an acceptable solution for you.
1. I wanted to know the row count in the gridview.
2. Please see attached, I have budgeted, projected, actual, variance numbers for each item. I wanted to traverse the gridview and make the user, account#, account name in the projected, actual, variance lines invisible since they're identical to the budgeted line.
3. Is it possible to add a second "EditMore" command to edit a row in form mode to append more stuff like attachments, while keeping the original "Edit" command to only edit these numbers in inline mode?
Thank you for the additional information, Ying.
1, 2. Let me suggest a different (dynamic) approach to you. There is no need to iterate through GridView rows. Instead, handle its HtmlDataCellPrepared event. Within the handler:
a) use the e.VisibleIndex parameter to determine the visible index of the row being rendered;
b) use the e.DataColumn parameter to determine the column being rendered;
c) decrease the e.VisibleIndex value to obtain the corresponding budgeted row according to your logic;
d) use the GridView's GetRowValues method to obtain values from the budgeted row, if necessary;
d) pass an empty string to the e.Cell.Text parameter if its necessary to hide the text of the current cell.
Hopefully, this approach will serve your needs.
P.S. The Support Center concept does not allow multiple problems within a thread as this makes it difficult to properly track and process such items. Please open a new issue for each question, suggestion or a bug report you want to post. For now, I have created a separate issue devoted to question 3 on your behalf myself. Please refer to report Q19025 ("Q19025").
Please provide additional information about the layout of your GridView to help me give you a precise answer:
1) Do I understand properly that you're working with a master-detail GridView?
2) Do you want to expand the "budgeted" line when clicking it with the mouse?
3) What about the situation when the row gets focused via the keyboard?
4) Should the "projected", "actual" and "variance" rows operate the same?
5) If not, how should they work?
2). Yes, but I want it expanded 3 rows below because every 4 rows together represent an item.
3). Edit that individual row in inline mode.
4). I'd rather hide the expand buttons for these 3 rows, maybe another way is to add a button "see details" under the balance row, because I found I need to add a "Delete" button for an item too?
Thank you for the information. We have discussed your situation with our guys, and tend to think that templates would be the best solution for you. Is this mandatory to keep the "projected", "actual" and "variance" rows separately? If not, you can maintain a single "budgeted" row only and set up a template with an HTML table in the 4th column to display the "budgeted", "projected", "actual" and "variance" values stacked.
What do you think about this approach?
1. Is there a template sample I can take a look?
2. Certain people need to edit the "Projected" row and view other 3 views, and admin needs to be able to edit all rows. Will this work in the template?
3. How to place a button "See details" below the fourth row, and bring up the detail view when clicked?
4. How to divide the summary count by 4?
Sorry for the late response. We've accidentally marked this report as Processed.
About your questions:
1. First, please review the Templates section of the ASPxGridView's documentation. Then, review the pages in the Templates folder of the ASPxGridView's demo solution. Finally, you can find a number of tutorial projects devoted to templates here: http://demos.devexpress.com/Tutorials/Default.aspx.
2. Our idea was to set up a single template for all these 4 rows, and display them as a single row. By design, template will allow you to modify the values displayed in its controls (in particular, "budgeted", "projected", "actual" and "balance"). If you need to modify these rows as different rows, containing different data, this approach isn't suitable. Moreover, we don't have a good idea then how to set up such a layout.
3. If you use a template to display 4 rows as a single row, you can also include a button in the same template, an simply handle its Click event.
4. You can handle the ASPxGridView.SummaryDisplayText event. Refer to the e.Value parameter, to obtain the value calculated automatically. Then, divide it by 4, and put the resulting string to the e.Text parameter.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.