This is a migrated thread and some comments may be shown as answers.

Treelist: checkbox not in ExtractValues Hashtable

3 Answers 63 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
sharon
Top achievements
Rank 1
sharon asked on 05 Jun 2016, 06:58 PM

Hi!

   I have a checkbox column within my TreeList, when Click [Add], I could get almost all of the fields within the <telerik:RadTreeList> except the checkbox field.

I have tried, if I changed the InUse Column to  <telerik:TreeListBoundColumn>, it will be included in the ExtractValues Hashtable.  But, when I changed it back to checkbox field(code as below), then it is not included in the hashtable.  How could I get the value of the checkbox?

Thanks in advance!

SH

 

    <telerik:TreeListTemplateColumn DataField="InUse" UniqueName="InUse" HeaderText="Enabled" EditFormHeaderTextFormat="Enabled: ">
                                        <HeaderStyle Width="30px"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkInUse" runat="server" Checked='<%# Eval("InUse").ToString()=="Y"?true:false %>' Enabled="false" />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:CheckBox ID="chkInUse" runat="server" Checked='<%# Eval("InUse").ToString()=="Y"?true:false %>' />
                                        </EditItemTemplate>
                                        <InsertItemTemplate>

                                            <asp:CheckBox ID="chkInUse" runat="server" />
                                        </InsertItemTemplate>
                                    </telerik:TreeListTemplateColumn>

.aspx.cs

protected void radTreeList_InsertCommand(object sender, TreeListCommandEventArgs e)

{
                Hashtable hashPCRelation = new Hashtable();
                TreeListEditableItem editItem = e.Item as TreeListEditableItem;
                TreeListEditFormItem oEditFormItem = editItem as TreeListEditFormItem;
                editItem.ExtractValues(hashPCRelation);

                ...

}

3 Answers, 1 is accepted

Sort by
0
sharon
Top achievements
Rank 1
answered on 06 Jun 2016, 03:38 AM

Never mind, I found the solution here: http://demos.telerik.com/aspnet-ajax/treelist/examples/dataediting/formtemplateusercontrol/defaultcs.aspx

However, why can your tool have a more united way to extract values, users may not necessary know what's the differences between TreeList - Manual data editing or TreeList - Form Template/User Control Edit Form, and need to spent days to look for a solution.

 

0
Viktor Tachev
Telerik team
answered on 08 Jun 2016, 09:59 AM
Hello Sharon,

I am afraid that changing the way data is retrieved from the TreeList items is currently not possible. Such modification would be a breaking change and that will break the control in projects where it is currently up and running.

There is a section in our documentation that describes how you can access the items in different scenarios. Please check out the following resources for additional information on the matter.

Updating and inserting records in FormTemplate and UserControl:


Updating and inserting using autogenerated InPlace and EditForms modes:


Implementing Manual update and insert operations:



Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
sharon
Top achievements
Rank 1
answered on 09 Jun 2016, 05:44 AM
Thank you for the links.
Tags
TreeList
Asked by
sharon
Top achievements
Rank 1
Answers by
sharon
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or