Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
187 views
I'm new to Telerik controls, so I apologize if this is an easy thing that I've missed in the documentation. 

We used to use a competitor's product that allowed for modifying cell values in a Row Initialization Event.  How would I go about modifying the value in a cell through code before the grid is displayed?  I haven't been able to figure this out yet. 
Dan
Top achievements
Rank 2
 answered on 14 Apr 2011
4 answers
87 views
I am using VS2010 with the latest Telerik controls for asp.net AJAX with ASP.NET 4.0.

I have a business intelligence application that needs to have a customer insert commentary into a report.  Currently we are using AJAX contol toolkit's Modal Popup Extender with Winthusiasm for the WYSIWYG editor.

We would like to replace all controls with Telerik controls.  I was thinking about some kind of modal dialog with a good looking editor.  I am open to other suggestions.

Can anyone point me to a control or two that would help me accomplish what I need.

Thanks,
--jeff
Jeff Kershner
Top achievements
Rank 1
 answered on 14 Apr 2011
2 answers
79 views
Hello-

I have created an aspx page that has a RadGrid on it and when a user inserts, deletes or edits a row in the grid, the correct callback is made and everything works perfectly.

The problem is that when I tie that same aspx page to a master page and put the grid inside a content control, the Insert/Delete/Edit callback is never made.

I spent a lot of time looking to see if this help page applied:  http://www.telerik.com/help/aspnet/grid/grdmakepostbackajaxrequestfromusercontrolwebformmasterpage.html

But I wasn't able to understand how to make it work for the Insert/Delete/Edit callbacks, so hopefully someone can provide me with an answer that is specific to my code.

Thanks in advance for your help!

- G  
Greg
Top achievements
Rank 1
 answered on 14 Apr 2011
4 answers
87 views
I've got a radgrid inside of a panel bar, but the panel bar contents do not show in page load UNTIL you mouse over the panel bar.  Only then will the panel bar's contents appear.  

