This is a migrated thread and some comments may be shown as answers.

Extract data from grid, depending on selection

1 Answer 22 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mSchmidt
Top achievements
Rank 1
mSchmidt asked on 29 Oct 2008, 09:10 AM
Hi

Iam extracting data from a grid using the script below, however my problem is that my values (5 and 20) are false when the grid is grouped.

I have some specific columns which i want to extract, how should i do this instead ?

            foreach (GridDataItem dataItem in RadGrid_Ingredient.SelectedItems)  
            {  
                dataItem.Selected = false;  
                tr = new HtmlTableRow();  
                  
                for (int i = 5; i < 20; i++)  
                {  
                  
                    tc = new HtmlTableCell();  
                    tc.InnerHtml = extractString(dataItem.Cells[i]);  
                    tr.Cells.Add(tc);  
                }  
                mTable.Rows.Add(tr);  
            } 

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 31 Oct 2008, 09:09 AM
Hi mSchmidt,

You may consider using column unique names instead of Cells collection indexing to reference the cells in question and extract values from them. Review the online resources below which elaborate on this subject:

http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/Programming/AccessingCellsAndRows/DefaultCS.aspx
http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
mSchmidt
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or