Hi everyone,
Let me start by apologising for this question - despite being a competent VB6 programmer, I'm new to .NET and am aware that this question is the sort of one that would probably cause sniggers at the back of the class-room.
I'm trialling ASP.NET RadTools AJAX which I must say looks tremendous. I am slowly trying to get it to replicate the functionality I need before deciding on the direction to take to migrate some aging systems.
I don't normally post for help (I can normally work stuff out) but after spending two solid days piecing together various examples I can honestly say I'm stuck.
I am trying to create a RadGrid that allows me to drill down on related tables. I've seen various examples which include SQL markup within the actual page - but I'm trying to use an ObjectDataSource pointing to a SQL DataSet. This is to centralise the SQL markup making maintanence a tad easier.
My Main table is a table called LanSubnet with a PK of LanSubnetID and a FK of SiteID
The "drill down" table is called Site - with a PK of ID. The association between the two is "LanSubnet.SiteID=Site.ID"
So when someone drills down on a specific item, it shows all the associated sites - simple eh?
I'm trying to achieve this without coding - although if that is the only way, then so be it (I prefer VB.NET). My attempts either cause the details table to show all sites, or show none. I can't get it to only show the ones associated with the chosen master table and I've not got a clue why?
<%
@ Control Language="VB" AutoEventWireup="false" CodeFile="ProductsVB.ascx.vb" Inherits="TabStrip_Examples_ApplicationScenarios_LoadOnDemand_CustomersVB" %>
<%
@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
telerik:RadGrid runat="server" ID="RadGrid1" Skin="Office2007"
DataSourceID="ObjectDataSource1" AllowPaging="True" GridLines="None"
AutoGenerateEditColumn="True">
<
MasterTableView DataSourceID="ObjectDataSource1"
DataKeyNames="LanSubnetID">
<
RowIndicatorColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
RowIndicatorColumn>
<
ExpandCollapseColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="LanSubnetID" DataType="System.Int32"
HeaderText="LanSubnetID" ReadOnly="True" SortExpression="LanSubnetID"
UniqueName="LanSubnetID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SiteID" HeaderText="SiteID"
SortExpression="SiteID" UniqueName="SiteID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="StartIP" HeaderText="StartIP"
SortExpression="StartIP" UniqueName="StartIP">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="EndIP" HeaderText="EndIP"
SortExpression="EndIP" UniqueName="EndIP">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="NTDomain" HeaderText="NTDomain"
SortExpression="NTDomain" UniqueName="NTDomain">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AdminUserName" HeaderText="AdminUserName"
SortExpression="AdminUserName" UniqueName="AdminUserName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AdminPassword" HeaderText="AdminPassword"
SortExpression="AdminPassword" UniqueName="AdminPassword">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SNMPCommunityString"
HeaderText="SNMPCommunityString" SortExpression="SNMPCommunityString"
UniqueName="SNMPCommunityString">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AuditStartDate" DataType="System.DateTime"
HeaderText="AuditStartDate" SortExpression="AuditStartDate"
UniqueName="AuditStartDate">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AuditFinishDate" DataType="System.DateTime"
HeaderText="AuditFinishDate" SortExpression="AuditFinishDate"
UniqueName="AuditFinishDate">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AuditDevicesFound" DataType="System.Int32"
HeaderText="AuditDevicesFound" SortExpression="AuditDevicesFound"
UniqueName="AuditDevicesFound">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AuditDevicesFailed" DataType="System.Int32"
HeaderText="AuditDevicesFailed" SortExpression="AuditDevicesFailed"
UniqueName="AuditDevicesFailed">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LastUpdatedUserID" DataType="System.Int32"
HeaderText="LastUpdatedUserID" SortExpression="LastUpdatedUserID"
UniqueName="LastUpdatedUserID">
</telerik:GridBoundColumn>
</Columns>
<
DetailTables>
<telerik:GridTableView runat="server" DataKeyNames="ID" AutoGenerateColumns="true" DataSourceID="ObjectDataSource2" HierarchyLoadMode="ServerOnDemand">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="SiteID" />
</ParentTableRelation>
</telerik:GridTableView>
</DetailTables>
</
MasterTableView>
</
telerik:RadGrid>
<
asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
DeleteMethod="Delete" InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="DataSet1TableAdapters.LanSubnetTableAdapter" UpdateMethod="Update">
<DeleteParameters>
<asp:Parameter Name="Original_LanSubnetID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="SiteID" Type="Int32" />
<asp:Parameter Name="StartIP" Type="String" />
<asp:Parameter Name="EndIP" Type="String" />
<asp:Parameter Name="NTDomain" Type="String" />
<asp:Parameter Name="AdminUserName" Type="String" />
<asp:Parameter Name="AdminPassword" Type="String" />
<asp:Parameter Name="SNMPCommunityString" Type="String" />
<asp:Parameter Name="AuditStartDate" Type="DateTime" />
<asp:Parameter Name="AuditFinishDate" Type="DateTime" />
<asp:Parameter Name="AuditDevicesFound" Type="Int32" />
<asp:Parameter Name="AuditDevicesFailed" Type="Int32" />
<asp:Parameter Name="LastUpdatedUserID" Type="Int32" />
<asp:Parameter Name="Original_LanSubnetID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="SiteID" Type="Int32" />
<asp:Parameter Name="StartIP" Type="String" />
<asp:Parameter Name="EndIP" Type="String" />
<asp:Parameter Name="NTDomain" Type="String" />
<asp:Parameter Name="AdminUserName" Type="String" />
<asp:Parameter Name="AdminPassword" Type="String" />
<asp:Parameter Name="SNMPCommunityString" Type="String" />
<asp:Parameter Name="AuditStartDate" Type="DateTime" />
<asp:Parameter Name="AuditFinishDate" Type="DateTime" />
<asp:Parameter Name="AuditDevicesFound" Type="Int32" />
<asp:Parameter Name="AuditDevicesFailed" Type="Int32" />
<asp:Parameter Name="LastUpdatedUserID" Type="Int32" />
</InsertParameters>
</
asp:ObjectDataSource>
<
asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetOneSite"
TypeName="SiteTableAdapters.SiteTableAdapter">
<SelectParameters>
<asp:Parameter Name="SiteID" Type="Int32" />
</SelectParameters>
</
asp:ObjectDataSource>
[IndexOutOfRangeException: Cannot find column ItemNumber.] System.Data.DataTable.ParseSortString(String sortString) +4826462 System.Data.DataView.CheckSort(String sort) +32 System.Data.DataView.set_Sort(String value) +128 Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() +5028 Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() +41 Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray) +171 Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +861 Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +786 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 Telerik.Web.UI.GridTableView.PerformSelect() +28 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 Telerik.Web.UI.GridTableView.DataBind() +354 Telerik.Web.UI.GridSortCommandEventArgs.ExecuteCommand(Object source) +326 Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +61 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +165 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
| public class Item : IItemInterface |
| { |
| public string Name { get; set; } |
| public string ItemNumber { get; set; } |
| } |
| public interface IBase |
| { |
| string ItemNumber { get; set; } |
| } |
| public interface IItemInterface : IBase |
| { |
| string Name { get; set; } |
| } |
<
telerik:RadComboBox ID="rcCostLocation" AutoPostBack="true" CausesValidation="false" SkinId="RadCombo" Runat="server"
DropDownWidth="318px" Height="190px" Width="318px" EmptyMessage="Please select" EnableLoadOnDemand="True"
DataValueField="Id" ShowMoreResultsBox="true">
</
telerik:RadComboBox>
If I click on a item in the list, the SelectIndexChanged and TextChanged fires okey, but if I clear the text from the DropDownBox and then click anywhere on my page, the default text "Please select" is shown but the TextChange even never fires.
I need to check if the user has cleared the text in the combobox and then disable another control on the page.
Any suggestions on how I can accomplice this ?
Regards
Per
| <telerik:RadEditor ID="txtContent" runat="server" Width="100%"> |
| <ImageManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> |
| <MediaManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> |
| <FlashManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> |
| <TemplateManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> |
| <DocumentManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> |
| </telerik:RadEditor> |

