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

Expandable row like editable row onclick but only a readonly

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Subbarao
Top achievements
Rank 1
Subbarao asked on 23 Mar 2010, 09:20 PM
Hi
I have a radgrid w/ a column whose width say is 50 characters allowed to be displayed out of 1000 characters.

I have to display the column in the expandable row on-row-click which displays all the 1000 characters for a column in that row.

This is similar to editable rows like form but should be only used for displaying the content. Please note, there is no data update.

Would be appreciable to know.

Thanks in advance.
SR

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Mar 2010, 08:13 AM

Hi Subbarao,

One suggestion would be placing Literal control in NestedViewTemplate and setting the Text property explicitly from code behind. Here is the example of the approach.

ASPX:

 
    <NestedViewTemplate>  
        <asp:Literal ID="Literal1" runat="server">  
        </asp:Literal>  
    </NestedViewTemplate> 

C#:

 
    protected void RadGrid1_PreRender(object sender, EventArgs e)  
    {  
        foreach (GridDataItem dataItem in RadGrid1.Items)  
        {  
            GridNestedViewItem nestedItem = (GridNestedViewItem)dataItem.ChildItem; // to access the nestedviewitem                        
            ((Literal)nestedItem.FindControl("Literal1")).Text = dataItem["CompanyName"].Text;            
        }     
    } 

-Shinu.

0
Subbarao
Top achievements
Rank 1
answered on 24 Mar 2010, 04:34 PM
Hi Shinu,

 I appreciate your understanding.
 But the requirement is at the click on the row on a radgrid.
 We get form like expandable row as in Edit mode of radgrid.
This is not a form but expanding a content for reading further information that is collapsable.

Thank you,
sr
Tags
Grid
Asked by
Subbarao
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Subbarao
Top achievements
Rank 1
Share this question
or