This is a migrated thread and some comments may be shown as answers.

OnRowDataBound not raised

0 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chhass
Top achievements
Rank 1
chhass asked on 11 Dec 2008, 02:00 PM
Hi,

I´m using a page with radsplitter, 2 radpanes, one with Gmaps, and below with Radgrid.

To create markers on google maps, i'm thinking about calling a javascript function client-side, with OnRowDataBound.

We have tested, and with RowSelected, the marker is created sucessfully.

But OnRowDataBound appears to be not called.




<script type="text/javascript">

    function PlotaPontos(sender, eventArgs) {
 
        var dataItem = $get(eventArgs.get_id());
        var grid = sender;
        var MasterTable = grid.get_masterTableView();
        var row = MasterTable.get_dataItems()[dataItem.rowIndex];
        var ignition = MasterTable.getCellByColumnUniqueName(row, "Ignition")
        var lat = MasterTable.getCellByColumnUniqueName(row, "Lat");
        var lng = MasterTable.getCellByColumnUniqueName(row, "Lng");

        var point = new GLatLng(parseFloat(lat.innerText.replace(",", ".")), parseFloat(lng.innerText.replace(",", ".")));
        
        
        if (ignition.firstChild.nameProp == "ico_ignition_on.gif") {
            markerOptions = { icon: Icon_on };
        } else {
            markerOptions = { icon: Icon_off };
        }

        var marker = new GMarker(point, markerOptions);

        map.addOverlay(marker);
    }
 
