Hi
I have a problem with the listview I have a close proximity to the demo, however when you click on the insert button you need to do so twice before the Insert Template is used. Stepping through the code, the same routines are called, using the same branches etc.
and my code behind is
Any ideas?
TIA
Richard
I have a problem with the listview I have a close proximity to the demo, however when you click on the insert button you need to do so twice before the Insert Template is used. Stepping through the code, the same routines are called, using the same branches etc.
<telerik:RadListView ID="RadListBox1" runat="server" OnNeedDataSource="RadListView1_NeedDataSource" |
ItemPlaceholderID="ProductsHolder" OnItemCommand="RadListView1_ItemCommand" DataKeyNames="CountrySapInfoId"> |
<LayoutTemplate> |
<fieldset style="width: 700px;" id="FieldSet1"> |
<legend>SAP Country Info</legend> |
<asp:Panel ID="ProductsHolder" runat="server" /> |
<div style="clear: both" /> |
<div style="padding: 10px"> |
<asp:LinkButton ID="btnInitInsert" runat="server" Text="New Sap Country Info" CommandName="InitInsert" /> |
</div> |
</fieldset> |
</LayoutTemplate> |
<ItemTemplate> |
<fieldset style="border-style: none; float: left; width: 300px;"> |
<table cellpadding="0" cellspacing="0" width="100%" style="margin: 10px"> |
<tr> |
<td width="100px"> |
Company Code: |
</td> |
<td> |
<%# Eval("SAPCompanyCode") %> |
</td> |
</tr> |
<tr> |
<td> |
Sales Org: |
</td> |
<td> |
<%# Eval("SAPSalesOrg") %> |
</td> |
</tr> |
<tr> |
<td style="padding-top: 5px"> |
<asp:LinkButton ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" /> |
</td> |
</tr> |
</table> |
</fieldset> |
</ItemTemplate> |
<EditItemTemplate> |
<fieldset style="border-style: none; float: left; width: 300px;"> |
<table cellpadding="0" cellspacing="0" width="100%" style="margin: 10px"> |
<tr> |
<td> |
Company Code: |
</td> |
<td> |
<asp:TextBox ID="txtCompanyCode" runat="server" Text='<%# Bind("SAPCompanyCode") %>' /> |
</td> |
</tr> |
<tr> |
<td> |
Sales Org: |
</td> |
<td> |
<asp:TextBox ID="txtSalesOrg" runat="server" Text='<%# Bind("SAPSalesOrg") %>' /> |
</td> |
</tr> |
<tr> |
<td style="padding-top: 5px" colspan="2"> |
<asp:LinkButton ID="btnUpdate" runat="server" Text="Update" CommandName="Update" |
Width="70px" /> |
<asp:LinkButton ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" |
Width="70px" /> |
<asp:LinkButton ID="BtnCancel" runat="server" Text="Cancel" CommandName="Cancel" |
CausesValidation="false" Width="70px" /> |
</td> |
</tr> |
</table> |
</fioeldset> |
</EditItemTemplate> |
<InsertItemTemplate> |
<fieldset style="border-style: none; float: left; width: 300px;"> |
<table cellpadding="0" cellspacing="0" width="100%" style="margin: 10px"> |
<tr> |
<td width="50%"> |
Company Code: |
</td> |
<td> |
<asp:TextBox ID="txtCompanyCode" runat="server" Text='<%# Bind("SAPCompanyCode") %>' /> |
</td> |
</tr> |
<tr> |
<td> |
Sales Org: |
</td> |
<td> |
<asp:TextBox ID="txtSalesOrg" runat="server" Text='<%# Bind("SAPSalesOrg") %>' /> |
</td> |
</tr> |
<tr> |
<td style="padding-top: 5px" colspan="2"> |
<asp:LinkButton ID="btnInsert" runat="server" Text="Insert" CommandName="PerformInsert" |
Width="70px" /> |
<asp:LinkButton ID="BtnCancel" runat="server" Text="Cancel" CommandName="Cancel" |
CausesValidation="false" Width="70px" /> |
</td> |
</tr> |
</table> |
</fieldset> |
</InsertItemTemplate> |
</telerik:RadListView> |
and my code behind is
protected void RadListView1_ItemCommand(object source, RadListViewCommandEventArgs e) |
{ |
RadListView rlv = (source as RadListView); |
if ((e.CommandName == RadListView.PerformInsertCommandName) || (e.CommandName == RadListView.UpdateCommandName) || (e.CommandName == RadListView.CancelCommandName)) |
{ |
rlv.InsertItemPosition = RadListViewInsertItemPosition.None; |
} |
else if (e.CommandName == RadListView.InitInsertCommandName) |
{ |
rlv.InsertItemPosition = RadListViewInsertItemPosition.LastItem; |
//e.Canceled = true; |
} |
if ((e.CommandName == RadListView.PerformInsertCommandName) || (e.CommandName == RadListView.UpdateCommandName)) |
{ |
SaveCountrySapInfo(e.ListViewItem); |
} |
if (e.CommandName == "Delete") |
{ |
DeleteCountrySapInfo(e.ListViewItem); |
} |
} |
Any ideas?
TIA
Richard