I'm using a listview with custom items to display formatted data from our database.
For some reason, I can't seem to get rid of the pesky checkboxes for each item. I've got the following properties defined...at this point both in the visual editor as well as in code that runs after the form on load method.
Guessing there is something happening with how I'm creating and configuring the custom items.
using:
I initialize this class (modeled after the Telerik custom item demo)
Obviously something, somewhere, is overriding my definition that checkboxes should not be visible, but I can't seem to track it down.
Any help is appreciated. More code can be provided if need be, but wanted to provide the "most relevant" snippets first.
Additionally, for bonus appreciation, I'm seeing the following (new to Telerik, so probably some noobie issues):
- I'm binding to the listview using a List<Entities> from MS Entity Framework. No matter what I seem to do, the list of entities seems to be overlaid on the visual elements shown above to get messy overlap. Ideally I would hide the data from each item with the exception of the data flowing through the custom visual elements
- I've tried a variety of NotifyParentOnMouseInput and ShouldHandleMouseInput configurations, but I still am not able to click on a list item to select. It could be that clicking a row automatically processes the checkbox instead of selecting the item? I'll know once I resolve the issue above. I am however able to use the keyboard up and down arrows to move up and down the list, selecting items as I go.
For some reason, I can't seem to get rid of the pesky checkboxes for each item. I've got the following properties defined...at this point both in the visual editor as well as in code that runs after the form on load method.
lvProgramGoals.ViewType = ListViewType.IconsView;
lvProgramGoals.FullRowSelect =
true
;
lvProgramGoals.AllowEdit =
false
;
lvProgramGoals.AllowRemove =
false
;
lvProgramGoals.ShowCheckBoxes =
false
;
Guessing there is something happening with how I'm creating and configuring the custom items.
using:
private
void
lvProgramGoals_VisualItemCreating(
object
sender, Telerik.WinControls.UI.ListViewVisualItemCreatingEventArgs e)
{
e.VisualItem =
new
CustomVisualItem();
}
I initialize this class (modeled after the Telerik custom item demo)
class
CustomVisualItem : IconListViewVisualItem
{
private
StackLayoutPanel titleLayout;
private
StackLayoutPanel stackLayout;
private
LightVisualElement nameElement;
private
LightVisualElement descriptionElement;
private
LightVisualElement dateRange;
public
CustomVisualItem()
{
base
.CreateChildElements();
titleLayout =
new
StackLayoutPanel();
titleLayout.Orientation = Orientation.Horizontal;
titleLayout.Size =
new
System.Drawing.Size(200, 30);
nameElement =
new
LightVisualElement();
nameElement.TextAlignment = ContentAlignment.MiddleLeft;
nameElement.TextWrap =
true
;
titleLayout.Children.Add(nameElement);
dateRange =
new
LightVisualElement();
dateRange.TextAlignment = ContentAlignment.MiddleRight;
titleLayout.Children.Add(dateRange);
stackLayout =
new
StackLayoutPanel();
stackLayout.Orientation = Orientation.Vertical;
stackLayout.Children.Add(titleLayout);
descriptionElement =
new
LightVisualElement();
descriptionElement.TextAlignment = ContentAlignment.BottomCenter;
stackLayout.Children.Add(descriptionElement);
stackLayout.Size =
new
Size(200, 60);
this
.Children.Add(stackLayout);
this
.GradientStyle = GradientStyles.Gel;
}
protected
override
void
SynchronizeProperties()
{
base
.SynchronizeProperties();
this
.nameElement.Text = Convert.ToString(
this
.Data[ProgramGoals.COLUMN_NAME]);
this
.descriptionElement.Text = Convert.ToString(
this
.Data[ProgramGoals.COLUMN_DESCRIPTION]);
//TODO: convert date format to MM/dd/yyyy
string
dateStr =
this
.Data[ProgramGoals.COLUMN_START].ToString() +
" to "
+
this
.Data[ProgramGoals.COLUMN_END].ToString();
this
.dateRange.Text = Convert.ToString(dateStr);
}
protected
override
Type ThemeEffectiveType
{
get
{
return
typeof
(SimpleListViewVisualItem); }
}
}
Obviously something, somewhere, is overriding my definition that checkboxes should not be visible, but I can't seem to track it down.
Any help is appreciated. More code can be provided if need be, but wanted to provide the "most relevant" snippets first.
Additionally, for bonus appreciation, I'm seeing the following (new to Telerik, so probably some noobie issues):
- I'm binding to the listview using a List<Entities> from MS Entity Framework. No matter what I seem to do, the list of entities seems to be overlaid on the visual elements shown above to get messy overlap. Ideally I would hide the data from each item with the exception of the data flowing through the custom visual elements
- I've tried a variety of NotifyParentOnMouseInput and ShouldHandleMouseInput configurations, but I still am not able to click on a list item to select. It could be that clicking a row automatically processes the checkbox instead of selecting the item? I'll know once I resolve the issue above. I am however able to use the keyboard up and down arrows to move up and down the list, selecting items as I go.