</script>



        <telerik:RadPane ID="GridPane" runat="server" Width="980px" Height="300px"  
            Scrolling="None" >
                      <telerik:RadGrid ID="rgVehiclesGrid" runat="server" AllowSorting="True"
                                   AutoGenerateColumns="False" DataSourceID="dsVehiclesGrid" EnableAjax="true"
                                   EnableTheming="True" GridLines="None" Height="100%" skin="WebBlue"
                                   style="margin-right: 0px" Width="980px"
                          onitemdatabound="rgVehiclesGrid_ItemDataBound">
                                   <HeaderContextMenu EnableTheming="True" Skin="WebBlue">
                                       <CollapseAnimation Duration="200" Type="OutQuint" />
                                   </HeaderContextMenu>
                                   <MasterTableView AllowCustomSorting="True" DataSourceID="dsVehiclesGrid"
                                       EnableColumnsViewState="False" GroupLoadMode="Server"
                                       NoMasterRecordsText="Nenhum Veiculo Encontrado!">
                                       <RowIndicatorColumn>
                                           <HeaderStyle Width="20px" />
                                       </RowIndicatorColumn>
                                       <ExpandCollapseColumn Resizable="False" Visible="False">
                                           <HeaderStyle Width="20px" />
                                       </ExpandCollapseColumn>
                                       <Columns>
                                           <telerik:GridBoundColumn DataField="VehiclePlate" HeaderText="Placa"
                                               SortExpression="VehiclePlate" UniqueName="VehiclePlate">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="60px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="TrailerPlate" HeaderText="Carreta"
                                               SortExpression="TrailerPlate" UniqueName="TrailerPlate">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="60px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="VehicleName" HeaderText="Veículo"
                                               SortExpression="VehicleName" UniqueName="VehicleName">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="70px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridTemplateColumn DataType="System.Boolean" HeaderText="LD"
                                               SortExpression="Ignition" UniqueName="Ignition">
                                               <ItemTemplate>
                                                   <asp:Image ID="Image" runat="server" AlternateText='<%# Eval("Ignition") %>' />
                                               </ItemTemplate>
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="40px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridTemplateColumn>
                                           <telerik:GridTemplateColumn HeaderText="Posição" SortExpression="LandMark"
                                               UniqueName="TemplateColumn1">
                                               <ItemTemplate>
                                                   <asp:LinkButton ID="LinkButton4" runat="server"
                                                       OnClientClick='<%# String.Format("return LandMarkClick({0})", new GLatLng(Convert.ToDouble(Eval("Lat")),Convert.ToDouble(Eval("Lng")))) %>'
                                                       Text='<%# Eval("LandMark") %>'></asp:LinkButton>
                                               </ItemTemplate>
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="250px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridTemplateColumn>
                                           <telerik:GridBoundColumn DataField="EventDateTime" DataType="System.DateTime"
                                               HeaderText="Data/Hora" SortExpression="EventDateTime"
                                               UniqueName="EventDateTime">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="110px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="Speed" DataType="System.Decimal"
                                               HeaderText="Km/h" ReadOnly="True" SortExpression="Speed" UniqueName="Speed">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="45px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="Rpm" HeaderText="RPM/°C" ReadOnly="True"
                                               SortExpression="Rpm" UniqueName="Rpm">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="48px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="DriverName" HeaderText="Motorista"
                                               SortExpression="DriverName" UniqueName="DriverName">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="70px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="Odometer" DataType="System.Decimal"
                                               HeaderText="Hodômetro" SortExpression="Odometer" UniqueName="Odometer">
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="70px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                                                   Wrap="True" />
                                           </telerik:GridBoundColumn>
                                           <telerik:GridTemplateColumn DataField="LD" HeaderText="Opções"
                                               UniqueName="TemplateColumn2">
                                               <ItemTemplate>
                                                   <asp:ImageButton ID="ImageButton13" runat="server"
                                                       ImageUrl="~/Images Button/ico_btn_history.gif" />
                                                   <asp:ImageButton ID="ImageButton14" runat="server"
                                                       ImageUrl="~/Images Button/ico_btn_print.gif" />
                                                   <asp:ImageButton ID="ImageButton15" runat="server"
                                                       ImageUrl="~/Images Button/ico_btn_options.gif" />
                                                   <asp:ImageButton ID="ImageButton16" runat="server"
                                                       ImageUrl="~/Images Button/ico_msg_on.gif" />
                                               </ItemTemplate>
                                               <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                               <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Width="80px" Wrap="True" />
                                               <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                                   Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                                   Wrap="True" />
                                           </telerik:GridTemplateColumn>
                                           <telerik:GridBoundColumn DataField="Lat" ReadOnly="True" SortExpression="Lat"
                                               UniqueName="Lat" Visible="True">
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="Lng" SortExpression="Lng" UniqueName="Lng"
                                               Visible="True">
                                           </telerik:GridBoundColumn>
                                       </Columns>
                                   </MasterTableView>
                                   <SelectedItemStyle Wrap="True" />
                                   <ClientSettings>
                                       <Selecting AllowRowSelect="True" />
                                       <ClientEvents OnRowDataBound="PlotaPontos" />
                                       <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                       <Resizing AllowColumnResize="True" ResizeGridOnColumnResize="True" />
                                   </ClientSettings>
                                   <FilterMenu EnableTheming="True" Skin="WebBlue">
                                       <CollapseAnimation Duration="200" Type="OutQuint" />
                                   </FilterMenu>
                                   <SortingSettings SortedAscToolTip="" SortedDescToolTip=""
                                       SortToolTip="Ordenar" />
                               </telerik:RadGrid>
                       
                               <asp:SqlDataSource ID="dsVehiclesGrid" runat="server"
                                   ConnectionString="<%$ ConnectionStrings:CronosConnectionString %>"
                                   SelectCommand="USP_Web_Vehicle_Grid_V1" SelectCommandType="StoredProcedure">
                                   <SelectParameters>
                                       <asp:SessionParameter Name="UserLogin" SessionField="UserId" Type="String" />
                                       <asp:Parameter DefaultValue="EventDateTime" Name="SortColumn" Type="String" />
                                       <asp:Parameter DefaultValue="DESC" Name="SortOrder" Type="String" />
                                   </SelectParameters>
                               </asp:SqlDataSource>
                                    
        </telerik:RadPane>




No answers yet. Maybe you can help?

Tags
Grid
Asked by
chhass
Top achievements
Rank 1
Share this question
or