Hi! How can I go from displaying an EmptyDataTemplate to an ItemTemplate when a user clicks a button?
Currently I have an 'Add' button in the EmptyDataTemplate of a RadListView. I want the user to click the 'Add' button and have the ItemTemplate display (which has various fields for user input).
Here's the aspx code for the EmptyDataTemplate:
Here's the vb.net code for the button click event:
I can step through the code when debugging, but nothing happens when the 'Add' button is clicked.
I also have the same 'Add' button on the EditItemTemplate with a value of 'InitInsert' for the 'CommandName'. This button works fine since the EditItemTemplate fires off the RadListView ItemCommand routine. In the ItemCommand routine for the 'InitInsert' command I have the same 2 lines of code used for the button click.
I'm not understanding why this doesn't work for the button click event, and was wondering if someone could explain it to me or provide an alternate solution.
Thanks!
Currently I have an 'Add' button in the EmptyDataTemplate of a RadListView. I want the user to click the 'Add' button and have the ItemTemplate display (which has various fields for user input).
Here's the aspx code for the EmptyDataTemplate:
<
EmptyDataTemplate
>
<
table
>
<
tr
>
<
td
>
<
fieldset
style
=
"width: 800px"
>
<
legend
>SubSelection</
legend
>No Sub-Selections available.
</
fieldset
>
</
td
>
<
td
style
=
"width: 25%; text-align: right;"
>
<
asp:Button
ID
=
"btnAdd"
runat
=
"server"
Text
=
"Add"
OnClick
=
"btnAdd_Click"
CommandName
=
"InitInsert"
/>
</
td
>
</
tr
>
</
table
>
</
EmptyDataTemplate
>
Here's the vb.net code for the button click event:
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
RadListView1.InsertItemPosition = RadListViewInsertItemPosition.FirstItem
RadListView1.Rebind()
End Sub
I can step through the code when debugging, but nothing happens when the 'Add' button is clicked.
I also have the same 'Add' button on the EditItemTemplate with a value of 'InitInsert' for the 'CommandName'. This button works fine since the EditItemTemplate fires off the RadListView ItemCommand routine. In the ItemCommand routine for the 'InitInsert' command I have the same 2 lines of code used for the button click.
I'm not understanding why this doesn't work for the button click event, and was wondering if someone could explain it to me or provide an alternate solution.
Thanks!