The posting closest to this my problem is this posting, but it applies to a much older Telerik tools release (we're currently using RadControls for ASP.NET AJAX Q2 for .net 3.5 in a VS2008 web application).  There were other causes suggested  (.css formatting?!) , but those solutions do not work or didn't apply. 

So... Are there any known issues that fall in with this description?  Any leads, hints or links relating to this issue would be helpful.   

I have tried several solutions, but none worked or were appropriate.  Some of them include: 
  • Programatically  adding the AJAX contol update relationships on the page load - it worked great in ajaxifying contols, loading panels, etc, but did not resolve the grid/show/mouseover problem.
  • Setting the grids focus on page load - works - but doesn't work if multiple grids are in play, only the last grid given focus appears
  • Comparing this page(s) in question to OTHER pages in the app that are wired up the same way (data sources, binding, ajax settings, panel bar/item nesting, AJAX, etc). 
  • Creating a new page entirely, copying html and code behind, but no joy...

Thanks in advance,
Todd


Some code snippets...

<%@ Page Title="" Language="C#" MasterPageFile="~/OverShort/OverShort.Master" AutoEventWireup="true" CodeBehind="BillsOfLading.aspx.cs" Inherits="ODSWebSite.OverShort.BillOfLadings" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="cphOSHead" runat="server">
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphOSMain" runat="server">
 
    <!-- NOTE: For export to work... -->
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="onRequestStart" />
        <AjaxSettings>
             <telerik:AjaxSetting AjaxControlID="ButtonSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="AjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="ButtonSearch" />
                    <telerik:AjaxUpdatedControl ControlID="RadGridBOLDetail"/>
                    <telerik:AjaxUpdatedControl ControlID="RadGridBOLSummary"/>
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGridBOLDetail">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="AjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadGridBOLDetail" /> 
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGridBOLSummary">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlAll" LoadingPanelID="AjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadGridBOLSummary" /> 
                    <telerik:AjaxUpdatedControl ControlID="lblError" />
                </UpdatedControls>
            </telerik:AjaxSetting>
             
            <telerik:AjaxSetting AjaxControlID="RadDateTimePickerFrom">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadDateTimePickerFrom" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadDateTimePickerTo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadDateTimePickerTo" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadComboBoxTASLocations">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadComboBoxTASLocations" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
    <telerik:RadAjaxLoadingPanel runat="server" ID="AjaxLoadingPanel1" MinDisplayTime="50"></telerik:RadAjaxLoadingPanel>
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server"  DecoratedControls="CheckBoxes, Buttons, Scrollbars, Textarea, Fieldset, Label, Zone, GridFormDetailsViews" />
    <asp:Panel ID="pnlAll" runat="server">
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >
            <asp:Label ID="lblError" runat="server"></asp:Label>
            <table>
                <tr>
                    <td class="tdLabel"><label id="lblLocation" runat="server">Location:</label></td>
                    <td>
                        <telerik:RadComboBox ID="RadComboBoxTASLocations" runat="server"
                            DataSourceID="LocationsDataSource"
                            DataTextField="TypeDisplayValue"
                            DataValueField="TypeValue"
                            AutoPostBack="false"
                            CausesValidation="False"   
                            Height="200" width="200" DropDownWidth="250"
                        >
                        </telerik:RadComboBox>
                    </td>
                    <td class="tdLabel"><label id="lblFrom" runat="server">From:</label></td>
                    <td><telerik:RadDateTimePicker ID="RadDateTimePickerFrom" Runat="server"
                            Width="180" MinDate="2010-01-01">
                            <Calendar runat="server" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x" ShowRowHeaders="false"></Calendar>
                                            <TimeView ID="TimeView1" runat="server" CellSpacing="-1" Culture="English (United Kingdom)"
                            EndTime="23:59:00" RenderDirection="Vertical"  Columns="2"></TimeView>
                        <TimePopupButton HoverImageUrl="" ImageUrl="" />
                        <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        <DateInput ID="DateInput1" runat="server"
                            DateFormat="M/d/yyyy HH:mm" DisplayDateFormat="M/d/yyyy HH:mm">
                        </DateInput>
                        </telerik:RadDateTimePicker>
                    </td>
                    <td class="tdLabel"><label id="lblTo" runat="server">To:</label></td>
                    <td><telerik:RadDateTimePicker ID="RadDateTimePickerTo" Runat="server"  Width="180"
                            MinDate="2010-01-01">
                            <Calendar runat="server" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x" ShowRowHeaders="false"></Calendar>
                                            <TimeView ID="TimeView2" runat="server" CellSpacing="-1" Culture="English (United Kingdom)"
                            EndTime="23:59:00" RenderDirection="Vertical"  Columns="2"></TimeView>
                        <TimePopupButton HoverImageUrl="" ImageUrl="" />
                        <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        <DateInput ID="DateInput2" runat="server"
                            DateFormat="M/d/yyyy HH:mm" DisplayDateFormat="M/d/yyyy HH:mm">
                        </DateInput>
                        </telerik:RadDateTimePicker>
                    </td>
                    <td><asp:Button ID="ButtonSearch" runat="server" Text="Search"
                            onclick="ButtonSearch_Click" /></td>
            </tr>
            </table>
            <telerik:RadPanelBar ID="rpbBOLSummary" runat="server" Width="100%" >
                <Items>
                    <telerik:RadPanelItem runat="server" Expanded="True" Text="Summary">
                <Items>
                    <telerik:RadPanelItem runat="server" Value="BOLSummary">
                        <ItemTemplate>
                            <telerik:RadGrid ID="RadGridBOLSummary" runat="server"
                        Visible="false"
                        AllowFilteringByColumn="True" 
                        AllowSorting="True"
                        AutoGenerateColumns="False"
                        DataSourceID="myBillOfLadingsSummaryODS"
                        GridLines="Vertical"
                        onsortcommand="RadGridBOLSummary_SortCommand"
                        onitemdatabound="RadGridBOLSummary_ItemDataBound"
                        OnItemCommand="RadGridBOLSummary_ItemCommand"
                        ShowFooter="True"
                        ShowStatusBar="True"
                        Width="650px"
                        GroupingEnabled="False"
                        >
                        <GroupingSettings CaseSensitive="false" />
                        <MasterTableView DataSourceID="myBillOfLadingsSummaryODS"
                            CommandItemDisplay="Top" GridLines="Vertical"
                            AllowPaging="true" PageSize="20">
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" />
                            <commanditemsettings showexporttoexcelbutton="True"
                                showexporttopdfbutton="false"  ShowAddNewRecordButton="false"/>
                            <Columns>
                  
                       <telerik:GridBoundColumn DataField="InventoryDate" HeaderText="Inventory Date"
                            SortExpression="InventoryDate" UniqueName="InventoryDate"
                            DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy HH:mm}">
                            <ItemStyle Wrap="false" />
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="ProductID" HeaderText="Product ID"
                            SortExpression="ProductID" UniqueName="ProductID" DataType="System.String"  FilterControlWidth="50px">
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="BillIDCountATLAS" HeaderText="Bill Count (ATLAS)"
                            SortExpression="BillIDCountATLAS" UniqueName="BillIDCountATLAS" DataType="System.Int32" DataFormatString="{0:#,###0}" FilterControlWidth="60px">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn DataField="BillVolumeSumATLAS" HeaderText="Bill Vol (ATLAS)"
                            SortExpression="BillVolumeSumATLAS" UniqueName="BillVolumeSumATLAS" DataType="System.Int32" DataFormatString="{0:#,###0}" FilterControlWidth="60px">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="BillIDCountTAS" HeaderText="Bill Count (TAS)"
                            SortExpression="BillIDCountTAS" UniqueName="BillIDCountTAS" DataType="System.Int32" DataFormatString="{0:#,###0}" FilterControlWidth="60px">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn DataField="BillVolumeSumTAS" HeaderText="Bill Vol (TAS)"
                            SortExpression="BillVolumeSumTAS" UniqueName="BillVolumeSumTAS" DataType="System.Int32" DataFormatString="{0:#,###0}" FilterControlWidth="60px">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn DataField="BillVolumeSumTASBBL" HeaderText="Bill Vol (TAS) BBL"
                            SortExpression="BillVolumeSumTASBBL" UniqueName="BillVolumeSumTASBBL" DataType="System.Int32" DataFormatString="{0:#,###0}" FilterControlWidth="60px">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="VolumeVariance" HeaderText="Vol Variance"
                            SortExpression="VolumeVariance" UniqueName="VolumeVariance" DataType="System.Int32" DataFormatString="{0:#,###0}" FilterControlWidth="60px">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                         
                         
                    </Columns>
                            <EditFormSettings>
                        <EditColumn UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings AllowDragToGroup="False"></ClientSettings>
                    </telerik:RadGrid>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
            <br />
            <telerik:RadPanelBar ID="rpBOLDetail" runat="server" Width="100%" >
                <Items>
                    <telerik:RadPanelItem runat="server" Expanded="True" Text="Detail">
                <Items>
                    <telerik:RadPanelItem runat="server" Value="BOLDetail">
                    <ItemTemplate>
                        <telerik:RadGrid ID="RadGridBOLDetail" runat="server"
                        Visible="false"
                        AllowFilteringByColumn="True" 
                        AllowSorting="True"
                        AutoGenerateColumns="False"
                        DataSourceID="myBillOfLadingsDetailODS"
                        GridLines="Vertical"
                        onsortcommand="RadGridBOLDetail_SortCommand" 
                        OnItemCommand="RadGridBOLDetail_ItemCommand"
                        ShowFooter="True"
                        ShowStatusBar="True"
                        Width="650px"
                        GroupingEnabled="true"
                        >
                        <GroupingSettings CaseSensitive="false" />
                        <MasterTableView DataSourceID="myBillOfLadingsDetailODS"
                            CommandItemDisplay="Top" GridLines="Vertical"
                            AllowPaging="true" PageSize="20">
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" />
                                <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="ProductID" /> 
                                    </GroupByFields
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldName="ProductID" HeaderText="Product ID" /> 
                                    </SelectFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                            <commanditemsettings showexporttoexcelbutton="True" showexporttopdfbutton="false"  ShowAddNewRecordButton="false"/>
                            <Columns>
                  
                        <telerik:GridBoundColumn DataField="InventoryDate" HeaderText="Inventory Date"
                            SortExpression="InventoryDate" UniqueName="InventoryDate"
                            DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy HH:mm}">
                            <ItemStyle Wrap="false" />
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn DataField="BillID" HeaderText="Bill ID"
                            SortExpression="BillID" UniqueName="BillID" DataType="System.String">
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="DetailType" HeaderText="Detail Type"
                            SortExpression="DetailType" UniqueName="DetailType" FilterControlWidth="50px">
                             
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="ProductID" HeaderText="Product ID"
                            SortExpression="ProductID" UniqueName="ProductID" FilterControlWidth="50px">
                             
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="NetVolume" HeaderText="Net Volume"
                            SortExpression="NetVolume" UniqueName="NetVolume" DataType="System.Int32"
                            DataFormatString="{0:#,###0}" FilterControlWidth="70px">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="UOM" HeaderText="UOM"
                            SortExpression="UOM" UniqueName="UOM" FilterControlWidth="50px">
                            <ItemStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn DataField="ATLASProcessStatus" HeaderText="ATLASProcessStatus"
                            SortExpression="ATLASProcessStatus" UniqueName="ATLASProcessStatus">
                        </telerik:GridBoundColumn>
                         
                         
                         
                    </Columns>
                            <EditFormSettings>
                        <EditColumn UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings AllowDragToGroup="False">
                        </ClientSettings>
                    </telerik:RadGrid>
                    </ItemTemplate>
                </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
        </telerik:RadAjaxPanel>
    </asp:Panel>
     
