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

RadGrid with NestedViewTemplate and Scrolling

3 Answers 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Itay
Top achievements
Rank 1
Itay asked on 08 Jun 2011, 10:50 PM
I am trying to use the NestedViewTemplate with scrollable table.
I would simple like to add a nested template into a table like this one:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/scrolling/defaultcs.aspx

However, I have no luck doing so...

There might be another way to achieve what i'm looking for, which is to have a grid where each row is actually contracted out of 2 rows so the second row of the record (similar to nestedview) will present some additional info (like "comments")

Something like this:

Row1, Cell 1:<name> | Row1, Cell 2:<email> | Row1, Cell 3:<phone> | Row1, Cell 4:<>
Row2, Cell1 (colspan=4) comments are typed here                                                    
Row3, Cell 1:<name> | Row3, Cell 2:<email> | Row3, Cell 3:<phone> | Row3, Cell 4:<>
Row4, Cell1 (colspan=4) comments are typed here                                                    


Is that possible?

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 09 Jun 2011, 08:49 AM
Hello Itay,

You can use NestedViewTemplate feature where you can place new grid with scrolling and static headers.

Additionally, you can refer to the code library below which elaborates on how you can add scrolls to each table in the grid hierarchy.
http://www.telerik.com/community/code-library/aspnet-ajax/grid/separate-scrolls-for-inner-tables-in-hierarchical-grid.aspx

All the best,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Itay
Top achievements
Rank 1
answered on 09 Jun 2011, 02:26 PM
Thank you for the quick response, 
The example you have shared with me is very nice but doesn't meet the requirements we are looking for.

I need a table with StaticHeaders and scrolling and in the master table view we need each row to have another row which will present more info of the record, it's very important that the information will be displayed to the user without having to click on the row...

I have tried to impl based on your example, however, I can't get it to work...
I am using a simple binding without the linq datasource...

Here is the code:


     <telerik:RadAjaxManager ID="RadAjaxManager2" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
                
        
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
            Transparency="25" Width="75px">
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                style="border: 0px;" />
        </telerik:RadAjaxLoadingPanel>
        
        <telerik:RadGrid 
        MasterTableView-Dir="LTR" 
        ID="RadGrid1" 
        runat="server" 
        AllowPaging="True" 
        PageSize="50" 
        OnItemCreated="RadGrid1_ItemCreated"
        AutoGenerateColumns="false">
        <MasterTableView>
            <DetailTables>
                <telerik:GridTableView>
                    <ItemTemplate>
                        aaaa
                    </ItemTemplate>
                </telerik:GridTableView>
            </DetailTables>
        <Columns>
            <telerik:GridBoundColumn DataField="CustomerType" HeaderText="Customer" />
            <telerik:GridBoundColumn DataField="CategoryName" HeaderText="Category" />
        </Columns>        
        </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
            </ClientSettings>
        </telerik:RadGrid>


And the Code Behind:

   protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RadGrid1.DataSource = GetList(0, 20);
            RadGrid1.DataBind();
        }
    }

   protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridNestedViewItem)
        {
            GridNestedViewItem nestedItem = e.Item as GridNestedViewItem;
            nestedItem.NestedViewCell.PreRender += new EventHandler(NestedViewCell_PreRender);
        }
    }


    private void NestedViewCell_PreRender(object sender, EventArgs e)
    {
        ((Control)sender).Controls[0].SetRenderMethodDelegate(new RenderMethod(this.NestedViewTable_Render));
    }


    protected void NestedViewTable_Render(HtmlTextWriter writer, Control control)
    {
        control.SetRenderMethodDelegate(null);
    }


 
0
Pavlina
Telerik team
answered on 10 Jun 2011, 05:12 PM
Hi Itay,

Can you please open a formal support ticket and send us a simple running project (incl. CSS, images, skins, DB backup if needed and so on) demonstrating the logic of your application?  In that way we can draw a clear picture of the case and provide you more to the point solution.

Best wishes,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Itay
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Itay
Top achievements
Rank 1
Share this question
or