<%@ Page Language="C#" MasterPageFile="~/MasterPages/DesignMasterPage.master" AutoEventWireup="true" CodeFile="Channels.aspx.cs" Inherits="Channels" Title="Channels - TxRxCustom" %>
<%@ MasterType VirtualPath="~/MasterPages/DesignMasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
{
var grid = igtbl_getGridById(uwgChannels);
</script>
<asp:ObjectDataSource ID="odsChannels" runat="server" DeleteMethod="DeleteChannel"
InsertMethod="AddChannel" OnSelecting="odsChannels_Selecting"
UpdateMethod="UpdateChannel" OnUpdating="odsChannels_Updating">
<DeleteParameters>
<asp:Parameter Name="channelID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="designID" Type="Int32" />
<asp:Parameter Name="name" Type="String" />
<asp:Parameter Name="description" Type="String" />
<asp:Parameter Name="radioID" Type="Int32" />
<asp:Parameter Name="radioFunctionID" Type="Int32" />
<asp:Parameter Name="modulationTypeID" Type="Int32" />
<asp:Parameter Name="externalSystem" Type="Boolean" />
<asp:Parameter Name="transmitFrequency" Type="Decimal" />
<asp:Parameter Name="transmitBandwidth" Type="Single" />
<asp:Parameter Name="transmitPower" Type="Single" />
<asp:Parameter Name="transmitLevel" Type="Single" />
<asp:Parameter Name="transmitAntennaID" Type="Int32" />
<asp:Parameter Name="receiveFrequency" Type="Decimal" />
<asp:Parameter Name="receiveBandwidth" Type="Single" />
<asp:Parameter Name="receiveSensitivity" Type="Single" />
<asp:Parameter Name="receiveAntennaID" Type="Int32" />
<asp:Parameter Name="receiveMuted" Type="Boolean" />
</UpdateParameters>
<SelectParameters>
<asp:Parameter DefaultValue="" Name="designID" Type="Int32" />
</SelectParameters>
<InsertParameters>
</InsertParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="odsRadios" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetRadios" TypeName="TxRxCustomDataTableAdapters.RadiosTableAdapter">
<asp:ObjectDataSource ID="odsFunctions" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetRadioFunctions" TypeName="TxRxCustomDataTableAdapters.RadioFunctionsTableAdapter">
<asp:ObjectDataSource ID="odsModulations" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetModulationTypes" TypeName="TxRxCustomDataTableAdapters.ModulationTypesTableAdapter">
<asp:ObjectDataSource ID="odsAntennas" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetAntennaSelectionsByDesignID"
TypeName="TxRxCustomBLL.Antennas" OnSelecting="odsAntennas_Selecting">
<asp:Parameter Name="DesignID" Type="Int32" />
<br/>
<asp:Button ID="btnNewChannel" runat="server" CommandName="NewChannel" OnCommand="btnNewChannel_Command"
Text="New Channel..." ToolTip="Add a transmit and/or receive frequency." /><br/>
<asp:RadioButtonList ID="rbQuickEntry" runat="server" RepeatDirection="Horizontal" AutoPostBack="True">
<asp:ListItem Selected="True" Value="QE">Quick Entry</asp:ListItem>
<asp:ListItem Value="FE">Normal Entry</asp:ListItem>
</asp:RadioButtonList>
<asp:GridView ID="gvChannels" runat="server" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="ChannelID" DataSourceID="odsChannels" ToolTip='Click "Select" to edit'>
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="ChannelID" DataNavigateUrlFormatString="./ChannelDetail.aspx?ChannelID={0}"
Text="Select" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
<asp:BoundField DataField="RadioName" HeaderText="Radio" ReadOnly="True" SortExpression="RadioName" />
<asp:BoundField DataField="RadioFunctionName" HeaderText="Function" ReadOnly="True"
SortExpression="RadioFunctionName" />
<asp:BoundField DataField="ModulationTypeName" HeaderText="Modulation" ReadOnly="True"
SortExpression="ModulationTypeName" />
<asp:CheckBoxField DataField="ExternalSystem" HeaderText="External" SortExpression="ExternalSystem" />
<asp:BoundField DataField="TransmitFrequency" HeaderText="TxFreq" SortExpression="TransmitFrequency">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="TransmitBandwidth" DataFormatString="{0:f3}" HeaderText="TxBw"
HtmlEncode="False" SortExpression="TransmitBandwidth">
<asp:BoundField DataField="TransmitPower" HeaderText="TxPower" SortExpression="TransmitPower">
<asp:BoundField DataField="TransmitLevel" HeaderText="TxLevel" SortExpression="TransmitLevel">
<asp:BoundField DataField="TransmitAntennaName" HeaderText="TxAnt" ReadOnly="True"
SortExpression="TransmitAntennaName" />
<asp:BoundField DataField="ReceiveFrequency" HeaderText="RxFreq" SortExpression="ReceiveFrequency">
<asp:BoundField DataField="ReceiveBandwidth" DataFormatString="{0:f3}" HeaderText="RxBw"
HtmlEncode="False" SortExpression="ReceiveBandwidth">
<asp:BoundField AccessibleHeaderText="Receiver sensitivity for compensation of TNRD curves."
DataField="ReceiveSensitivity" HeaderText="RxSens" SortExpression="ReceiveSensitivity" />
<asp:BoundField DataField="ReceiveAntennaName" HeaderText="RxAnt" ReadOnly="True"
SortExpression="ReceiveAntennaName" />
<asp:CheckBoxField DataField="ReceiveMuted" HeaderText="Muted" SortExpression="ReceiveMuted" />
</Columns>
<RowStyle CssClass="TableRow" />
<AlternatingRowStyle CssClass="AlternateRow" />
</asp:GridView>
<igtbl:UltraWebGrid ID="uwgChannels" runat="server" DataSourceID="odsChannels"
OnInitializeLayout="uwgChannels_InitializeLayout">
<Bands>
<igtbl:UltraGridBand>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
<igtbl:UltraGridColumn BaseColumnName="DesignID" DataType="System.Int32" IsBound="True"
Key="DesignID">
<Header Caption="DesignID">
</Header>
</igtbl:UltraGridColumn>
<igtbl:UltraGridColumn BaseColumnName="ChannelID" DataType="System.Int32" IsBound="True"
Key="ChannelID">
<Header Caption="ChannelID">
<RowLayoutColumnInfo OriginX="1" />
<Footer>
</Footer>
<igtbl:UltraGridColumn BaseColumnName="Name" IsBound="True" Key="Name" Type="DropDownList">
<Header Caption="Name">
<RowLayoutColumnInfo OriginX="2" />
<ValueList DataSourceID="odsRadios" DisplayMember="RadioName" Key="RadioId">
</ValueList>
<igtbl:UltraGridColumn BaseColumnName="Description" IsBound="True" Key="Description">
<Header Caption="Description">
<RowLayoutColumnInfo OriginX="3" />
<igtbl:UltraGridColumn BaseColumnName="RadioID" DataType="System.Int32" IsBound="True"
Key="RadioID">
<Header Caption="RadioID">
<RowLayoutColumnInfo OriginX="4" />
<igtbl:UltraGridColumn BaseColumnName="RadioFunctionID" DataType="System.Byte" IsBound="True"
Key="RadioFunctionID">
<Header Caption="RadioFunctionID">
<RowLayoutColumnInfo OriginX="5" />
<igtbl:UltraGridColumn BaseColumnName="ModulationTypeID" DataType="System.Byte" IsBound="True"
Key="ModulationTypeID">
<Header Caption="ModulationTypeID">
<RowLayoutColumnInfo OriginX="6" />
<igtbl:UltraGridColumn BaseColumnName="ExternalSystem" DataType="System.Boolean"
IsBound="True" Key="ExternalSystem" Type="CheckBox">
<Header Caption="ExternalSystem">
<RowLayoutColumnInfo OriginX="7" />
<igtbl:UltraGridColumn BaseColumnName="TransmitFrequency" DataType="System.Decimal"
IsBound="True" Key="TransmitFrequency">
<Header Caption="TransmitFrequency">
<RowLayoutColumnInfo OriginX="8" />
<igtbl:UltraGridColumn BaseColumnName="TransmitBandwidth" DataType="System.Single"
IsBound="True" Key="TransmitBandwidth">
<Header Caption="TransmitBandwidth">
<RowLayoutColumnInfo OriginX="9" />
<igtbl:UltraGridColumn BaseColumnName="TransmitPower" DataType="System.Single" IsBound="True"
Key="TransmitPower">
<Header Caption="TransmitPower">
<RowLayoutColumnInfo OriginX="10" />
<igtbl:UltraGridColumn BaseColumnName="TransmitLevel" DataType="System.Single" IsBound="True"
Key="TransmitLevel">
<Header Caption="TransmitLevel">
<RowLayoutColumnInfo OriginX="11" />
<igtbl:UltraGridColumn BaseColumnName="TransmitAntennaID" DataType="System.Int32"
IsBound="True" Key="TransmitAntennaID">
<Header Caption="TransmitAntennaID">
<RowLayoutColumnInfo OriginX="12" />
<igtbl:UltraGridColumn BaseColumnName="ReceiveFrequency" DataType="System.Decimal"
IsBound="True" Key="ReceiveFrequency">
<Header Caption="ReceiveFrequency">
<RowLayoutColumnInfo OriginX="13" />
<igtbl:UltraGridColumn BaseColumnName="ReceiveBandwidth" DataType="System.Single"
IsBound="True" Key="ReceiveBandwidth">
<Header Caption="ReceiveBandwidth">
<RowLayoutColumnInfo OriginX="14" />
<igtbl:UltraGridColumn BaseColumnName="ReceiveAntennaID" DataType="System.Int32"
IsBound="True" Key="ReceiveAntennaID">
<Header Caption="ReceiveAntennaID">
<RowLayoutColumnInfo OriginX="15" />
<igtbl:UltraGridColumn BaseColumnName="ReceiveMuted" DataType="System.Boolean" IsBound="True"
Key="ReceiveMuted" Type="CheckBox">
<Header Caption="ReceiveMuted">
<RowLayoutColumnInfo OriginX="16" />
<igtbl:UltraGridColumn BaseColumnName="RadioName" IsBound="True" Key="RadioName">
<Header Caption="RadioName">
<RowLayoutColumnInfo OriginX="17" />
<igtbl:UltraGridColumn BaseColumnName="RadioFunctionName" IsBound="True" Key="RadioFunctionName">
<Header Caption="RadioFunctionName">
<RowLayoutColumnInfo OriginX="18" />
<igtbl:UltraGridColumn BaseColumnName="ModulationTypeName" IsBound="True" Key="ModulationTypeName">
<Header Caption="ModulationTypeName">
<RowLayoutColumnInfo OriginX="19" />
<igtbl:UltraGridColumn BaseColumnName="TransmitAntennaName" IsBound="True" Key="TransmitAntennaName">
<Header Caption="TransmitAntennaName">
<RowLayoutColumnInfo OriginX="20" />
<igtbl:UltraGridColumn BaseColumnName="ReceiveAntennaName" IsBound="True" Key="ReceiveAntennaName">
<Header Caption="ReceiveAntennaName">
<RowLayoutColumnInfo OriginX="21" />
<igtbl:UltraGridColumn BaseColumnName="ReceiveSensitivity" DataType="System.Single"
IsBound="True" Key="ReceiveSensitivity">
<Header Caption="ReceiveSensitivity">
<RowLayoutColumnInfo OriginX="22" />
</igtbl:UltraGridBand>
<DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer" AllowDeleteDefault="Yes"
AllowSortingDefault="OnClient" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate"
HeaderClickActionDefault="SortMulti" Name="uwgChannels" RowHeightDefault="20px" SelectTypeRowDefault="Extended"
StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" ViewType="OutlookGroupBy" MergeStyles="False">
<RowStyleDefault CssClass="GvRow">
</RowStyleDefault>
<HeaderStyleDefault CssClass="GvHeader">
</HeaderStyleDefault>
<RowAlternateStyleDefault CssClass="AlternateRow">
</RowAlternateStyleDefault>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
<ClientSideEvents AfterCellUpdateHandler="UwgChannels_AfterRowInsertHandler" />
</igtbl:UltraWebGrid><br />
</asp:Content>
You have no idea how much this helped me! Thanks!!!
Thanks, that explains it. I appreciate your help!
Jim
The Grid in the sample is probably just a grid on the page, so it's only container is the page itself.
Container controls will append information upon the client id of control to ensure that each control on a page has an unique ID. Your WebGrid is inside a content pane
So the WebGrid's ID becomes : ContentPlaceHolder1xuwgChannels
And so on up the chain, as each parent gets involved, it appends more information.
If container controls didn't do this append, you could easily end up with multiple controls having the same ID on the client as all you would need are two ContentHolders who load up the same UserControl.
I checked the value of that and got ctl00xContentPlaceHolder1xuwgChannels when I was expecting just the control name.
I was modeling my function off of an existing function in an infragistics sample:
function SelectCurrent() { var grid = igtbl_getGridById("UltraWebGrid1"); var row = igtbl_getActiveRow("UltraWebGrid1"); if(row != null) igtbl_selectRow("UltraWebGrid1", row.Element.id, false, false); else { var cell = igtbl_getActiveCell("UltraWebGrid1"); if(cell != null) igtbl_selectCell("UltraWebGrid1", cell.Element.id, false, false); } return 0; }
This sets the reference using only the controls name, I guess I'm confused on why that works but won't work for me if I pass only the control name. Using the gridName param does work for me though... in my frustrations i must have overlooked that do to the "ctl00xContentPlaceHolder1xuwgChannels " value it initially gave me.
Is there a reason you aren't using the gridName input parameter?