How to count Number of Rows devexpress xtragrid - devexpress

I am using Devexpress XtraGrid Control, Here I can count the number of rows in footer of grid. but for this I need to set count property of SummeryItem in grid for at least one column. I dont want to do like this.
I want count number of rows in xtraGrid without referring any one column in grid. I just want to show number of rows count. when user will filter that rows, at that time count also need to be changed.
Is there any option to show this number in Group header panel?

I'd use BaseView.RowCount to get the row count and draw it within CustomDrawGroupPanel event.

You can use the customsummarycalculate event to count the number of rows currently shown in the filtered collection and display it in the summary area (generally, I put that text in the summary area of the ID field for the collection I'm using - as I never have a need to put anything else there).

I don't know if this is an update but:
int i = view.SelectedRowsCount;

Related

how to get and set the number of row in a tableView in javfx

I tried to manipulate a tableview and I need to know how to get the number of row that I have in a table view?
And how to set them?
The number of rows in the table is just
table.getItems().size()
You can't set this directly, of course, you just change it by adding and removing data from the table.

DataPager, change count items

I'm using a DataPager control, I want to change count items on each page.
For example :
the First page 6 rows, the second page 311, the third page 12, etc.
Is it possible? If so, how?
my advice is to do it manually, make your own sql query and customize the page size as you want
here are some tips that can help
to get range of rows that are needed for pagination user the row number
MS-sql row number
use the TOP to get the upper set of rows
select TOP 5 * from ....
for sure you'll need to get specific row numbers that will be displayed in the current page
select (--get row number--) from tbl_smth where row_num>5 and row_num<10
were as i guess that you have the page sizes in an array so you have to count them to determine the two numbers {5,10}
hope this will help

Showing multiple records on the same row in Gridview

May I know how to show multiple records on the same row in Gridview?
the purpose of these enumerable data bound controls is to show one record/row/object per item template. If you want to show multiple records/rows/objects you will need an intermediate step to aggregate the individual record/row/object together.
then you could bind to the gridview. however, i would recommend the ListView so you can customize the layout however you like.

Grid view - Column

I am creating an application in asp.net..I used a grid view to show the datas .. By using the autogenerate columns
I bind the datas to the gridview.. Now i want to make a edit button at the end ..By clicking that the user can edit their details ...
But i need to count the number of columns in a row to make a pop up window to edit the details.. How to find out the number of columns in a autogenerated grid..Number of columns varies depend upon the user..So how to find the number of columns..
You will get the no of columns through like this
int NoOfColumns=GridView1.Rows[0].Cells.Count;
You can find,
How many columns are in gridview with
GridView1.Columns.Count
How many cells are in one row of gridview with
GridView1.Rows[..].Cells.Count
Best Regards
Myra

How do I manually add additional rows to the bottom of an ASP.NET gridview?

I have a situation where I'm populating a gridview with a bound data source, and want two additional rows at the very bottom; one to show the sum of values in the columns and one to show the average of values in the columns. I can quite easily calculate these values by aggregating information taken from the rowDataBound event, but don't know how to go about manually adding the additional two rows to the gridview. Any help much appreciated.
You can use the Footer just like you use Headers in gridview. Another solution is use a query in such way:
query 1 : your original query
UNION
query 2 : your query which contains sum
(This applies only if you don't apply paging to your grid)
If it's a single row of information you can use summary footer. See Displaying Summary Information in the GridView's Footer.
(source: asp.net)
If you want two additional rows, you can stuff rows into an IList. At the business logic layer, you can add more rows to the list returned by DAL.

Resources