Hi,
what I'am trying to do is to simply extract data from the selected row in the grid on the client side. I've gone through most of the API material available and according to it everything should work.... But it does not...
My suspicion is that when using an item-template in the RadGrid the column data in the selected row is not available, is this correct? If so, how should I get it in Javascript then? Or have I completely missed something?
what I'am trying to do is to simply extract data from the selected row in the grid on the client side. I've gone through most of the API material available and according to it everything should work.... But it does not...
My suspicion is that when using an item-template in the RadGrid the column data in the selected row is not available, is this correct? If so, how should I get it in Javascript then? Or have I completely missed something?
| <telerik:RadScriptBlock id="RadScriptBlock1" runat="server"> |
| <script language="javascript" type="text/javascript"> |
| var grid; |
| function RowSelected(rowObject) { |
| //alert("ROWSEL"); |
| alert(rowObject); |
| var selRow = this.GetCellByColumnUniqueName(rowObject, "Id"); |
| alert(rowObject.KeyValues["Id"]); |
| //here selRow.innerHTML will hold the value for the selected row contact name |
| } |
| function GridCreated() { |
| grid = this; |
| } |
| </script> |
| </telerik:RadScriptBlock> |
| <input id="media_id" type="hidden" /> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" GridLines="None" |
| OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged" AutoGenerateColumns="False" |
| HorizontalAlign="Left" Width="380px"> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| <ClientEvents OnGridCreated="GridCreated" OnRowSelected="RowSelected"></ClientEvents> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> |
| </ClientSettings> |
| <PagerStyle Mode="NumericPages" /> |
| <MasterTableView TableLayout="Fixed"> |
| <ItemTemplate> |
| <asp:Image ID="Image1" Style="float: left;" Width="40px" Height="40px" ImageUrl='<%# Eval("ThumbnailURL") %>' |
| runat="server" AlternateText="" /> |
| <span>  <b>Title:</b></span> |
| <%# Eval("Title")%><br /> |
| <span>  <b>Type:</b></span> |
| <%# Eval("Type")%> |
| <br /> |
| <span>  <b>Description:</b></span> |
| <%# Eval("Description")%> |
| </ItemTemplate> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="column1" |
| AutoPostBackOnFilter="True" FilterControlWidth="90px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Type" HeaderText="Type" UniqueName="column" AutoPostBackOnFilter="True" |
| FilterControlWidth="80px" Visible="true"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="column2" |
| AutoPostBackOnFilter="True" FilterControlWidth="90px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Id" UniqueName="Id" |
| AutoPostBackOnFilter="True" Display="False" Visible="False"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |