Hi,
Iam using Infragistics XamDatagrid which is having say 8 columns and 100 records for example. I have grouped the grid with 4 Columns in the groupBy area which resulted in 7 rows(visible directly) and internally having remaining records. Now if i expand the first row, i get another group which is having 10 records in this example.....When the grid is not grouped, i am traversing through the records using Prev and Next Buttons which i am using ...now my problem is iam not able to hold the correct index of the row when the XamDataGrid is Grouped with multiple Columns.......Please suggest me a way of how can i traverse/Navigate through the internal DataRecords which are inside the inner Groups of the XamDataGrid Sequentially using Prev / Next buttons ....
Thanks in Advance
Ram
Ram,
In this case, before casting the record to another type, you should use the "is" expression to check if the record is DataRecord or GroupByRecord, for example:
if(e.Record is GroupByRecord)
{
GroupByRecord gr = e.Record as GroupByRecord;
}
Hi Alex,
Thanks for the reply, that helped me in 2 ways
i) I am able to traverse through the DataRecords when the Grid is not grouped with any columns
ii) When i group the XamDataGrid with certain number of columns, i was able to traverse though the records in a particular Group.
The problem here is when i get a GroupByRecord in the middle of 2 DataRecords, as we get in case when we group the XamDataGrid with certain number of columns, it gives an Casting Error saying "Cannot Convert from GroupByRecord to DataRecord".....the problem is if i can get the total record count of the (DataRecord' s+GroupByRecord's) i think i can handle this situation(having Prev/Next buttons Enabled/disabled based on the Row Count). Is there any other way to navigate to only the DataRecords ?? ...Please give a suggestion
Thanks
Hello Ram,
Are you looking for something like:
xamDataGrid.ExecuteCommand(DataPresenterCommands.RecordNext);
Please note, that this will navigate to the next record as long as you have an Active Record.