<br />
 
 
<asp:ObjectDataSource ID="LocationsDataSource" runat="server"
    DataObjectTypeName="Enterprise.ODS.DataObjects.Assets.StringCriteriaType"
    TypeName="Enterprise.ODS.BLL.Shared.LocationsODS"
    SelectMethod="GetUserLocationsWithKeyAndDescription"
    onselecting="LocationsDataSource_Selecting"
    >
    <SelectParameters>
        <asp:Parameter Name="user" />
    </SelectParameters>
</asp:ObjectDataSource>
 
<asp:ObjectDataSource ID="myBillOfLadingsDetailODS" runat="server"
    CacheDuration="120"
    DataObjectTypeName="Enterprise.ODS.DataObjects.OverShort.BOLDetail"
    TypeName="Enterprise.ODS.BLL.OverShort.BOLDetailsODS"
    SelectMethod="BillOfLadingDetails"
    OnUpdated="ObjDataSource_Event"
    EnableCaching="False" 
     onselected="ObjDataSource_Selected"
        onselecting="ObjDataSource_Selecting">
     <SelectParameters>
        <asp:ControlParameter Name="locationKey" ControlID="RadComboBoxTASLocations" Type="Int32" Direction="Input"/>
        <asp:ControlParameter Name="dateFrom" ControlID="RadDateTimePickerFrom" Type="DateTime" Direction="Input" />
        <asp:ControlParameter Name="dateTo" ControlID="RadDateTimePickerTo" Type="DateTime" Direction="Input" />
        <asp:Parameter DefaultValue="" Name="sortExpression" Type="String" />
        <asp:Parameter DefaultValue="" Name="sortDirection" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>
 
