RadTreeView1.DataFieldID =
"pagename";
RadTreeView1.DataFieldParentID =
"parentpagename";
RadTreeView1.DataTextField =
"pagename";
RadTreeView1.DataValueField =
"pagename";
Thanks
Matt
Hello,
I have three RadListBoxes on a page. First one is populated by a SQLDataSource. When an item is clicked on the first RadListBox, I want the item to add to the other two listboxes. The problem is that only one RadlistBox will populate with the selected item depending on which list box is last in the procedure.
I’m using VS 2008, and RadControls version: 2009.2.826.35
Sample ASP:
| <telerik:RadListBox ID="RadListBox1" runat="server" DataSourceID="dsEDBRecords" AllowDelete="true" Style="text-align: left;" AutoPostBack="true" DataTextField="FIELDNAME" DataValueField="UVALUE" Height="150px" Width="200px" OnSelectedIndexChanged="SetValue1" SelectionMode="Single" > </telerik:RadListBox> |
| <telerik:RadListBox ID="RadListBox2" runat="server" AllowDelete="false" Style="text-align: left;" AutoPostBack="true" Height="150px" Width="200px"></telerik:RadListBox> |
| <telerik:RadListBox ID="RadListBox3" runat="server" AllowDelete="false" Style="text-align: left;" AutoPostBack="true" Height="150px" Width="200px" ></telerik:RadListBox> |
| Protected Sub SetValue1(ByVal sender As Object, ByVal e As System.EventArgs) |
| Dim lbListBox As RadListBox = sender |
| Dim strItem As RadListBoxItem = lbListBox.SelectedItem |
| Dim strItem1 As RadListBoxItem = lbListBox.SelectedItem |
| RadListBox3.Items.Add(strItem) |
| RadListBox3.ClearSelection() |
| RadListBox2.Items.Add(strItem1) |
| RadListBox2.ClearSelection() |
| End Sub |
Folks,
I have a Heirarchical Grid (MasterTableView and DetailTables both uses FormTemplate). Is it possible while I am in DetailTable Edit/Insert mode, populate a label named (MasterTableUserFullName) in DetailTable with the Last+FirstName column values from MasterTableView?
In my RadGrid1_ItemDatabound event, I am able to populate that label (MasterTableUserFullName) with a string “Hellow World” but unsucessful to populate it with MasterTableView Last+FirstName Values.
Below is my code. Any help will be appreciated.
Thanks
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if ((e.Item is GridEditableItem && e.Item.IsInEditMode))
{
GridDataItem parentItem = e.Item.OwnerTableView.ParentItem as GridDataItem;
if (parentItem != null)
{
GridEditableItem item = (GridEditableItem)e.Item;
Label txt = (Label)item.FindControl("MasterTableUserFullName");
txt.Text = "Hellow World"; // This Works ...
// but need to update the label Box with MasterTableView Last + First Name Values.
}
}
}
_____________________________
<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomatic Inserts/Deletes/Updatess ="True" onitemdatabound="RadGrid1_ItemDataBound">
<MasterTableView datakeynames="UserTablePrimaryKey" datasourceid="SqlDataSource1" AllowFilteringByColumn = "true" CommandItemDisplay="TopAndBottom">
<!—Beginning Block of Child DetailTable -->
<DetailTables>
<telerik:GridTableView runat="server" DataSourceID="SqlDataSource2" DataKeyNames="UserLocationsPrimaryKey"
Width="100%" CommandItemDisplay= "TopAndBottom" Name = "Detail" AllowAutomatic Inserts/Deletes/Updates ="True">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="UserTableForeignKey" MasterKeyField="UserTablePrimaryKey" /> </ParentTableRelation>
<Columns>
<telerik:GridBoundColumn DataField="UserTableForeignKey"
DataType="System.Int32" HeaderText="UserTableForeignKey"
SortExpression="UserTableForeignKey" UniqueName="UserTableForeignKey"
Display="False" ReadOnly="True" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Program" HeaderText="Program" HeaderStyle-Width="50%"
SortExpression="Program" UniqueName="Program" >
<HeaderStyle Width="50%"></HeaderStyle>
</telerik:GridBoundColumn>
.
.
.
</Columns>
<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
<FormTemplate>
<table id="Table1" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
style="border-collapse: collapse; background: white;">
<tr>
<td colspan="2" style="font-size:small; z-index:0; font-family:Bookman Old Style; color:#669999">
<asp:Label ID="MasterTableUserFullName" runat="server" Text="User Location" Font-Underline="True">
</asp:Label>
</td>
</tr>
.
.
.
</table>
</FormTemplate>
</EditFormSettings>
</telerik:GridTableView>
</DetailTables>
<!—Ending Block of Child DetailTable -->
<!—Beginning Block of MasterTableView -->
<Columns>
<telerik:GridBoundColumn DataField="UserTablePrimaryKey"
DataType="System.Int32" HeaderText="UserTablePrimaryKey" ReadOnly="True"
SortExpression="UserTablePrimaryKey" UniqueName="UserTablePrimaryKey"
Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Last_Name" HeaderText="Last Name"
SortExpression="Last_Name" UniqueName="Last_Name">
<HeaderStyle Width="18%" />
<ItemStyle Width="18%" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="First_Name" HeaderText="First Name"
SortExpression="First_Name" UniqueName="First_Name">
<HeaderStyle Width="18%" />
<ItemStyle Width="18%" />
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table id="Table2">
<tr>
<td>
Last Name</td>
<td>
<asp:TextBox ID="TxtLast_Name" runat="server" Text='<%# Bind( "Last_Name") %>' TabIndex="1"> </asp:TextBox>
</td>
<td>
First Name</td>
<td>
<asp:TextBox ID="TxtFirst_Name" runat="server" Text='<%# Bind( "First_Name") %>' TabIndex="2"> </asp:TextBox>
</td>
</tr>
.
.
.
</table>
</FormTemplate>
</EditFormSettings>
.
.
.
</MasterTableView>
<!— Ending Block of MasterTableView -->
</telerik:RadGrid>