Folks,
I am using RadControls for ASP.NET AJAX Q2 2009 SP1 with Visual Studio 2008 SP1.
I have a Heirarchical Grid (
MasterTableView
and DetailTables both uses FormTemplate). In DetailTables, I have a RadCombo Box. Is it possible:
1) In RadGrid1_UpdateCommand/ RadGrid1_InsertCommand Events, capture the Template Values of City and ContactTitle into string Variables? Neither City nor ContactTitle are DataTextField or DataValueField of ComboBox?
2) After the RadComboBox1_SelectedIndexChanged Event of ComboBox (autopost is set to true here), is it possible to update a label (ComboBoxContactTitle) in DetailTable Form Template?
Below is my code. Any help will be appreciated.
Thanks
GC_0620
_________
protected
void RadComboBox1_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
}
______
<
telerik:RadGrid ID="RadGrid1" OnInsertCommand="RadGrid1_InsertCommand"
OnUpdateCommand = "RadGrid1_UpdateCommand" >
<
MasterTableView runat = "server" Name = "Master">
<!
Beginning Block of Child DetailTable -->
<
DetailTables>
<telerik:GridTableView runat="server" Name = "Detail"
<ParentTableRelation>
...
</ParentTableRelation>
<Columns>
....
<telerik:GridBoundColumn DataField="ContactName" HeaderText="ContactName" HeaderStyle-Width="50%"
SortExpression="ContactName" UniqueName="ContactName" >
</telerik:GridBoundColumn>
....
</Columns>
<
EditFormSettings EditFormType="Template">
<
EditColumn UniqueName="EditCommandColumn1"></EditColumn>
<FormTemplate>
<table id="Table1">
<tr>
<td>
Contact Name
</td>
<td>
<telerik:RadComboBox runat="server"
ID="RadComboBox1"
DataTextField="ContactName"
DataValueField="ContactName"
HighlightTemplatedItems="true"
Height="190px"
Width="220px"
DropDownWidth="420px"
DataSourceID="SQLDataSource1" AutoPostBack="True"
onselectedindexchanged="RadComboBox1_SelectedIndexChanged"
SelectedValue='<%#Bind("ContactName") %>'>
<HeaderTemplate>
<ul>
<li class="col1">Contact Name</li>
<li class="col2">City</li>
<li class="col3">Title</li>
</ul>
</HeaderTemplate>
<ItemTemplate>
<ul>
<li class="col1"><%# DataBinder.Eval(Container.DataItem, "ContactName") %></li>
<li class="col2"><%# DataBinder.Eval(Container.DataItem, "City") %></li>
<li class="col3"><%# DataBinder.Eval(Container.DataItem, "ContactTitle") %></li>
</ul>
</ItemTemplate>
</telerik:RadComboBox>
</td>
<td colspan="2" style="font-size:small; z-index:0; font-family:Bookman Old Style; color:#669999">
<asp:Label ID="ComboBoxContactTitle" runat="server" Text="Contact Title"
Font-Underline="True">
</asp:Label>
</td>
</tr>
...
</table>
</FormTemplate>
</EditFormSettings>
</telerik:GridTableView>
</
DetailTables>
<!
Ending Block of Child DetailTable -->
<!
Beginning Block of MasterTableView -->
<Columns>
...
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
...
</FormTemplate>
</EditFormSettings>
...
</
MasterTableView>
<!
Ending Block of MasterTableView -->
</
telerik:RadGrid>
<
asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:SomeConnectionString %>"
SelectCommand="SELECT * FROM [Customers] ORDER BY City">
</asp:SqlDataSource>
______ ______