Treeview populated with undefined values when AutoGenerateColums is false

4 posts, 0 answers
  1. Tomislav
    Tomislav avatar
    10 posts
    Member since:
    Jan 2014

    Posted 03 Dec 2014 Link to this post

    Hi,

    i have undefined values when i try to define my own columns, when AutoGenerateColumns = "true" it works fine.

    <telerik:RadGantt ID="RadGantt1" runat="server" SelectedView="MonthView" Skin="Silk"  ReadOnly="true" AutoGenerateColumns="false" ListWidth="351px" DataSourceID="TaskSource" DependenciesDataSourceID="DependenciesSource" >
                <YearView UserSelectable="true" />
                <DayView UserSelectable="false" />
                
                <Columns>
                    <telerik:GanttBoundColumn DataField="Naziv" DataType="String" Width="120px" AllowEdit="true"></telerik:GanttBoundColumn>
                    <telerik:GanttBoundColumn DataField="DatumOd" DataType="DateTime"  Width="40px" ></telerik:GanttBoundColumn>
                    <telerik:GanttBoundColumn DataField="DatumDo" DataType="DateTime"  Width="40px" ></telerik:GanttBoundColumn>
                </Columns>
                
                <DataBindings>
                    <TasksDataBindings
                        IdField="IdAkcije"  
                        StartField="DatumOd" EndField="DatumDo"
                        ParentIdField="Dependence" SummaryField="Summary"
                        TitleField="Naziv"
                        PercentCompleteField="PercentComplete"  />
                    <DependenciesDataBindings
                         IdField="IdAkcije"
                        PredecessorIdField="PredecessorID"
                        SuccessorIdField="SuccessorID"
                        TypeField="Type" />
                </DataBindings>
                <Localization HeaderMonth="<%$ GetString: 24_Py_Mjesec %>" HeaderWeek="<%$ GetString: 00_Pub_Week %>" />
            </telerik:RadGantt>
        </div>

        <asp:SqlDataSource runat="server" ID="TaskSource" ConnectionString="<%$ ConnectionStrings: HrNet.Core.SqlServer %>" SelectCommandType="StoredProcedure" SelectCommand="gorGanttPregled" ProviderName="System.Data.SqlClient">
        </asp:SqlDataSource>

        <asp:SqlDataSource runat="server" ID="DependenciesSource" ConnectionString="<%$ ConnectionStrings: HrNet.Core.SqlServer %>" SelectCommandType="StoredProcedure" SelectCommand="gorGanttDependanciesPregled" ProviderName="System.Data.SqlClient">
        </asp:SqlDataSource>
  2. Bozhidar
    Admin
    Bozhidar avatar
    1118 posts

    Posted 05 Dec 2014 Link to this post

    Hi,

    I've attached a small sample page demonstrating the Manually defined columns working accordingly. You can test it on your end to verify the functionality. 

    I also noticed that in your sample you are using a stored procedure to load the tasks and dependencies. If this is the source of the issue, could you modify the sample so that it uses a stored procedure similar to yours and send it back to us, so that we can test it locally?

    Regards,
    Bozhidar
    Telerik
  3. Sypher
    Sypher avatar
    79 posts
    Member since:
    Aug 2006

    Posted 06 Aug 2015 Link to this post

    I'm seeing the same issue, also using a stored procedure. Using 2014.2.274.45 in Visual Studio 2015. If I use AutoGenerateColumns="true", the columns populate. If I set that to false and choose columns to show just like Tomislav did, the columns just show "undefined" as the value. Attached is a screenshot of the gantt chart pulling in data from our database via a stored procedure. I tried editing the sample project from Bozhidar, but I couldn't get the sample database file to connect with the SqlDataSource after I upgraded it to work in VS 2015.

  4. Sypher
    Sypher avatar
    79 posts
    Member since:
    Aug 2006

    Posted 06 Aug 2015 in reply to Sypher Link to this post

    After upgrading to the latest version (2015.2.729.45) , I noticed a few changes:

    • The columns no longer show "undefined". They just show blanks.
    • Turning AutoGenerateColumns="true" now shows both the generated columns and the declared columns.
    • Changing my DataFields to use the gantt chart's field names instead of my column names fixes the issue!

    So, for the DataField="Naziv" in Tomislav's example, it should instead be DataField="Title"!

    That makes no sense to me, as I would expect the DataField names to come from my data source just like they do in every other ASP.NET AJAX control, but now that I know what's going on, I can work around it.

Back to Top