Unigrid with Custom Table

Tanetta Jordan asked on May 13, 2015 21:41

I am trying to setup the unigrid to use a custom table and have been running into all sorts of issues. I have followed the Kentico tutorial successfully (docs.kentico.com/display/K82/UniGrid). But when i try to change the parameters to use a custom table as the object type, I get a "[AbstractUserControl.ShowMessage]: Page is not 'CMSPage' or missing messages placeholder" error. I've even tried to use a custom table datasource (see below). I'm not sure what i'm missing. I just want the basic functionality to work. Any thoughts?

<div class="cms-bootstrap">
        <ajaxToolkit:ToolkitScriptManager ID="manScript" runat="server" EnableViewState="false" />
        <asp:Label runat="server" ID="lblInfo" EnableViewState="false" Visible="false" />
        <cms:MessagesPlaceHolder ID="plcMess" runat="server" />
        <cms:CustomTableDataSource ID="ctDS" runat="server" CustomTable="customtable.SampleTable" SelectedQueryStringKeyName="ItemID" />
        <cms:UniGrid ID="ugSteps" runat="server" ShowObjectMenu="false" PageSize="All">
            <GridActions>
                <ug:Action Name="edit" CommandArgument="Name" Caption="$General.Edit$" Icon="Edit.png" />
                <ug:Action Name="delete" CommandArgument="Name" Caption="$General.Delete$"
                    Icon="Delete.png" Confirmation="$CheckoutProcess.ConfirmDefaultProcess$" />                   
                <ug:Action Name="view" Caption="$General.View$" FontIconClass="icon-eye" FontIconStyle="allow" />
            </GridActions>
            <GridColumns>
                <ug:Column Source="##All##" Caption="$CheckoutProcess.Order$" Wrap="false" ExternalSourceName="StepOrder">
                </ug:Column>
                <ug:Column Source="Caption" Caption="$CheckoutProcess.Caption$" Wrap="false">
                </ug:Column>
                <ug:Column Wrap="false" Width="100%" />
            </GridColumns>
        </cms:UniGrid>
        </div>

protected void Page_Load(object sender, EventArgs e)
{
    // Registers the default CSS and JavaScript files onto the page (used to style the UniGrid)
    CSSHelper.RegisterBootstrap(Page);
    ScriptHelper.RegisterBootstrapScripts(Page);

    // Assigns a handler for the OnAction event
    //UserGrid.OnAction += userGrid_OnAction;
    try
    {

        ugSteps.DataSource = ctDS;
        ugSteps.DataBind();
    }
    catch (Exception ex)
    {
        plcMess.ErrorText = ex.ToString();
    }


}

Recent Answers


Brenden Kehren answered on May 22, 2015 21:25

I'd strip your control down to as little as possible and then try it. Remove the message placeholder, the ajax control toolkit reference (as Kentico already uses that, just have to reference <ajaxToolkit:ControlName>) and don't register the other pieces for css or js. Are you trying to use this outside of the CMS, like on a public facing page?

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.