I need to set the visibility of the tr from the grdProductGroup_ItemDataBound when the record is selected for editing.
Currently,
in my grdPG_ItemDataBound for Edit Item
all fine till here...
But how do I get the client Id of the TR in the javascript
Here is my Javascript .. any cleaner way to do it ?
Currently,
in my grdPG_ItemDataBound for Edit Item
| if |
| (((PG)item.DataItem).ProductGroupType == "mobile") |
| { |
| HtmlTableRow tr = (HtmlTableRow)item.FindControl("trMobile"); |
| tr.Style.Clear(); |
| tr.Style.Add( |
| HtmlTextWriterStyle.Display, ""); |
| } |
& in my aspx page
| <tr> |
| <td align="right"> |
| <asp:Label ID="Label3" runat="server" CssClass="label" |
| Text=" Product Type:"></asp:Label><span |
| class="requiredFieldIndicator">*</span> |
| </td> |
| <td align="left" colspan="3"> |
| <telerik:RadComboBox ID="cboPG" runat="server" Skin="Vista" MarkFirstMatch="True" |
| AppendDataBoundItems="true" AutoPostBack="false" |
| OnClientSelectedIndexChanged = "ShowHidetrMobile" Font-Names="Verdana" |
| Font-Size="8" > |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| <tr id="trMobile" style="display:none" runat="server" > |
| <td align="right"> |
| <asp:Label ID="Label1" runat="server" CssClass="label" |
| Text="Mobile Company:"></asp:Label><span |
| class="requiredFieldIndicator">*</span> |
| </td> |
| <td align="left" colspan="3"> |
| <telerik:RadComboBox ID="cboMobileCompany" runat="server" Skin="Vista" MarkFirstMatch="True" |
| AppendDataBoundItems="true" AutoPostBack="false" |
| Font-Names="Verdana" |
| Font-Size="8" > |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
But how do I get the client Id of the TR in the javascript
Here is my Javascript .. any cleaner way to do it ?
| function ShowHidetrMobile(obj,args) |
| { |
| if (obj._text=="Mobile") |
| $get("ctl00_ContentPlaceHolder1_grdProductGroup_ctl00_ctl05_trMobile").style.display=""; //Although i dont like this way |
| else |
| $get("ctl00_ContentPlaceHolder1_grdProductGroup_ctl00_ctl05_trMobile").style.display="none"; |
| } |
all fine till here...But how do I get the client Id of the TR in the javascriptHere is my Javascript .. any cleaner way to do it ?
