Hi Lubomir,
I looked in my code and delete all obsolute code and it is working for me. This is the code of my custom webpart, hopefully you can see what is different with your code:
UniGrid.ascx
<%@ Register src="~/CMSAdminControls/UI/UniGrid/UniGrid.ascx" TagName="UniGrid" TagPrefix="cms" %>
<%@ Register Namespace="CMS.UIControls.UniGridConfig" TagPrefix="ug" Assembly="CMS.UIControls" %>
<cms:UniGrid runat="server" ID="UniGrid" IsLiveSite="true">
<GridColumns>
<ug:Column Source="DocumentName" Caption="Document name" Wrap="false" />
<ug:Column Source="DocumentDescription" Caption="Description" Wrap="false" />
</GridColumns>
</cms:UniGrid>
UniGrid.ascx.cs
/// <summary>
/// Initializes the control properties.
/// </summary>
protected void SetupControl()
{
if (StopProcessing)
{
// Do not process
}
else
{
}
}
/// <summary>
/// Loads and setups web part.
/// </summary>
protected override void OnLoad(EventArgs e)
{
// Load the grid data
ReloadGrid();
base.OnLoad(e);
}
/// <summary>
/// Reloads the grid with given page index.
/// </summary>
protected void ReloadGrid()
{
// Reload data
if (this.DataSourceControl != null && DataSourceControl.DataSource != null && !binded)
{
System.Data.DataSet ds = new System.Data.DataSet();
ds.Tables.Add(((System.Data.DataView)DataSourceControl.DataSource).ToTable());
UniGrid.DataSource = ds;
UniGrid.DataBind();
UniGrid.ReloadData();
}
}
Good luck with debugging your UniGrid!!!!
If this answer helped you, please vote for my answer :-)