dual Grid, ascx and Windowmanager issue

2 posts, 0 answers
  1. Christian
    Christian avatar
    64 posts
    Member since:
    Apr 2008

    Posted 19 Apr 2012 Link to this post

    Let me start explaining the enverirement, I have a contantpage that holds a grid with columns (template that holds a hyperlink) that opens up a radWindow.
    (content page relevent code)

        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow ID="winArticle" runat="server">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
     
    <script type="text/javascript">
        function openRadWin(art) {
            window.radopen('articleDetails.aspx?art=' + art, 'winArticle');
        }
    </script>
     
    <telerik:RadGrid ID="grArticles" runat="server" CellSpacing="0" GridLines="None"
            EnableEmbeddedSkins="False" Skin="Levweb"
            onneeddatasource="grArticles_NeedDataSource" AutoGenerateColumns="False"
            ondetailtabledatabind="grArticles_DetailTableDataBind"
            onprerender="grArticles_PreRender"
            onitemdatabound="grArticles_ItemDataBound">
     
    <MasterTableView DataKeyNames="as_artnr_6">
     
    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn1 column" UniqueName="ExpandColumn1">
        <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
     
    <DetailTables>
        <telerik:GridTableView DataKeyNames="art_artnr" Name="ArtDetails" Width="100%" ShowHeader="False">
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn SortExpression="art_artnr" HeaderText="art_artnr" HeaderButtonType="TextButton" DataField="art_artnr" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="text" HeaderText="text" HeaderButtonType="TextButton" DataField="text" UniqueName="text">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="art_ritning" HeaderText="art_ritning" HeaderButtonType="TextButton" DataField="art_ritning" UniqueName="art_ritning">
                </telerik:GridBoundColumn>
            </Columns>
        </telerik:GridTableView>
    </DetailTables>
     
    <Columns>
        <telerik:GridTemplateColumn SortExpression="as_artnr_6">
        <ItemTemplate>
            <asp:HyperLink ID="hlArtNr" Runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.as_artnr_6") %>'></asp:HyperLink>
        </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn SortExpression="ben_7">
        <ItemTemplate>
            <asp:HyperLink ID="hlArtBen" Runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ben_7") %>'></asp:HyperLink>
        </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridDateTimeColumn DataField="levdat_3" DataFormatString="{0:yyyy-MM-dd}" FilterControlAltText="Filter column2 column" UniqueName="column2">
        </telerik:GridDateTimeColumn>
        <telerik:GridNumericColumn DataField="rest_antal_4" DecimalDigits="2" DataFormatString="{0:0.#}" FilterControlAltText="Filter column3 column" UniqueName="column3">
        </telerik:GridNumericColumn>
        <telerik:GridBoundColumn DataField="enhet_13" FilterControlAltText="Filter column4 column" UniqueName="column4">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="lev_artnr_10" FilterControlAltText="Filter column5 column" UniqueName="column5">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ordernr_5" FilterControlAltText="Filter column6 column" UniqueName="column6">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="rad_status_20" FilterControlAltText="Filter column7 column" UniqueName="column7">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="hasChild" FilterControlAltText="Filter column7 column" UniqueName="hasChild" Visible="false">
        </telerik:GridBoundColumn>
    </Columns>
     
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
    </telerik:RadGrid>

    protected void grArticles_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                HyperLink lbArtNr = (HyperLink)e.Item.Cells[3].FindControl("hlArtNr");
                HyperLink lbArtBen = (HyperLink)e.Item.Cells[5].FindControl("hlArtBen");
     
                lbArtNr.Attributes["href"] = "#";
                lbArtNr.Attributes["onclick"] = "openRadWin('" + ((HyperLink)e.Item.Cells[2].Controls[1]).Text + "');";
     
                lbArtBen.Attributes["href"] = "#";
                lbArtBen.Attributes["onclick"] = "openRadWin('" + ((HyperLink)e.Item.Cells[2].Controls[1]).Text + "');";
     
            }
        }


    The Window opens up correctly, the window contains an aspx file that is pretty much emtpy except for holding a ascx file at the moment,
    this is the code for the ascx.

    <telerik:RadGrid ID="grArtPlan" runat="server" CellSpacing="0" GridLines="None"
            EnableEmbeddedSkins="False" Skin="Levweb"
            onneeddatasource="grArtPlan_NeedDataSource"
        AutoGenerateColumns="False">
     
    <MasterTableView>
     
    <Columns>
        <telerik:GridBoundColumn DataField="inlevdatum" FilterControlAltText="Filter column5 column" UniqueName="column5">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ordernr" FilterControlAltText="Filter column5 column" UniqueName="column5">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="fsedel" FilterControlAltText="Filter column5 column" UniqueName="column5">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="levantal" FilterControlAltText="Filter column5 column" UniqueName="column5">
        </telerik:GridBoundColumn>
    </Columns>
     
    </MasterTableView>
     
    </telerik:RadGrid>

    protected void Page_Load(object sender, EventArgs e)
        {
            string art = Request.QueryString["art"];
        }
        protected void grArtPlan_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            LevWebService.SrvCoreClient service = new LevWebService.SrvCoreClient();
            DataTable dt = service.ListaLagerPlanBild(((LevWebService.SessUser)Session[common.userSession]).Id, Request.QueryString["art"]);
            grArtPlan.DataSource = dt;
        }

    At this point i get all the relevent data into the datatable, but the rows generated looks empty (number of rows is drawn, but no data)
    See atteched file for a screenshot of the problem. I also atteched a scrren of the data returned to the datatable that shows it has data.

    Any ideas are welcome.

    Regards

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 24 Apr 2012 Link to this post

    Hi Christian,

    I reviewed the provided code and it looks totally correct to me. There is nothing obvious that may cause the problematic behaviour. Could I kindly ask you to open  regular support ticket and send us runnable version of your application. Thus we will be able to debug it locally and do our best to isolate the root cause of this strange behaviour.

    All the best,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top