<asp:ObjectDataSource ID="myBillOfLadingsSummaryODS" runat="server"
    CacheDuration="120"
    DataObjectTypeName="Enterprise.ODS.DataObjects.OverShort.RackToAtlasComparison"
    TypeName="Enterprise.ODS.BLL.OverShort.RackToAtlasComparisonODS"
    SelectMethod="BillOfLadingSummary"
    OnUpdated="ObjDataSource_Event"
    EnableCaching="False" 
     onselected="ObjDataSource_Selected"
        onselecting="ObjDataSource_Selecting">
     <SelectParameters>
        <asp:ControlParameter Name="locationKey" ControlID="RadComboBoxTASLocations" Type="Int32" Direction="Input"/>
        <asp:ControlParameter Name="dateFrom" ControlID="RadDateTimePickerFrom" Type="DateTime" Direction="Input" />
        <asp:ControlParameter Name="dateTo" ControlID="RadDateTimePickerTo" Type="DateTime" Direction="Input" />
        <asp:Parameter DefaultValue="" Name="sortExpression" Type="String" />
        <asp:Parameter DefaultValue="" Name="sortDirection" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>
 
     
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphOSSideTasks" runat="server">
</asp:Content>


using System;
using System.Globalization;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Enterprise.ODS.DataObjects;
using Enterprise.Utilities.DataAccessCore;
using Enterprise.ODS.DAL.OverShort;
 
 
namespace ODSWebSite.OverShort
{
    public partial class BillOfLadings : System.Web.UI.Page
    {
 
 
        protected void Page_Load(object sender, EventArgs e)
        {
            Shared.Helpers.FormatErrorLabel(ref lblError, true, "");// reset error label on page load
            if (!Page.IsPostBack)
            {
                // Select the page in the local nav bar
                ((OverShort)(Page.Master)).SelectPage(OverShort.OverShortPages.BillsOfLading);
 
                ODSWebSite.Shared.Helpers.SetDefaultLocationAndDateRange(User.Identity.Name,
                    ref RadComboBoxTASLocations, ref RadDateTimePickerFrom, ref RadDateTimePickerTo);
 
            }
        }
 
