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

Add picture across multiple columns for row

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
TJ
Top achievements
Rank 2
TJ asked on 18 Mar 2009, 03:56 PM
Hi there,

I'm new to this forum and to telerik controls.

Can anyone tell me how I can add a picture that would span across multiple columns (approximately 3 columns) for each row of the radgrid?

I would appreciate any help you can provide.

Thanks,
D

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Mar 2009, 05:21 AM
Hi,

I would suggest you to use a NestedViewTemplate. So that the Image will be shown for each row and will span across the entire Grid columns. You may set HierarchyDefaultExpanded property to true. So that the Image will shown without expanding the Grid rows. You can aslo hide the Expand/Collapse button.

ASPX:
 
<MasterTableView HierarchyDefaultExpanded="true" >   
         <NestedViewTemplate>   
             <asp:Image ID="Image1"    runat="server"  ImageUrl="~/Image/Image1.gif" />   
       </NestedViewTemplate>        
  


Code to Hide the Expand/Collapse button.

CS:
  
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
        { 
            if (col.UniqueName == "ExpandColumn"
                col.Display = false
        } 
        
    } 


Thanks
Shinu
Tags
Grid
Asked by
TJ
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or