or
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<$ ConnectionStrings>" SelectCommand="SELECT [ID] as [DataKeyID], [ID] as [InsertID], [Name], [Order] FROM [Cities] ORDER BY [Order]" DeleteCommand="DELETE FROM [Cities] WHERE [ID] = @ID"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32" /> <//DeleteParameters> </asp:SqlDataSource> <telerik:RadListBox ID="RadListBox1" runat="server" AllowAutomaticUpdates="true" AllowTransfer="true" TransferToID="RadListBox2" AutoPostBackOnTransfer="true" DataKeyField="DataKeyID" DataTextField="Name" DataValueField="ID" DataSourceID="SqlDataSource1" > </telerik:RadListBox>
If you want to use the field, bound to the DataKeyField of the first RadListBox in the InsertCommands of the second ListBox, select it twice in the SelectCommand and give them different names. Then use the first one for the DataKeyField of the first RadListBox, and the second one for the InsertCommand of the second RadListBox.
Here is an example:
2. In the second RadListBox:
Here is an example:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<$ ConnectionStrings>" SelectCommand="SELECT [ID], [Name], [Order] FROM [Cities] ORDER BY [Order]" InsertCommand="INSERT INTO [Cities] ([Name], [Order]) VALUES (@Name, @Order)"> <InsertParameters> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="Order" Type="Int32" /> </InsertParameters> </asp:SqlDataSource> <telerik:RadListBox ID="RadListBox2" runat="server" AllowAutomaticUpdates="true" DataKeyField="ID" DataTextField="Name" DataValueField="ID" DataSourceID="SqlDataSource1" > </telerik:RadListBox>
Dim ctrl As Control = Page.LoadControl("/News/Bulletin/Bulletin.ascx")
panel.ContentTemplateContainer.Controls.Add(ctrl)
Dim myBulletin As ASP.Bulletin = DirectCast(ctrl, ASP.Bulletin)
ctrl = Nothing
myBulletin.showThisNews_IDNews = elementID
myBulletin.setCssStyleSheet = "/Preferences/News/Style/Bulletin/bulletinStyles.css"