        #region grid events
 
        protected void RadGridBOLSummary_SortCommand(object source, GridSortCommandEventArgs e)
        {
            Shared.Helpers.SetSortOrderForObjDataSource(myBillOfLadingsSummaryODS, e);
        }
 
         
        protected void RadGridBOLDetail_SortCommand(object source, GridSortCommandEventArgs e)
        {
            Shared.Helpers.SetSortOrderForObjDataSource(myBillOfLadingsDetailODS, e);
        }
 
        protected void RadGridBOLSummary_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem )
            {
                GridDataItem dataBoundItem = e.Item as GridDataItem;
                 
                 
 
                    int volVariance ;
                 
                if (int.TryParse(dataBoundItem["VolumeVariance"].Text, 
                   NumberStyles.Integer | NumberStyles.AllowThousands,CultureInfo.InvariantCulture, out volVariance))
                {
                    if (volVariance != 0)
                    {
                        dataBoundItem["VolumeVariance"].ForeColor = System.Drawing.Color.Red;
                        dataBoundItem["VolumeVariance"].Font.Bold = true;
                    }
                }
            }
        }
 
        protected void RadGridBOLDetail_ItemCommand(object source, GridCommandEventArgs e)
        {
            RadGrid grid = ((RadGrid)Shared.Helpers.FindControlRecursive(rpBOLDetail, "RadGridBOLDetail"));
            Shared.Helpers.RadGridItemCommandForExport(ref grid, e);
        }
        protected void RadGridBOLSummary_ItemCommand(object source, GridCommandEventArgs e)
        {
            RadGrid grid = ((RadGrid)Shared.Helpers.FindControlRecursive(rpbBOLSummary, "RadGridBOLSummary"));
            Shared.Helpers.RadGridItemCommandForExport(ref grid, e);
        }
 
        #endregion
 
        #region object data source events
 
        protected void ObjDataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Shared.Helpers.ObjDataSource_Selected(ref lblError, e);
        }
 
        protected void ObjDataSource_Event(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Shared.Helpers.ObjDataSource_Event(ref lblError, sender, e);
        }
 
        protected void LocationsDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            e.InputParameters["user"] = Page.User.Identity.Name;
        }
 
        #endregion
 
        protected void ButtonSearch_Click(object sender, EventArgs e)
        {
            string errorMessage = "";
            if (Shared.Helpers.LocationDateRangeIsOK(
                ref RadComboBoxTASLocations,
                ref RadDateTimePickerFrom,
                ref RadDateTimePickerTo,
                ref errorMessage))
            {
                ((RadGrid)Shared.Helpers.FindControlRecursive(rpBOLDetail, "RadGridBOLDetail")).Rebind();
                ((RadGrid)Shared.Helpers.FindControlRecursive(rpBOLDetail, "RadGridBOLDetail")).Visible = true;
                //myBillOfLadingsDetailODS.Select();
 
                ((RadGrid)Shared.Helpers.FindControlRecursive(rpbBOLSummary, "RadGridBOLSummary")).Rebind();
                ((RadGrid)Shared.Helpers.FindControlRecursive(rpbBOLSummary, "RadGridBOLSummary")).Visible = true;
                //myBillOfLadingsSummaryODS.Select();
 
            }
            else
                Shared.Helpers.FormatErrorLabel(ref lblError, false, errorMessage);
 
        }
 
        protected void ObjDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        
            // Stop data from loading on intial page load
            if (!Page.IsPostBack)
            {
                //don't auto-search when page loads
                e.Cancel = true;
            }
            else
            {
                string errorMessage = "";
 
                if (!(Shared.Helpers.LocationDateRangeIsOK(
                ref RadComboBoxTASLocations,
                ref RadDateTimePickerFrom,
                ref RadDateTimePickerTo,
                ref errorMessage)))
                {
                    Shared.Helpers.FormatErrorLabel(ref lblError, false, errorMessage);
                    e.Cancel = true;
                }
                else
                {
                    Shared.Helpers.FormatErrorLabel(ref lblError, true, "");
                }
            }
              
        }
 
 
    }
}







