I currently use the TabStrip with Mulipage controls to display and edit some 300 or so TextBoxes and other controls. I really like the advantage the PanelBar has to offer as far as the ability to display all sections at the same time and I would like to replace the TabStrip with the PanelBar. However, using the “FindItemByValue” is not very practical at all in this case. Can you recommend how to achieve the effect of the PanelBar without hiding the controls behind a parent control, maybe a combination of other controls? Is there a way to expose the controls inside the PanelBar and not having to do a “find” to get to them?
Thanks for the help,
-sam
TextBox1.Text = TreeView1.SelectedNode.Value.ToString();
I am under the impression that selected node's value should persist using the ajax panel. Can you help me?
Thanks,
Dave
<
telerik:radtreeview id="RadTreeView2" runat="server" width="100%" height="100%"
datasourceid="ObjectDataSource1" datafieldid="ID" datafieldparentid="ParentID"
datatextfield="Text" OnNodeClick="RadTreeView2_OnNodeClick">
<DataBindings>
<telerik:RadTreeNodeBinding Expanded="true" />
</DataBindings>
</
telerik:radtreeview>
<
asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="xxxx.Component.Classes.SiteDataItemCache" SelectMethod="GetSiteDataItems">
</
asp:ObjectDataSource>
2. in the codebehind
protected
void RadTreeView2_OnNodeClick(object sender, RadTreeNodeEventArgs e)
{
SiteDataItem item = (SiteDataItem) e.Node.DataItem;
}
| Imports System.Data.SqlClient |
| Imports Telerik.Web.UI |
| Imports System.Drawing |
| Partial Class category |
| Inherits System.Web.UI.Page |
| Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load |
| 'Put user code to initialize the page here |
| RadGrid1.DataBind() |
| End Sub |
| Protected Sub btninsert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btninsert.Click |
| Dim sConnStr As String = "Data Source=Barlet-HP\SQLEXPRESS;Initial Catalog=KDN;Integrated Security=True" |
| Dim cnBKTest As New SqlConnection(sConnStr) |
| Dim cmdTest As New SqlCommand("addGroup", cnBKTest) |
| cmdTest.CommandType = Data.CommandType.StoredProcedure |
| cmdTest.Parameters.Add(New SqlParameter("@Group_Name", Data.SqlDbType.VarChar)) |
| cmdTest.Parameters("@Group_Name").Value = TextBox1.Text.ToString |
| cnBKTest.Open() |
| cmdTest.ExecuteNonQuery() |
| cnBKTest.Close() |
| RadGrid1.DataBind() |
| Label2.Text = "Last Inserted Category is: " & TextBox1.Text |
| TextBox1.Text = "" |
| TextBox1.Focus() |
| '''''''''''''''''''''''''''''''''''''''''''''' |
| End Sub |
| Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource |
| End Sub |
| Protected Sub RadGrid1_ItemDeleted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles RadGrid1.ItemDeleted |
| Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) |
| Dim id As String = item.GetDataKeyValue("Group_id").ToString() |
| If Not e.Exception Is Nothing Then |
| e.ExceptionHandled = True |
| SetMessage("Group with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message) |
| Else |
| SetMessage("Group with ID " + id + " is deleted!") |
| End If |
| End Sub |
| Protected Sub RadGrid1_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGrid1.ItemUpdated |
| Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem) |
| Dim id As String = item.GetDataKeyValue("Group_id").ToString() |
| If Not e.Exception Is Nothing Then |
| e.KeepInEditMode = True |
| e.ExceptionHandled = True |
| SetMessage("Group with ID " + id + " cannot be updated. Reason: " + e.Exception.Message) |
| Else |
| SetMessage("Group with ID " + id + " is updated!") |
| End If |
| End Sub |
| Protected Sub RadGrid1_ItemInserted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) Handles RadGrid1.ItemInserted |
| If Not e.Exception Is Nothing Then |
| e.ExceptionHandled = True |
| e.KeepInInsertMode = True |
| SetMessage("Product cannot be inserted. Reason: " + e.Exception.Message) |
| Else |
| SetMessage("New product is inserted!") |
| End If |
| End Sub |
| Private Sub DisplayMessage(ByVal text As String) |
| RadGrid1.Controls.Add(New LiteralControl(String.Format("<span style='color:red'>{0}</span>", text))) |
| End Sub |
| Private Sub SetMessage(ByVal message As String) |
| gridMessage = message |
| End Sub |
| Private gridMessage As String = Nothing |
| Protected Sub RadGrid1_DataBound(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.DataBound |
| If Not String.IsNullOrEmpty(gridMessage) Then |
| DisplayMessage(gridMessage) |
| End If |
| End Sub |
| End Class |