Hi all,
Basically i have a grid which is declared statically, as in the following example:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html#Section1
Now when i declare the columns in the markup, everything works fine (grouping/ filtering / self reference hierarchy, by the way, in the following example the hierarchy is not declared, i know hehe).
EDIT: Solved the grouping problem, it was a mistake with the execution of the grid creation procedure.
Now problem is, when i run a procedure in code-behind that creates the columns / hierarchy, the needdatasource handler doesnt seem to work...and starts throwing errors regarding "Multiple textbox with the same Id" or something similar when i try to drag and group by a column, filter works, and the hierarchy doesn't. My datasource is a list of entities using the IEnumerable interface, so from what i have read, it should not cause any problems D:
Attaching code-behind:
EDIT: Still having problem creating the hierarchy from code-behid.
Also a little note, the procedure that reads "CrearBoundColumn", returns a GridBoundColumn object, it was just a test.
Thanks in advance for any help.
Basically i have a grid which is declared statically, as in the following example:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html#Section1
Now when i declare the columns in the markup, everything works fine (grouping/ filtering / self reference hierarchy, by the way, in the following example the hierarchy is not declared, i know hehe).
EDIT: Solved the grouping problem, it was a mistake with the execution of the grid creation procedure.
Now problem is, when i run a procedure in code-behind that creates the columns / hierarchy, the needdatasource handler doesnt seem to work...and starts throwing errors regarding "Multiple textbox with the same Id" or something similar when i try to drag and group by a column, filter works, and the hierarchy doesn't. My datasource is a list of entities using the IEnumerable interface, so from what i have read, it should not cause any problems D:
Attaching code-behind:
EDIT: Still having problem creating the hierarchy from code-behid.
protected
void
CreateGridStructure()
{
RadGrid1.MasterTableView.DataKeyNames =
new
string
[] {
"ElementoJerarquia.Parent.Id"
,
"ElementoJerarquia.Id"
};
RadGrid1.MasterTableView.ClientDataKeyNames =
new
string
[] {
"Id"
,
"Numero"
,
"Responsable.NombreCompleto"
,
"ElementoJerarquia.Nombre"
};
RadGrid1.MasterTableView.FilterExpression =
"ElementoJerarquia.Parent.Id IS NULL"
;
RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
RadGrid1.MasterTableView.SelfHierarchySettings.KeyName =
"ElementoJerarquia.Parent.Id"
;
RadGrid1.MasterTableView.SelfHierarchySettings.ParentKeyName =
"ElementoJerarquia.Id"
;
}
Also a little note, the procedure that reads "CrearBoundColumn", returns a GridBoundColumn object, it was just a test.
Thanks in advance for any help.