Hello
I have to display a list of parameters with a hierarchic relation between them. I use a RadTreeList and it works fine.
My tree list has a "Value" column.
I would like to change some values in this column but I don't want to make the changes row by row (by entering in edit mode, making modification and updating). I'd prefer to keep all the rows in edit mode, make the modifications in some of them and validate by clicking on an external button.
I didn't find something like that in the demos.
I tried to use an ItemTemplate for the edit column.
The display is correct but when there is a postback, the data are reloaded. So I would like to keep the modifications in a dictionary in order to overwrite the bound values.
My problem is that I can't get the event when a textbox is modified (to save the new value in the dictionary. I added:
AutoPostBack="true" OnTextChanged="tbxValue_TextChanged" in my template textbox description but the method is never called.
Has anyone an idea to solve my problem or to provide another way to implement my feature (without ItemTemplate and edit mode) ?
Thank you
Jean-Charles
I have to display a list of parameters with a hierarchic relation between them. I use a RadTreeList and it works fine.
My tree list has a "Value" column.
I would like to change some values in this column but I don't want to make the changes row by row (by entering in edit mode, making modification and updating). I'd prefer to keep all the rows in edit mode, make the modifications in some of them and validate by clicking on an external button.
I didn't find something like that in the demos.
I tried to use an ItemTemplate for the edit column.
<
telerik:RadTreeList
runat
=
"server"
ID
=
"RadTreeListParameters"
Skin
=
"Telerik"
AutoGenerateColumns
=
"false"
DataKeyNames
=
"ServiceParameterID"
ParentDataKeyNames
=
"ParentParameterID"
AllowSorting
=
"true"
DataSourceID
=
"ObjectDataSource1"
OnDataBound
=
"RadTreeListParameters_DataBound"
ItemStyle-CssClass
=
"RowStyle"
AlternatingItemStyle-CssClass
=
"AlternatingRowStyle"
HeaderStyle-CssClass
=
"HeaderStyle"
SelectedItemStyle-CssClass
=
"SelectedRowStyle"
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"false"
UseStaticHeaders
=
"false"
/>
<
Resizing
AllowColumnResize
=
"true"
ResizeMode
=
"NoScroll"
/>
</
ClientSettings
>
<
Columns
>
<
telerik:TreeListBoundColumn
DataField
=
"ServiceParameterID"
UniqueName
=
"ServiceParameterID"
HeaderText
=
"ServiceParameterID"
Display
=
"true"
></
telerik:TreeListBoundColumn
>
<
telerik:TreeListBoundColumn
DataField
=
"Role"
UniqueName
=
"Role"
HeaderText
=
"Role"
ReadOnly
=
"true"
></
telerik:TreeListBoundColumn
>
<
telerik:TreeListBoundColumn
DataField
=
"Type"
UniqueName
=
"Type"
HeaderText
=
"Type"
ReadOnly
=
"true"
></
telerik:TreeListBoundColumn
>
<
telerik:TreeListBoundColumn
DataField
=
"Name"
UniqueName
=
"Name"
HeaderText
=
"Name"
ReadOnly
=
"true"
></
telerik:TreeListBoundColumn
>
<
telerik:TreeListTemplateColumn
DataField
=
"Value"
UniqueName
=
"TemplateColumn"
HeaderText
=
"Value"
>
<
ItemTemplate
>
<
asp:TextBox
runat
=
"server"
ID
=
"tbxValue"
Value='<%# Eval("Value") %>' />
</
ItemTemplate
>
</
telerik:TreeListTemplateColumn
>
</
Columns
>
</
telerik:RadTreeList
>
The display is correct but when there is a postback, the data are reloaded. So I would like to keep the modifications in a dictionary in order to overwrite the bound values.
protected void RadTreeListParameters_DataBound(object sender, EventArgs e)
{
foreach (TreeListDataItem item in this.RadTreeListParameters.Items)
{
string id = item.GetDataKeyValue("ServiceParameterID").ToString();
if (this.parameters_values_dico != null && this.parameters_values_dico.Keys.Contains(id))
{
(item["TemplateColumn"].FindControl("tbxValue") as TextBox).Text = this.parameters_values_dico[id];
}
}
}
My problem is that I can't get the event when a textbox is modified (to save the new value in the dictionary. I added:
AutoPostBack="true" OnTextChanged="tbxValue_TextChanged" in my template textbox description but the method is never called.
Has anyone an idea to solve my problem or to provide another way to implement my feature (without ItemTemplate and edit mode) ?
Thank you
Jean-Charles