Rank: Newbie Groups: Member
Joined: 8/18/2011 Posts: 2
|
Hi I am using a grid with 2 custom column . In one custom column the values are 'S' and 'G' .If i select 'G' the other custom column gets disabled and when i select 'S' the other custom column gets enabled but with respect to row if i have selected 'G' and custom column disables next row when i select as 'S' the custom column gets enabled but when i click on previous column which was disabled gets enabled so please help me for getting the row control of the grid
Code is eo:CallbackPanel runat="server" ID="CallbackPanel1" Triggers="{ControlID:gvJournaldetails;Parameter:}"> <eo:Grid ID="gvJournaldetails" AllowNewItem="True" FullRowMode="False" Height="255px" IsCallbackByMe="False" Width="990px" runat="server" ItemHeight="21" ClientSideOnItemCommand="OnItemDelete" ColumnHeaderAscImage="00050303" ColumnHeaderDescImage="00050304" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" BorderStyle="None" AllowPaging="True" PageSize="50" Font-Names="Arial" Font-Size="8pt" ColumnHeaderDividerImage="00050302" GridLineColor="White" GridLines="Both" ScrollBars="Vertical"> <FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" /> <ColumnHeaderStyle CssClass="tdblue " /> <ItemStyles> <eo:GridItemStyleSet> <AlternatingItemStyle CssText="background-color: #FFFFFF" /> <ItemStyle CssText="background-color: #E0EEE0" /> <ItemHoverStyle CssText="background-color: #D8E8CE" /> <%-- <EditSelectedStyle CssText="background-color: #C0D9AF" /> <SelectedStyle CssText="background-color: #C0D9AF" />--%> <CellStyle CssText="padding-top:2px;padding-left:1px;" /> </eo:GridItemStyleSet> </ItemStyles> <Columns> <eo:RowNumberColumn Width="40" HeaderText="No"> </eo:RowNumberColumn> <eo:CustomColumn HeaderText="GL/SL" DataField="GLSL" Width="100" ClientSideBeginEdit="OnBeginEditJou" ClientSideEndEdit="OnEndEditJou"> <EditorTemplate> <select id="ddlGVSL" style="width: 100px"> <%-- <option>--Select--</option>--%> <option>G</option> <option>S</option> </select> </EditorTemplate> </eo:CustomColumn> <eo:CustomColumn HeaderText="GL Code" DataField="GLCode" Width="100" Name="GLCode" ClientSideBeginEdit="on_begin_edit_Jou" ClientSideEndEdit="on_end_edit_Jou" AllowResize="false"> <EditorTemplate> <select id="ddlJV" style="width: 100px" onchange="on_GLCode_change()"> <option>-Please Select-</option> <asp:Repeater runat="server" ID="JV"> <ItemTemplate> <option value='<%#DataBinder.Eval(Container.DataItem, "GLcode")%>'> <%#DataBinder.Eval(Container.DataItem, "GLCODE")%></option> </ItemTemplate> </asp:Repeater> </select> </EditorTemplate> </eo:CustomColumn> <eo:CustomColumn HeaderText="Co
Javascript is
function OnBeginEditJou(cell) { gv_curItemIndex =cell.getItemIndex(); var v = cell.getValue();
//Set the drop downbox's selectedIndex based on the //current value var dropDownBox = document.getElementById("ddlGVSL"); for (var i = 0; i < dropDownBox.options.length; i++) { if (dropDownBox.options[i].text == v) { dropDownBox.selectedIndex = i; return; } dropDownBox.selectedIndex = 0; } }
function OnEndEditJou(cell) {
var dropDownBox = document.getElementById("ddlGVSL"); var selectedIndex = dropDownBox.selectedIndex; var index = grid.cell.getItemIndex();
var selectedItem = TRANSACTIONS_MAIN_bodycontent_bodysubcontent_gvJournaldetails.getItem(index); var ddb = document.getElementById("ddlJV"); if (selectedIndex==0) { ddb.disabled = true; }
else { ddb.disabled = false; } if (selectedIndex >= 0) return dropDownBox.options[selectedIndex].text; return null;
}
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
GridRow is not a control. If you wish to find the control that you put inside a CustomColumn's EditorTemplate, then you can use something like this:
Grid1.Columns[0].EditorInstance.FindControl("your_controlId");
Thanks
|