I have a grid, wich is inside a tab with the key: "HotelsGrid". On my on row selection changed event, I need to disable the "HotelsGrid" tab, and enable and show the "HotelsEdit" tab with its content.
I am doing this, and before the migration from 11.1 to 13.2 it worked just fine:
uwtHotelsTab.Tabs.FindTabFromKey("HotelsGrid").Enabled = false;
uwtHotelsTab.Tabs.FindTabFromKey("HotelsEdit").Enabled = true;
uwtHotelsTab.SelectedIndex = uwtHotelsTab.Tabs.FindTabFromKey("HotelsEdit").Index;
Now the tabs are not being enabled and disabled nor being changed.
Do I need to set something like "enable ajax" or something like that? here are my tabs:
<igtab:WebTabID="uwtHotelsTab"BrowserTarget="UpLevel"runat="server"Width="624px"
Height="238px">
<Tabs>
<igtab:ContentTabItemText=" Hotel List "Key="HotelsGrid">
<Template>
<igtbl:WebDataGridEnableDataViewState="True"CssClass="frameGridStyle"EditCellCssClass="editCellGridStyle"HeaderCssClass="headerGridStyle"ItemCssClass="rowItemGridStyleSmaller"AutoGenerateColumns="false"ShowHeader="true"ID="uwgHotelsList" runat="server"Width="624px"Height="165px"OnRowSelectionChanged="uwgHotelsList_SelectedRowsChange">
<Columns>
<igtbl:BoundDataFieldKey="HotelId"DataFieldName="HotelId"Hidden="true">
</igtbl:BoundDataField>
<igtbl:BoundDataFieldKey="Name"DataFieldName="Name"Width="600px">
<HeaderText="Hotel Name">
</Header>
</Columns>
<Behaviors>
<igtbl:ActivationEnabled="true"></igtbl:Activation>
<igtbl:RowSelectorsEnabled="false"></igtbl:RowSelectors>
<igtbl:SelectionEnabled="true"CellClickAction="Row"CellSelectType="Single"RowSelectType="Single">
<AutoPostBackFlagsRowSelectionChanged="True"/>
</igtbl:Selection>
<igtbl:ColumnFixingEnabled="true"></igtbl:ColumnFixing>
<igtbl:EditingCore>
<igtbl:RowAddingEnabled="true"></igtbl:RowAdding>
</Behaviors>
</igtbl:EditingCore>
</igtbl:WebDataGrid>
<divstyle="padding-top: 2px; padding-bottom: 2px; padding-right: 1px; float: right">
<asp:ButtonID="btnHotelsAdd"OnClick="btnHotelsAdd_Click"runat="server"Width="100px"
Text="Add"/>
</div>
</Template>
</igtab:ContentTabItem>
<igtab:ContentTabItemKey="HotelsEdit"Text=" Hotel Edition "Enabled="false">
<divstyle="padding-left: 5px; overflow: auto; width: 623px; margin-left: auto; margin-right: auto;
padding-top: 4px; height: 209px;">
<divclass="line"style="height: 24px;">
<spanclass="spanLabelLeft">Hotel Name</span>
<asp:TextBoxID="txtHotelsName"runat="server"></asp:TextBox>
<asp:CheckBoxID="chkHotelsHasRepricing2"CssClass="chkListItemAlign"Width="175px"
TextAlign="Right"runat="server"Text="Has Repricing?"/>
<spanclass="spanLabelLeft">Account for Charges</span>
<asp:TextBoxID="txtHotelsAccountForCharges"runat="server"></asp:TextBox>
<spanclass="spanLabelLeft"style="width: 150px;">Number Tickets to Reprice</span>
<ig:WebNumericEditorID="wneHotelsTicketsToReprice"DataMode="Int"MaxLength="4"
NullText="0"MaxValue="9999"MinValue="0"runat="server"/>
<spanclass="spanLabelLeft">Tag Number Length</span>
<ig:WebNumericEditorID="wneHotelsTagNumberLength"DataMode="Int"MaxLength="3"
NullText="0"MaxValue="999"MinValue="0"runat="server"/>
<asp:CheckBoxID="chkHotelsTagIssuedByHotel"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="A hotel tag is issued by the Hotel"/>
<asp:CheckBoxID="chkHotelsGuestNameRequired"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="Guest Name Required"/>
<asp:CheckBoxID="chkHotelsUniqueTagNumber"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="Generate unique tag number"/>
<asp:CheckBoxID="chkHotelsRoomNumberRequired"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="Room Number Required"/>
<asp:CheckBoxID="chkHotelsPrintVoucher"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="Print Vouchers"/>
<asp:CheckBoxID="chkHotelsNoChargeWhenNoBalance"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="No Charge when no Balance accepted"/>
<asp:CheckBoxID="chkHotelsCashierInitialsRequired"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="Cashier Initials Required"/>
<asp:CheckBoxID="chkHotelsVoidsAccepted"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="Voids Accepted"/>
<asp:CheckBoxID="chkHotelsChargeDuringTrackingReport"CssClass="chkListItemAlign"
Width="270px"TextAlign="Right"runat="server"Text="Open Tickets Charge"/>
<asp:CheckBoxID="chkHotelsPrintChargesReportAtEod"CssClass="chkListItemAlign"Width="270px"
TextAlign="Right"runat="server"Text="Print Charges Report at EOD"/>
<asp:CheckBoxID="chkHotelsIncludeInStandardOpenTickets"CssClass="chkListItemAlign"
Width="270px"TextAlign="Right"runat="server"Text="Include in Standard Open Tickets"/>
<spanclass="spanLabelLeft">Function Key</span>
<asp:TextBoxID="txtHotelsFunctionKey"Width="90px"runat="server"Text="Function Key"/>
<fieldset>
<legend>Multiple Exits</legend>
<spanclass="spanLabel"style="width: 90px;">Maximum</span>
<ig:WebNumericEditorID="wneHotelsMultipleExitMaximum"DataMode="Int"MaxLength="4"
<spanclass="spanLabel">Free</span>
<ig:WebNumericEditorID="wneHotelsMultipleExitsFree"DataMode="Int"MaxLength="4"
<spanclass="spanLabel">Fee</span>
<ig:WebNumericEditorID="wneHotelsMultipleExitsFee"DataMode="Int"MaxLength="4"
</fieldset>
<fieldsetstyle="width: 645px; margin-left: auto; margin-right: auto; background: #F2FCFF;">
<legendstyle="font-size: x-small;"> Checkout Time </legend>
<divstyle="height: 30px; padding-left: 49px;">
<divclass="line"style="width: 550px; margin-left: auto; margin-right: auto;">
<asp:CheckBoxID="chkHotelsCheckoutTimeRequired"CssClass="chkListItemAlign"Width="214px"
runat="server"TextAlign="Right"Text="Time Required"ToolTip="<%$Resources:ToolTips,CC_HotelLocationPolicies_Transients_CheckoutTime_Required %>"/>
<spanclass="spanLabel"style="width: 108px;">Time Format</span><asp:DropDownList
ID="cmbHotelsTimeFormat"runat="server"ToolTip="<%$ Resources:ToolTips, CC_HotelLocationPolicies_Transients_CheckoutTime_Format %>"
/>
<divstyle="float: right; padding-top: 4px; padding-bottom: 5px;">
<asp:ButtonID="btnHotelsEditOk"OnClick="btnHotelsEditOk_Click"runat="server"Width="100px"
Text="OK"/>
<spanclass="spanSeparator"></span>
<asp:ButtonID="btnHotelsEditCancel"OnClick="btnHotelsEditCancel_Click"runat="server"
Width="100px"Text="Cancel"/>
<asp:ButtonID="btnHotelsDelete"OnClick="btnHotelsDelete_Click"OnClientClick="if(!confirm('Are you sure to delete the hotel?')) return false;"
runat="server"Width="100px"Text="Delete"/>
</Tabs>
</igtab:WebTab>
Thank you very much!
I re-binded my grids data source on the uwgEmployees_CellSelectionChanged method and it worked.
Thanks!
I tried that but on my CellSelectionChanged event, the e.CurrentSelectedCells[0] is null..
protected void uwgEmployees_CellSelectionChanged(object sender, SelectedCellEventArgs e) {
var row = e.CurrentSelectedCells[0].Row;
}
I also tried to get the selected cell like this, uwgEmployees.Behaviors.Selection.SelectedCells[0]
but it's null as well.
Nicole,
The reason the tab doesn't change and become selected is because the Selection changed event is fired on an asynchronous request to the server. For the controls on the page to be updated you need to have a full post back occur. Being that you are using the grid to provide a list of values to select from you can set EnableAJAX to false on the WebDataGrid and then you will get the behavior that you want where the tab will become active and the selected tab will change.
I have also attached a simple sample based on your code that shows this working.
Let me know if you have any questions with this matter.
Yes, I already have that configuration set, as you can see in the code I posted.
The options for that configuration are true or false, not on or off, according to the documentation.
Please read my post carefully.
Thank you.
Hello Nicole,
You may set the RowSelectionChanged autopostbackflag to On.
If you have any questions, please let me know as well.