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

Extract Part of grid data.

1 Answer 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mSchmidt
Top achievements
Rank 1
mSchmidt asked on 08 Oct 2008, 09:21 PM
Hi iam trying to extract part of a Radgrid and display it as simple html in a RadEditor (iam then going to allow my users to send this as an email.

However my problem arises with columns using

 

<ItemTemplate>

 

<%

# string.Format("{0} {1}",DataBinder.Eval(Container.DataItem, "ingredient_parcelquantity") ,DataBinder.Eval(Container.DataItem, "parcel_unit"))%>

 

 

</ItemTemplate>

 


these does not hold the result data in the Text property.
How can i make this possible ?
Is there any easier way for me to achieve my goal ?
HtmlTable mTable = new HtmlTable();  
            System.IO.StringWriter s = new System.IO.StringWriter();  
            HtmlTextWriter htw = new HtmlTextWriter(s);  
            foreach (GridDataItem a in RadGrid_Ingredient.SelectedItems)   
            {  
 
                HtmlTableRow tr = new HtmlTableRow();  
                for (int i = 5; i < 19; i++)  
                {  
                    HtmlTableCell tc = new HtmlTableCell();  
                    tc.InnerHtml = a.Cells[i].Text;  
                    tr.Cells.Add(tc);  
                }  
                mTable.Rows.Add(tr);  
                  
            }  
            mTable.RenderControl(htw);  
            RadEditor1.Content = s.ToString(); 

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 13 Oct 2008, 11:23 AM
Hi mSchmidt,

I believe the issue at hand was addressed in the following post. If any additional questions arise, you can use the other post, to avoid duplicate identical threads.

Best wishes,
Yavor
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
Yavor
Telerik team
Share this question
or