Todd
Top achievements
Rank 1
 answered on 14 Apr 2011
2 answers
232 views
That's basically my problem, just need to know what method in javascript will allow me to click (i.e. fire a click event) of a toolbarbutton. To be more precise, I actually need the onclientbuttonclicking event to be called.

Thanks,

Dan
Brian Azzi
Top achievements
Rank 2
 answered on 14 Apr 2011
1 answer
162 views
Hi, Telerik.

Please help, google map wont fill whole RadTab. I tried
<div id="map_canvas" style="width: 100%; height: 100%; margin: 0px;"/>
i also tried
<div id="map_canvas" style="width: auto; height: auto; margin: 0px;"/>

Map only shows if width and height is in px,
I just want the map to scale to fit the RadTab so that when a panel is collapsed, the map fills the new space. Is it a CSS issue?

Please help.

here is the whole code.

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Map Demo</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        html, body, form
        {
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadSplitter ID="MainSplitter" runat="server" Height="100%" Width="100%"
        Orientation="Horizontal" Skin="Black" LiveResize="true" VisibleDuringInit="false"
        ResizeWithBrowserWindow="true">
        <telerik:RadPane ID="TitleBarPane" runat="server" Locked="true" Height="35px"
            CssClass="TitleBarPane">
            <div id="TitleBar">
                &nbsp;
            </div>
        </telerik:RadPane>
        <telerik:RadSplitBar ID="TitleRadSplitBar" runat="server" Height="100%" Width="100%" />
        <telerik:RadPane ID="ContentPane" runat="server" Scrolling="None">
            <telerik:RadSplitter ID="ContentRadSplitter" runat="server" Skin="Black">
                <telerik:RadPane ID="LeftRadPane" runat="server" Width="230" Scrolling="None">
                    <asp:UpdatePanel ID="updTest" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:Label ID="label3" Text="Some text here" runat="server" Style="position: absolute; color: Red;
                                left: 20px; bottom: 50px; z-index: 100;" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </telerik:RadPane>
                <telerik:RadSplitBar ID="NavRadSplitBar" runat="server" CollapseMode="Forward" />
                <telerik:RadPane ID="MapRadPane" runat="server" Scrolling="None">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="always">
                        <ContentTemplate>
                            <telerik:RadSplitter ID="MapDivSplitter" runat="server" Orientation="Horizontal"
                                Skin="Black" LiveResize="true" VisibleDuringInit="false">
                                <telerik:RadPane ID="MapPane" runat="server" Scrolling="None">
                                    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0">
                                    <Tabs>
                                    <telerik:RadTab Text="Google Map"></telerik:RadTab>
                                    </Tabs>
                                    </telerik:RadTabStrip>
                                    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" >
                                    <telerik:RadPageView ID="RadPageView1" runat="server" Height="100%" Width="100%">
                                    <br />
                                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                    <script type="text/javascript">
                                        function loadScript() {
                                            var script = document.createElement("script");
                                            script.type = "text/javascript";
                                            script.src = "http://maps.google.com/maps/api/js?v=3.3&sensor=true&callback=initialize";
                                            document.body.appendChild(script);
                                        }
                                        window.onload = loadScript;
                                        //initialization
                                        function initialize() {
                                            var latLng = new google.maps.LatLng(51.445517, -0.412006);
                                            //geocode init
                                            var geocoder = new google.maps.Geocoder();
                                            //map options
                                            var myMapOptions =
                                        {
                                            zoom: 10,
                                            center: latLng,
                                            mapTypeId: google.maps.MapTypeId.ROADMAP
                                        }

                                            //initialize map
                                            var map = new google.maps.Map(document.getElementById('mapDiv'), myMapOptions );
                                            //create makers
                                            var marker = new google.maps.Markers(
                                            { position: latLng,
                                                map: map,
                                                dgrabble: true
                                            });
                                        }
                                    </script>
                                    <div id="mapDiv" style="width: 750px; height: 650px; margin: 0px;"/>
                                    </telerik:RadScriptBlock>
                                    </telerik:RadPageView>
                                    </telerik:RadMultiPage>
                                </telerik:RadPane>
                                <telerik:RadSplitBar ID="MapRadSplitBar" runat="server"
                                    CollapseMode="Backward" />
                                <telerik:RadPane ID="DataGridPane" runat="server" Height="130" Scrolling="Both"
                                    MinHeight="150">
                                </telerik:RadPane>
                                <telerik:RadSplitBar ID="RadSplitBar1" Runat="server" Enabled="False">
                                </telerik:RadSplitBar>
                            </telerik:RadSplitter>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </telerik:RadPane>
            </telerik:RadSplitter>
        </telerik:RadPane>
    </telerik:RadSplitter>
    </form>
</body>
</html>
Helen
Telerik team
 answered on 14 Apr 2011
5 answers
257 views
Hello,

I am building a MVC program.  When I test the menu in the View:

    <telerik:RadMenu ID="RadMenu1" runat="server">
        <Items>
            <telerik:RadMenuItem runat="server" PostBack="False" Text="M1-1"
                NavigateUrl="~/home/show?p1=10"  >
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadMenu>

it works.  But in my case, I need to change the parameter value "p1" in run-time, depending on the combination of some previous user's inputs.

Ideally, if I can use some variables in the codes such as:

   ... NavigateUrl="~/home/show?p1=<%= Session['magic_number'] %>" ...

this will solve the issue.  However, this code runs into parser error.

I wonder if there is any solution or workaround to address this situation.  Many thanks.

Calleigh
Top achievements
Rank 1
 answered on 14 Apr 2011
1 answer
121 views
Greetings,

I am working on a form to assign learning objectives contained in an XML file to a lesson plan stored in a SQL table.  The source XML file looks like this.

<ObjectiveSet id="1" description="Firefighter II" parentID="">
    <objective id="2" description="Module A" parentID="1">
        <objective id="3" description="2-1  FIRE DEPARTMENT ORGANIZATION" parentID="2">
            <objective id="4" description="2-1.1  Identify the organization of the fire department. (3-1.1.1)" parentID="3" />
            <objective id="5" description="2-1.2  Identify the firefighter’s role as a member of the organization." parentID="3"/>
            <objective id="6" description="2-1.3  Identify the mission of the fire service and of the local fire department." parentID="3"/>
            <objective id="7" description="2-1.4  Identify the function of standard operating procedures. (3-2.1)" parentID="3"/>
            <objective id="8" description="2-1.5  Identify the fire department’s rules and regulations that apply to the" parentID="3"/>
            <objective id="9" description="2-1.6  Identify the basic components of incident management and the" parentID="3"/>
            <objective id="10" description="2-1.7  Identify the role of other agencies that may respond to emergencies." parentID="3" />
            <objective id="11" description="2-1.8  Identify the components of a member assistance program. (3-1.1.1)" parentID="3"/>
            <objective id="12" description="2-1.9  Identify the components of a member assistance program. (3-1.1.1)" parentID="3"/>       
        </objective>
        <objective id="13" description="FIRE BEHAVIOR" parentID="2">
            <objective id="14" description="Identify the following terms: (3-3.10)" parentID="13">
                <objective id="15" description="Fire/combustion" parentID="14" />
                <objective id="16" description="Heat" parentID="14" />
                <objective id="17" description="Ignition Temperature" parentID="14" />
            </objective>
        </objective>
    </objective>
</ObjectiveSet>

I can build the tree with no problem.  I can update the lesson plan record with the selected objective id's from the tree with no problem.

The ID's from the selected objectives in the XML tree are stored in a SQL table with columns as follows:

lessonPlanID objectiveID
1 4
1 5
2 17

When the user goes back another day to edit the objectives for lesson plan one, they will be presented the tree again.  When the page loads, it should appear with the previously assigned objectives already checked.  So, in the example, the tree would have objectiveID 4 and objectiveID 5 already checked.

I can not figure out how to check the items when the page loads.  I assume it has to do with databinding, instead of using XMLDataSource to build the tree.  I am very new to vb.net, so I am not certain how to create the tree and check off the appropriate boxes.

Is this possible?  Any ideas? 

Thank you in advance for any thoughts or help that anyone may be able to provide.

John
Nikolay Tsenkov
Telerik team
 answered on 14 Apr 2011
0 answers
56 views
Hi:
I have add some textbox created dinamically to myradspell.controlstocheck. I attached the error. The problem is the textboexes were created so:

public

 

partial class LogrosEquivalentes : System.Web.UI.Page

 

{

 

protected

 

void Page_Load(object sender, EventArgs e)

 

 

{

TemplateField

 

Columna1 = new TemplateField();

 

 

Columna1.ItemTemplate =

new TextBoxTemplate3("CodValoracion", false, !ingreso, 180, null,"Descripcion");

 

 

Columna1.HeaderText =

"Cdigo Logro";

 

 

MiGridView0.Columns.Add(Columna1);

MiGridView0.AutoGenerateColumns =

false;

 

 

MiGridView0.DataSource = DtCodigos;

 

MiGridView0.DataBind();

string[] VectorOrtografia = new string[MiGridView0.Rows.Count];

 

 

 

for (int i = 0; i < MiGridView0.Rows.Count - 1; i++)

 

 

{

 

VectorOrtografia[i] = ((

 

TextBox)MiGridView0.Rows[i].Cells[0].Controls[0]).ClientID;

 

}

 

RadSpell1.ControlsToCheck = VectorOrtografia;

 

 

}
}

public class TextBoxTemplate3 : ITemplate //Aqui asigno las propiedades y los eventos para cada TextBoxTemplate

 

 

 

 

 

 

 

{

 

 

 

string NombreColumna,NombreColumnaToolTip;

 

 

 

 

bool Habilitado, ReadOnly;

 

 

 

 

int Ancho,NumeroNombre;

 

 

 

 

string GridViewCodigosId;

 

 

 

 

//int ContadorControles = 0;

 

 

 

 

 

 

 

 

 

public TextBoxTemplate3(string Columna, bool habilita, bool readOnly, int AnchoControl, string gridviewcodigosid,string ColumnaToolTip)

 

 

{

 

GridViewCodigosId = gridviewcodigosid; NombreColumna = Columna; Habilitado = habilita; Ancho = AnchoControl;

 

ReadOnly = readOnly; NombreColumnaToolTip = ColumnaToolTip;

 

}

 

 

 

public void InstantiateIn(System.Web.UI.Control container)

 

 

{

 

 

 

TextBox TextBox1 = new TextBox();

 

 

TextBox1.ID =

 

"TextBox" + "&" + NombreColumna + "&" + GridViewCodigosId;// + ContadorControles;

 

 

 

 

 

 

 

TextBox1.ToolTip = TextBox1.ID;

 

TextBox1.Width =

 

Unit.Pixel(Ancho);

 

 

TextBox1.Height =

 

Unit.Pixel(20);

 

 

TextBox1.Enabled = Habilitado;

 

TextBox1.ReadOnly = ReadOnly;

 

TextBox1.Style.Add(

 

"vertical-align", "middle");

 

 

TextBox1.DataBinding +=

 

new EventHandler(TextBox1_DataBinding);

 

 

container.Controls.Add(TextBox1);

 

 

 

//ContadorControles++;

 

 

 

 

 

 

 

}

 

 

 

 

 

void TextBox1_DataBinding(object sender, EventArgs e)

 

 

{

 

 

 

TextBox TxtBox = (TextBox)sender;

 

 

 

 

GridViewRow container = (GridViewRow)TxtBox.NamingContainer;

 

 

TxtBox.Text = ((

 

DataRowView)container.DataItem)[NombreColumna].ToString();

 

 

 

 

//if (!(NombreColumnaToolTip == "")) TxtBox.ToolTip = ((DataRowView)container.DataItem)[NombreColumnaToolTip].ToString();

 

 

 

 

 

 

 

 

 

string Alumno = ((DataRowView)container.DataItem)[0].ToString();

 

 

TxtBox.Attributes.Add(

 

"onchange", "javascript:OnTextChanged(this,'" + GridViewCodigosId + "')");

 

 

TxtBox.Attributes.Add(

 

"onfocus", "javascript:OnFocus('" + TxtBox.ClientID + "','" + GridViewCodigosId + "');");

 

 

}

 

}

Andrés David Santacoloma Isaza
Top achievements
Rank 1
 asked on 14 Apr 2011
1 answer
104 views
         When i insert a new checkbox or radio button, its attributes are not are not displayed while using chrome and firefox, but in IE its working good..!!!!!
 
Rumen
Telerik team
 answered on 14 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?