6 Answers, 1 is accepted
0
Hello Paul,
Please examine the Accessing Cells and Items help topic to see how to access the checkboxes.
The RadTreeList provides pop-up editing mode. You can see it here.
I hope this helps.
Greetings,
Mira
the Telerik team
Please examine the Accessing Cells and Items help topic to see how to access the checkboxes.
The RadTreeList provides pop-up editing mode. You can see it here.
I hope this helps.
Greetings,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Paul
Top achievements
Rank 1
answered on 09 Nov 2011, 02:47 PM
I was a bit vague with my question. By allow the checkboxes to be clicked and change state in the TreeList, I meant strictly client side, no AJAX, clicking a checkbox would fire an client-side script where I could change the state of the checkbox and possibly change the enabling/disabling of other checkboxes within the same record.
I found a similar post to mine, but I have not been able to get it to work. I define the TreeList server-side:
Dim
checkBoxColumn
As
New
TreeListCheckBoxColumn()
tlConfig.Columns.Add(checkBoxColumn)
checkBoxColumn.DataField = “Auditability“
checkBoxColumn.UniqueName = “Auditability”
checkBoxColumn.HeaderText = “Auditability”
checkBoxColumn.HeaderStyle.Width = Unit.Pixel(50)
checkBoxColumn.
ReadOnly
=
False
checkBoxColumn.ItemStyle.CssClass =
"centered"
In the ItemDataBound event:
If
TypeOf
e.Item
Is
TreeListDataItem
Then
Dim
treeListDataItem
As
TreeListDataItem =
CType
(e.Item, TreeListDataItem)
DirectCast
(e.Item.FindControl(
"Auditability"
), CheckBox).Attributes(
"onclick"
) = _
[
String
].Format(
"return Auditable_onClick('{0}', event);"
, _
DirectCast
(treeListDataItem.DataItem, ConfigListItem).Index.ToString())
End
If
The problem I am having is the “e.Item.FindControl("Auditability")”. When I use VS QuickWatch to examine the available controls, I cannot find Auditability, but I can find clientIDs. Is there a way around this or does not work when the TreeList is define server-side?
0
Hello Paul,
Please use the following code in order to find the checkboxes and set the onclick event handlers:
I hope this helps.
Greetings,
Mira
the Telerik team
Please use the following code in order to find the checkboxes and set the onclick event handlers:
If
TypeOf
e.Item
Is
TreeListDataItem
Then
Dim
treeListDataItem
As
TreeListDataItem =
CType
(e.Item, TreeListDataItem)
DirectCast
(treeListDataItem(
"Auditability"
).Controls(0), CheckBox).Attributes(
"onclick"
) =
String
.Format(
"return Auditable_onClick('{0}', event);"
, _
DirectCast
(treeListDataItem.DataItem, ConfigListItem).Index.ToString())
End
If
I hope this helps.
Greetings,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Paul
Top achievements
Rank 1
answered on 09 Nov 2011, 05:08 PM
Thanks for the response Mira.
I tried your code. The function Auditable_onClick is not being called. Just for the heck of it I tried to reference Controls(1) and get an index out of range, so there is only one control. I also tried changing the [Attributes(“onclick”)] to [Attributes.Add(“onclick”,] with the same result.
I tried your code. The function Auditable_onClick is not being called. Just for the heck of it I tried to reference Controls(1) and get an index out of range, so there is only one control. I also tried changing the [Attributes(“onclick”)] to [Attributes.Add(“onclick”,] with the same result.
0
Accepted
Hello Paul,
I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.
I hope it helps.
All the best,
Mira
the Telerik team
I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.
I hope it helps.
All the best,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Paul
Top achievements
Rank 1
answered on 11 Nov 2011, 08:26 PM
Thanks that really helped.
Paul