Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
262 views
Hi,

I'm using the ListView/DataList example to make an image gallery.
Most of the time I want to show the image gallery to the user, but sometimes I want to show the default grid columns to the user. 
Is it possible to hide the ItemTemplate at run-time and show the default columns from the Grid?

Thanks,
Danny
Yavor
Telerik team
 answered on 03 Nov 2009
16 answers
449 views

Hello,

I have two RadListBox controls. One holds selected items, the other holds the source list of items. Users can select items by transferring them from the source to selected RadListBox. The source list box can be filtered on the fly and I have implemented a web service that gets a new source list. The following JavaScript function is called upon successful completion of the web service call. The data parameter is of type RadComboBoxData which holds the needed return data nicely. There is no equivalent RadListBoxData that I could find.

The issue I'm having is sometimes this function gets an error "f.getItem(this) is undefined". This does not happen that often but often enough. I'm still trying to figure out how to reliably reproduce the error. What I can say for sure is that sometimes when the below function is called to refresh the source list box this error happens and then nothing can be transferred between the two RadListBox controls.  

    function fillMultiSelect(data) {
        var listBoxSelected = $find('<listBoxSelected ID>');
        var itemsSelected = listBoxSelected.get_items();

        var listBox = $find('<listBoxSource ID>');
        var itemsSource = listBox.get_items();
        itemsSource.clear();
               
        for (var i = 0; i < data.NumberOfItems; i++) {
            if (!data.Items[i]) break;
            var item = new Telerik.Web.UI.RadListBoxItem();
            item.set_text(data.Items[i].Text);
            item.set_value(data.Items[i].Value);

            var found = false; // don't add items already selected
            itemsSelected.forEach(function(itemS) { if (itemS.get_text() == item.get_text()) found = true; });
            if (!found) itemsSource.add(item);
           
        }
    }

Your help would be appreciated.

Shinu
Top achievements
Rank 2
 answered on 03 Nov 2009
1 answer
187 views
following is my code :
ASPX:-

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="frmROEntryNew.aspx.cs" Inherits="frmROEntryNew" Title="RO Entry" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script language="javascript" type="text/javascript">
                function msg(strvar)
                {
                    alert(strvar);
                }
        </script>
    </telerik:RadCodeBlock>

    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Office2007" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gvROEdit">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvROEdit" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" HorizontalAlign="Center" Skin="Office2007">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="99%" HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" Width="100%">
    <telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="Office2007" Width="100%" BackColor="#D6E6F4">
        <Items>
            <telerik:RadToolBarButton runat="server" ImageUrl="~/Images/AddRecord.gif" Text="New" Value="1">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" IsSeparator="True" Text="Button 1" Value="3">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" ImageUrl="~/Images/save.gif" Text="Save" Value="2">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" IsSeparator="True" Text="Button 5">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" ImageUrl="~/Images/Delete.gif" Text="Delete" Value="3">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" IsSeparator="True" Text="Button 2" Value="4">
            </telerik:RadToolBarButton>
        </Items>
    </telerik:RadToolBar>
    <br />
    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
        <tr>
            <td style="font-size:9px;" colspan="6"> &nbsp;
            </td>
        </tr>
        <tr>
            <td style="width:10%;">
            </td>
            <td class="LabelTdRightAlign" style="width:15%;">
                DD Ref No :
            </td>
            <td class="LabelTdLeftAlign" colspan="3" >
                <telerik:RadComboBox ID="ddlOurRefNo" runat="server" Skin="Outlook" Width="100%"
                    AutoPostBack="True" MarkFirstMatch="True" DataTextField="nCounter" DataValueField="nCounter"
                    HighlightTemplatedItems="True" EmptyMessage="- Select -" >
                </telerik:RadComboBox>
            </td>
            <td style="width:15%;">
            </td>
        </tr>
        <tr>
            <td style="font-size:5px;" colspan="6"> &nbsp;
            </td>
        </tr>
        <tr>
            <td style="width:10%;">
            </td>
            <td class="LabelTdRightAlign" style="width: 15%;">
                RO No :
            </td>
            <td class="LabelTdLeftAlign" style="width: 25%; text-align: left; ">
                <asp:TextBox ID="txtRONo" runat="server"></asp:TextBox></td>
            <td class="LabelTdRightAlign" style="width: 10%; ">
                RO Date :
            </td>
            <td style="width: 25%; text-align: left;">
                <telerik:RadDatePicker ID="txtRODate" runat="server" Culture="English (United Kingdom)"
                    Skin="Office2007" >
                    <Calendar ID="Calendar1" runat="server" Skin="Office2007" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                        ViewSelectorText="x" FirstDayOfWeek="Sunday">
                    </Calendar>
                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                    <DateInput ID="DateInput1" runat="server" AutoPostBack="True">
                    </DateInput>
                </telerik:RadDatePicker>
            </td>
            <td style="width:15%;">
            </td>
        </tr>
        <tr>
            <td style="font-size:5px;" colspan="6"> &nbsp;
            </td>
        </tr>
        <tr>
            <td style="width:10%;">
            </td>
            <td class="LabelTdRightAlign" style="width:15%;">
                Product Name :
            </td>
            <td class="LabelTdLeftAlign" colspan="3" >
                <asp:TextBox ID="txtProductName" runat="server" Width="99%">Type Here </asp:TextBox>
            </td>
            <td style="width:15%;">
            </td>
        </tr>
        <tr>
            <td style="font-size:5px;" colspan="6"> &nbsp;
            </td>
        </tr>
        <tr>
            <td style="width:10%;">
            </td>
            <td class="LabelTdRightAlign" style="width: 15%;">
                Client :
            </td>
            <td class="LabelTdLeftAlign" style="width: 25%;">
                <telerik:RadComboBox ID="ddlClient" runat="server" Skin="Outlook" Width="100%"
                    AutoPostBack="True" MarkFirstMatch="True" DataTextField="vClientName" DataValueField="vClientId"
                    HighlightTemplatedItems="True" EmptyMessage="- Select -" OnSelectedIndexChanged="ddlClient_SelectedIndexChanged" >
                </telerik:RadComboBox>
            </td>
            <td class="LabelTdRightAlign" style="width: 10%;">
                Agency :
            </td>
            <td class="LabelTdLeftAlign" style="width: 25%;">
                <telerik:RadComboBox ID="ddlAgency" runat="server" Skin="Outlook" Width="100%"
                    AutoPostBack="True" MarkFirstMatch="True" DataTextField="vAgencyName" DataValueField="vAgencyId"
                    HighlightTemplatedItems="True" EmptyMessage="- Select -">
                </telerik:RadComboBox>
            </td>
            <td style="width:15%;">
            </td>
        </tr>
        <tr>
            <td style="font-size:5px;" colspan="6"> &nbsp;
            </td>
        </tr>
        <tr>
            <td class="LabelTdRightAlign" colspan="3">
                Channel :
            </td>
            <td class="LabelTdLeftAlign" colspan="3">
                <telerik:RadComboBox ID="ddlChannel" runat="server" Skin="Outlook"
                    AutoPostBack="True" MarkFirstMatch="True" DataTextField="vChannelName" DataValueField="vChannelId"
                    HighlightTemplatedItems="True" EmptyMessage="- Select -" >
                </telerik:RadComboBox>
            </td>
            <td style="width:15%;">
            </td>
        </tr>
        <tr>
            <td style="font-size:5px;" colspan="6"> &nbsp;
            </td>
        </tr>
        <tr>
            <td class="LabelTdCenterAlign" colspan="6" style="font:Arial; font-size:large; font-weight:bold">
                RO Details
            </td>
        </tr>
        <tr>
            <td style="font-size:5px;" colspan="6"> &nbsp;
            </td>
        </tr>
        <tr>
            <td style="width:100%;" align="left" colspan="6">
                <telerik:RadGrid ID="gvRODetail" runat="server" AllowPaging="True"
                    AllowSorting="True" AutoGenerateColumns="False" GridLines="None" ShowFooter="True"
                    ShowGroupPanel="True" ShowStatusBar="True" Skin="Outlook" OnNeedDataSource="gvRODetail_NeedDataSource" OnItemDataBound="gvRODetail_ItemDataBound"
                    AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowAutomaticDeletes="false"
                    OnInsertCommand ="gvRoDetail_ItemInsert" OnUpdateCommand="gvRoDetail_ItemUpdated" >
                    <MasterTableView Name="tblROMasterView" CommandItemDisplay="TopAndBottom" DataKeyNames="nRowNo,nCounter">
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                            </telerik:GridEditCommandColumn>
                            <telerik:GridTemplateColumn DataField="nRowNo" UniqueName="TColnRowNo" Groupable="False" AllowFiltering="False" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lblRowNo" runat="server" Text='<%# Bind("nRowNo") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="0%" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="0%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="nCounter" UniqueName="TColnCounter" Groupable="False" AllowFiltering="False" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lblCounter" runat="server" Text='<%# Bind("nCounter") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"  Width="0%"  />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="0%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Program Name" DataField="vProgramName" SortExpression="vProgramName" UniqueName="TColvProgramName" Groupable="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblProgramName" runat="server" Text='<%# Bind("vProgramName") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="14%" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="14%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Telecast Date" DataField="dtTelecastDate" SortExpression="dtTelecastDate" AllowFiltering="False" UniqueName="TcolDtTelecastDate" Groupable="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblTelecastDate" runat="server" Text='<%# Bind("dtTelecastDate") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="8%" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="8%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Category" DataField="vCategoryId" UniqueName="TcolvCategory" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lblCategory" runat="server" Text='<%# Bind("vCategoryId") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="0%" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="0%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Status" DataField="vStatus" UniqueName="TcolvStatus" >
                                <ItemTemplate>
                                    <asp:Label ID="lblStatus" runat="server" Text='<%# Bind("vStatus") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="10%" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="10%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Product Name" DataField="vProductName" SortExpression="vProductName" UniqueName="TcolvProductName"  Groupable="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblProductNameDt" runat="server" Text='<%# Bind("vProductName") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="17%" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="17%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Caption" DataField="vCaption" UniqueName="TColvCaption" AllowFiltering="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblCaption" runat="server" Text='<%# Bind("vCaption") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="16%" />
                                <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="16%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Rate" DataField="nRate" UniqueName="TcolnRate" AllowFiltering="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblRate" runat="server" Text='<%# Bind("nRate") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="7%" />
                                <HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="7%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="FCT" DataField="nFCT" UniqueName="TcolnFCT" AllowFiltering="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblFCT" runat="server" Text='<%# Bind("nFCT") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="7%" />
                                <HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="7%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Duration" DataField="nDuration" UniqueName="TcolnDuration" AllowFiltering="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblDuration" runat="server" Text='<%# Bind("nDuration") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="7%" />
                                <HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="7%" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Amount" DataField="nAmount" UniqueName="TcolnAmount" AllowFiltering="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblAmount" runat="server" Text='<%# Bind("nAmount") %>' />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" VerticalAlign="Top" Width="7%" />
                                <HeaderStyle HorizontalAlign="Right" VerticalAlign="Middle" Width="7%" />
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <table id="tblHtmlEditRo" style="width: 100%" cellspacing="1" cellpadding="2" border="0">
                                    <tr>
                                        <td colspan="4" class="LabelTdRightAlign" > &nbsp;<asp:TextBox ID="txtCounter" runat="server" Visible="false" Text ="0" />
                                            <asp:TextBox ID="txtRowNo" runat="server" Visible="false" Text = "0" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="LabelTdRightAlign" style="width:15%">
                                            Program Status : </td>
                                        <td  class="LabelTdLeftAlign"  style="width: 30%">
                                            <telerik:RadComboBox ID="ddlStatus" runat="server" Skin="Outlook"
                                                AutoPostBack="True" MarkFirstMatch="True" Width="90%" OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged"
                                                HighlightTemplatedItems="True">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" Text="Sponsorship" Value="Sponsorship" Selected="true" />
                                                    <telerik:RadComboBoxItem runat="server" Text="Banking" Value="Banking" />
                                                    <telerik:RadComboBoxItem runat="server" Text="Spot" Value="Spot" />
                                                </Items>
                                            </telerik:RadComboBox>
                                         </td>
                                        <td id="HtmlColPrgName" class="LabelTdRightAlign" style="width:15%">
                                            Program Name : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 30%">
                                            <telerik:RadComboBox ID="ddlProgram" runat="server" Skin="Outlook" Width="90%"
                                                AutoPostBack="True" MarkFirstMatch="True" DataTextField="vProgramName" DataValueField="vProgramId"
                                                HighlightTemplatedItems="True" EmptyMessage="- Select -" OnSelectedIndexChanged="ddlProgram_SelectedIndexChanged">
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="LabelTdRightAlign" style="width:15%">
                                            Category : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 30%">
                                            <telerik:RadComboBox ID="ddlCategory" runat="server" Skin="Outlook" Width="100%" Enabled="false"
                                                AutoPostBack="True" MarkFirstMatch="True" DataTextField="vCategoryName" DataValueField="vCategoryId"
                                                HighlightTemplatedItems="True" EmptyMessage="- Select -">
                                            </telerik:RadComboBox>
                                         </td>
                                        <td class="LabelTdRightAlign" style="width: 10%">
                                            Telecast Date : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 45%">
                                            <telerik:RadDatePicker ID="txtTelecastDateDt" runat="server" Culture="English (United Kingdom)"
                                                Skin="Office2007" OnSelectedDateChanged="txtTelecastDateDt_SelectedDateChanged" AutoPostBack="True">
                                                <Calendar ID="Calendar1" runat="server" Skin="Office2007" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                                    ViewSelectorText="x" FirstDayOfWeek="Sunday">
                                                </Calendar>
                                                <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                <DateInput ID="DateInput2" runat="server" AutoPostBack="True">
                                                </DateInput>
                                            </telerik:RadDatePicker>
                                        </td>                
                                    </tr>
                                    <tr>
                                        <td class="LabelTdRightAlign" style="width:15%">
                                            Product Name : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 30%">
                                            <asp:TextBox ID="txtProductNameDt" runat="server" Width="100%"></asp:TextBox></td>
                                        <td class="LabelTdRightAlign" style="width: 10%">
                                            Caption : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 45%">
                                            <asp:TextBox ID="txtCaption" runat="server" Width="90%"></asp:TextBox>
                                        </td>                
                                    </tr>
                                    <tr>
                                        <td class="LabelTdRightAlign" style="width:15%">
                                            Rate : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 30%">
                                            <asp:TextBox ID="txtRate" runat="server" Text="0" Enabled="false"></asp:TextBox></td>
                                        <td class="LabelTdRightAlign" style="width: 10%">
                                            FCT : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 45%">
                                            <asp:TextBox ID="txtFCT" runat="server" Text="0" Enabled="false"></asp:TextBox>
                                        </td>                
                                    </tr>
                                    <tr>
                                        <td class="LabelTdRightAlign" colspan="2">
                                            Progressive Balance : </td>
                                        <td  class="LabelTdLeftAlign"  colspan="2">
                                            <asp:TextBox ID="txtProgressiveBalance" runat="server" Text="0"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="LabelTdRightAlign" style="width:15%">
                                            Duration (In Secs) : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 30%">
                                            <asp:TextBox ID="txtDuration" runat="server" AutoPostBack="true" OnTextChanged="txtDuration_TextChanged"></asp:TextBox></td>
                                        <td class="LabelTdRightAlign" style="width: 10%">
                                            Amount : </td>
                                        <td  class="LabelTdLeftAlign" style="width: 45%">
                                            <asp:TextBox ID="txtAmount" runat="server" Enabled="false"></asp:TextBox>
                                        </td>                
                                    </tr>
                                    <tr>
                                        <td class="LabelTdLeftAlign" style="width: 100%" colspan="4">
                                            <asp:Button ID="btnSave" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Save" : "Update" %>' CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                                            <asp:Button ID="btnCancel" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel" />
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="True">
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
                    </ClientSettings>
                </telerik:RadGrid></td>
        </tr>
        <tr>
            <td colspan="6">
            </td>
        </tr>
    </table>
    </telerik:RadAjaxPanel>
</asp:Content>

.CS:-
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using Telerik.Web.UI;

public partial class frmROEntryNew : System.Web.UI.Page
{
    clsFunctionLib objFunLib;
    string strSql, strMsg;
    SqlDataReader objRdr;
    string strArg1, strArg2, strRtnCounter;
    DataTable objDT;

    protected void Page_Load(object sender, EventArgs e)
    {
        objFunLib = new clsFunctionLib();
        objFunLib.ExpirePageCache();

        if (!IsPostBack)
        {
            txtRONo.Text = "";
            txtRODate.SelectedDate = null;
            txtProductName.Text = "";

            ddlClient.Items.Clear();
            strSql = "select vClientId, vClientName from tblClient";
            objFunLib.BindTelerikDropDown(strSql, ref ddlClient);

            ddlChannel.Items.Clear();
            strSql = "select vChannelId, vChannelName from tblChannel order by vChannelName";
            objFunLib.BindTelerikDropDown(strSql, ref ddlChannel);

            ddlOurRefNo.Items.Clear();
            strSql = "Select nCounter from tblROMaster order by nCounter Desc";
            objFunLib.BindTelerikDropDown(strSql, ref ddlOurRefNo);

            ddlOurRefNo.SelectedIndex = 0;
            ddlClient.SelectedIndex = 0;
            ddlAgency.SelectedIndex = 0;
        }
    }

    protected void ddlClient_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        ddlAgency.Items.Clear();
        strSql = "select vAgencyId, vAgencyName from tblAgency where vAgencyId in (select vAgencyId from tblClient where vClientId = '" + ddlClient.SelectedValue + "') order by vAgencyName";
        objFunLib.BindTelerikDropDown(strSql, ref ddlAgency);
        if (ddlAgency.Items.Count > 0)
        {
            ddlAgency.SelectedIndex = 1;
        }
        else
        {
            ddlAgency.SelectedIndex = 0;
        }
        ddlChannel.SelectedIndex = 0;
    }
    protected void gvRODetail_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        if (ddlOurRefNo.SelectedValue == "")
        {
            strSql = "select nRowNo, nCounter, vProgramName, convert(varchar(10),dtTelecastDate,103) as dtTelecastDate, vStatus, vProductName, vCaption, nRate, nFCT, nDuration, nAmount from tblRODetail, tblProgram where tblRODetail.vProgramId = tblProgram.vProgramId and nCounter = 0";
        }
        else
        {
            strSql = "select nRowNo, nCounter, vProgramName, convert(varchar(10),dtTelecastDate,103) as dtTelecastDate, vStatus, vProductName, vCaption, nRate, nFCT, nDuration, nAmount from tblRODetail, tblProgram where tblRODetail.vProgramId = tblProgram.vProgramId and nCounter = '" + ddlOurRefNo.SelectedValue + "'";
        }
        gvRODetail.DataSource = objFunLib.ReturnDataTable(strSql, "tblRODtl");

    }

    protected void gvRODetail_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if ((e.Item is GridEditFormInsertItem) && (e.Item.OwnerTableView.IsItemInserted))
        {
            GridEditFormInsertItem editItem = (GridEditFormInsertItem)(e.Item);
            RadComboBox ddlProgram = (RadComboBox)editItem.FindControl("ddlProgram");
            RadComboBox ddlCategory = (RadComboBox)editItem.FindControl("ddlCategory");
            ddlProgram.Items.Clear();
            strSql = "select vProgramId, vProgramName from tblProgram where vProgramId in (select vProgramId from tblRateDetail where vChannelId = '" + ddlChannel.SelectedValue + "' and vClientId = '" + ddlClient.SelectedValue + "' and vAgencyId = '" + ddlAgency.SelectedValue + "') order by vProgramName";
            objFunLib.BindTelerikDropDown(strSql, ref ddlProgram);
            ddlProgram.SelectedIndex = 0;

            ddlCategory.Items.Clear();
            strSql = "select vCategoryId, vCategoryName from tblCategory order by vCategoryName";
            objFunLib.BindTelerikDropDown(strSql, ref ddlCategory);

        }
    }

    protected void ddlProgram_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadComboBox combo = (RadComboBox)o;
        GridEditFormInsertItem editItem = (GridEditFormInsertItem)(combo.NamingContainer);
        TextBox txtRate = (TextBox)editItem.FindControl("txtRate");
        TextBox txtFCT = (TextBox)editItem.FindControl("txtFCT");
        TextBox txtAmount = (TextBox)editItem.FindControl("txtAmount");
        TextBox txtCounter = (TextBox) editItem.FindControl("txtCounter");
        TextBox txtRowNo = (TextBox) editItem.FindControl("txtRowNo");
        TextBox txtProgressiveBalance = (TextBox)editItem.FindControl("txtProgressiveBalance");
        RadComboBox ddlCategory = (RadComboBox)editItem.FindControl("ddlCategory");
        RadComboBox ddlStatus = (RadComboBox)editItem.FindControl("ddlStatus");
        if (ddlCategory.SelectedIndex == 0)
        {
            strSql = "select vCategoryId from tblRateDetail where vChannelId = '" + ddlChannel.SelectedValue + "' and vClientId = '" + ddlClient.SelectedValue + "' and vAgencyId = '" + ddlAgency.SelectedValue + "' and vProgramId = '" + e.Value + "'";
            ddlCategory.SelectedIndex = ddlCategory.FindItemIndexByValue(objFunLib.ReturnFieldData(strSql, false));
        }

        if (ddlStatus.SelectedValue.ToUpper() == ("Banking").ToUpper())
        {
            txtRate.Text = "0";
            txtFCT.Text = "0";
            txtAmount.Text = "0";
        }
        else
        {
            txtRate.Text = "0";
            txtFCT.Text = "0";
            txtAmount.Text = "0";
            strSql = "select nAmount from tblRate where vAgencyId = '" + ddlAgency.SelectedValue + "' and vClientId = '" + ddlClient.SelectedValue + "' and vChannelId = '" + ddlChannel.SelectedValue + "' and vCategoryId = '" + ddlCategory.SelectedValue + "' and upper(vStatus) = '" + ddlStatus.SelectedValue.ToUpper() + "'";
            txtRate.Text = objFunLib.ReturnFieldData(strSql, true);
            txtAmount.Text = txtRate.Text;
            strSql = "select nFCT from tblRate where vAgencyId = '" + ddlAgency.SelectedValue + "' and vClientId = '" + ddlClient.SelectedValue + "' and vChannelId = '" + ddlChannel.SelectedValue + "' and vCategoryId = '" + ddlCategory.SelectedValue + "' and upper(vStatus) = '" + ddlStatus.SelectedValue.ToUpper() + "'";
            txtFCT.Text = objFunLib.ReturnFieldData(strSql, true);
        }
        if (ddlStatus.SelectedValue.ToUpper() != ("Spot").ToUpper())
        {
            double dblTotTime, dblUsedTime;
            strSql = "select sum(nFCT) as nFCT from tblRODetail where nCounter in (select nCounter from tblROMaster where vClientId = '" + ddlClient.SelectedValue + "' and vCategoryId = '" + ddlCategory.SelectedValue + "' and vChannelId = '" + ddlChannel.SelectedValue + "') and upper(vStatus) <> 'SPOT'";
            dblTotTime = Convert.ToDouble(objFunLib.ReturnFieldData(strSql, true));
            strSql = "select sum(nDuration) as nDuration from tblRODetail where nCounter in (select nCounter from tblROMaster where vClientId = '" + ddlClient.SelectedValue + "' and vCategoryId = '" + ddlCategory.SelectedValue + "' and vChannelId = '" + ddlChannel.SelectedValue + "') and upper(vStatus) <> 'SPOT'";
            dblUsedTime = Convert.ToDouble(objFunLib.ReturnFieldData(strSql, true));
            if (txtCounter.Text.Equals("0"))
            {
                txtProgressiveBalance.Text = Convert.ToString(dblTotTime - dblUsedTime + Convert.ToDouble(txtFCT.Text));
            }
            else
            {
                txtProgressiveBalance.Text = Convert.ToString(dblTotTime - dblUsedTime);
            }

        }


    }

    protected void txtTelecastDateDt_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
    {
        RadDatePicker txtTelecastDate = (RadDatePicker)sender;
        GridEditFormInsertItem editItem = (GridEditFormInsertItem)(txtTelecastDate.NamingContainer);
        RadComboBox ddlProgram = (RadComboBox)editItem.FindControl("ddlProgram");
        string strTimeOfTelecast;
        int intDOW;
        if (string.IsNullOrEmpty(e.NewDate.ToString()))
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "msg('Invalid Telecast Date');", true);
            txtTelecastDate.SelectedDate = null;
//            RadToolBarRODetail.Items[0].Enabled = false;
        }
        else
        {
            intDOW = objFunLib.FindDOW(objFunLib.DMYToYMD(e.NewDate.ToString()));
            strSql = "select vTimeOfTelecast from tblProgramTelecastDetail where vChannelId = '" + ddlChannel.SelectedValue + "' and vProgramId = '" + ddlProgram.SelectedValue + "' and intDayOfWeek = '" + intDOW + "'";
            strTimeOfTelecast = objFunLib.ReturnFieldData(strSql, false);
            if (string.IsNullOrEmpty(strTimeOfTelecast))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "msg('Invalid Telecast Date');", true);
                txtTelecastDate.SelectedDate = null;
//                RadToolBarRODetail.Items[0].Enabled = false;
            }
            else
            {
//                RadToolBarRODetail.Items[0].Enabled = true;
            }
        }
    }

    protected void ddlStatus_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadComboBox combo = (RadComboBox)o;
        GridEditFormInsertItem editItem = (GridEditFormInsertItem)(combo.NamingContainer);
        TextBox txtRate = (TextBox)editItem.FindControl("txtRate");
        TextBox txtFCT = (TextBox)editItem.FindControl("txtFCT");
        TextBox txtAmount = (TextBox)editItem.FindControl("txtAmount");
        RadComboBox ddlCategory = (RadComboBox)editItem.FindControl("ddlCategory");
        if (combo.SelectedValue.ToUpper() == ("Banking").ToUpper())
        {
            txtRate.Text = "0";
            txtFCT.Text = "0";
            txtAmount.Text = "0";
        }
        else
        {
            txtRate.Text = "0";
            txtFCT.Text = "0";
            txtAmount.Text = "0";
            strSql = "select nAmount from tblRate where vAgencyId = '" + ddlAgency.SelectedValue + "' and vClientId = '" + ddlClient.SelectedValue + "' and vChannelId = '" + ddlChannel.SelectedValue + "' and vCategoryId = '" + ddlCategory.SelectedValue + "' and upper(vStatus) = '" + combo.SelectedValue.ToUpper() + "'";
            txtRate.Text = objFunLib.ReturnFieldData(strSql, true);
            strSql = "select nFCT from tblRate where vAgencyId = '" + ddlAgency.SelectedValue + "' and vClientId = '" + ddlClient.SelectedValue + "' and vChannelId = '" + ddlChannel.SelectedValue + "' and vCategoryId = '" + ddlCategory.SelectedValue + "' and upper(vStatus) = '" + combo.SelectedValue.ToUpper() + "'";
            txtFCT.Text = objFunLib.ReturnFieldData(strSql, true);
            txtAmount.Text = txtRate.Text;
        }
    }

    protected void txtDuration_TextChanged(object sender, EventArgs e)
    {
        TextBox txtDuration = (TextBox)sender;
        GridEditFormInsertItem editItem = (GridEditFormInsertItem)(txtDuration.NamingContainer);
        RadComboBox ddlProgram = (RadComboBox)editItem.FindControl("ddlProgram");
        RadComboBox ddlCategory = (RadComboBox)editItem.FindControl("ddlCategory");
        RadComboBox ddlStatus = (RadComboBox)editItem.FindControl("ddlStatus");
        TextBox txtRate = (TextBox)editItem.FindControl("txtRate");
        TextBox txtFCT = (TextBox)editItem.FindControl("txtFCT");
        TextBox txtAmount = (TextBox)editItem.FindControl("txtAmount");

        if (ddlStatus.SelectedValue.ToUpper() == ("Spot").ToUpper())
        {
            txtAmount.Text = Convert.ToString(Convert.ToDecimal(txtDuration.Text) * Convert.ToDecimal(txtRate.Text) / Convert.ToDecimal(txtFCT.Text));
        }
        else if (ddlStatus.SelectedValue.ToUpper() == ("Banking").ToUpper())
        {
            txtAmount.Text = "0";
        }
        else
        {
            txtAmount.Text = txtRate.Text;
        }
    }

    protected void gvRoDetail_ItemInsert(object sender, GridCommandEventArgs e)
    {
        if ((e.Item is GridEditFormInsertItem) && (e.Item.OwnerTableView.IsItemInserted))
        {
            TextBox txtCounter = (TextBox)e.Item.FindControl("txtCounter");
            TextBox txtRowNo = (TextBox)e.Item.FindControl("txtRowNo");
            RadComboBox ddlProgram = (RadComboBox)e.Item.FindControl("ddlProgram");
            RadComboBox ddlCategory = (RadComboBox)e.Item.FindControl("ddlCategory");
            RadComboBox ddlStatus = (RadComboBox)e.Item.FindControl("ddlStatus");
            RadDatePicker txtTelecastDateDt = (RadDatePicker)e.Item.FindControl("txtTelecastDateDT");
            TextBox txtProductNameDt = (TextBox)e.Item.FindControl("txtProductNameDt");
            TextBox txtCaption = (TextBox)e.Item.FindControl("txtCaption");
            TextBox txtRate = (TextBox)e.Item.FindControl("txtRate");
            TextBox txtFCT = (TextBox)e.Item.FindControl("txtFCT");
            TextBox txtDuration = (TextBox)e.Item.FindControl("txtDuration");
            TextBox txtAmount = (TextBox)e.Item.FindControl("txtAmount");
            if (ddlOurRefNo.SelectedIndex == 0)
            {
                txtCounter.Text = "0";
            }
            else
            {
                txtCounter.Text = ddlOurRefNo.SelectedValue;
            }
            string strTimeOfTelecast;
            int intDOW;
            intDOW = objFunLib.FindDOW(objFunLib.DMYToYMD(txtTelecastDateDt.SelectedDate.ToString()));
            strSql = "select vTimeOfTelecast from tblProgramTelecastDetail where vChannelId = '" + ddlChannel.SelectedValue + "' and vProgramId = '" + ddlProgram.SelectedValue + "' and intDayOfWeek = '" + intDOW + "'";
            strTimeOfTelecast = objFunLib.ReturnFieldData(strSql, false);
            if (string.IsNullOrEmpty(strTimeOfTelecast))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "msg('Invalid Telecast Date... unable to save data');", true);
            }
            else
            {
                try
                {
                    objFunLib.NewSpParameterTable();

                    objFunLib.AddSpParameter("numeric", "@nCounter", 18, Convert.ToDecimal(txtCounter.Text));
                    objFunLib.AddSpParameter("numeric", "@nRowNo", 18, Convert.ToDecimal(txtRowNo.Text));
                    objFunLib.AddSpParameter("varchar", "@vROId", 10, txtRONo.Text);
                    objFunLib.AddSpParameter("varchar", "@vProductName", 75, txtProductName.Text);
                    objFunLib.AddSpParameter("varchar", "@vClientId", 10, ddlClient.SelectedValue);
                    objFunLib.AddSpParameter("varchar", "@vAgencyId", 10, ddlAgency.SelectedValue);
                    objFunLib.AddSpParameter("varchar", "@vChannelId", 10, ddlChannel.SelectedValue);
                    objFunLib.AddSpParameter("varchar", "@vProgramId", 10, ddlProgram.SelectedValue);
                    objFunLib.AddSpParameter("varchar", "@vCategoryId", 10, ddlCategory.SelectedValue);
                    //objFunLib.AddSpParameter("varchar", "@vBookingId", 15, ddlStatus.SelectedValue);
                    if (txtRODate.SelectedDate.ToString() == "")
                    {
                        objFunLib.AddSpParameter("date", "@dtRODate", 0, "01/01/1900");
                    }
                    else
                    {
                        objFunLib.AddSpParameter("date", "@dtRODate", 0, txtRODate.SelectedDate.ToString());
                    }
                    //if (txtTelecastDateDt.SelectedDate.ToString() == "")
                    //{
                    //    objFunLib.AddSpParameter("date", "@dtTelecastDate", 0, "01/01/1900");
                    //}
                    //else
                    //{
                    //    objFunLib.AddSpParameter("date", "@dtTelecastDate", 0, txtTelecastDateDt.SelectedDate.ToString());
                    //}
                    objFunLib.AddSpParameter("varchar", "@vProgramIdDtl", 10, ddlProgram.SelectedValue.ToString());
                    if (txtTelecastDateDt.SelectedDate.ToString() == "")
                    {
                        objFunLib.AddSpParameter("date", "@dtTelecastDateDtl", 0, "01/01/1900");
                    }
                    else
                    {
                        objFunLib.AddSpParameter("date", "@dtTelecastDateDtl", 0, objFunLib.DMYToYMD(txtTelecastDateDt.SelectedDate.ToString()));
                    }
                    objFunLib.AddSpParameter("varchar", "@vProductDtl", 75, txtProductNameDt.Text.Trim());
                    objFunLib.AddSpParameter("varchar", "@vCaptionDtl", 1000, txtCaption.Text.Trim());
                    objFunLib.AddSpParameter("numeric", "@nRateDtl", 18, Convert.ToDecimal(txtRate.Text));
                    objFunLib.AddSpParameter("numeric", "@nFCTDtl", 18, Convert.ToDecimal(txtFCT.Text));
                    objFunLib.AddSpParameter("numeric", "@nDuration", 18, Convert.ToDecimal(txtDuration.Text));
                    objFunLib.AddSpParameter("numeric", "@nAmount", 18, Convert.ToDecimal(txtAmount.Text));
                    objFunLib.AddSpParameter("varchar", "@vStatusDtl", 15, ddlStatus.SelectedValue);


                    short sintResult = Convert.ToInt16(objFunLib.SaveAndReturnData("spSaveRO", ref strRtnCounter));
                    txtCounter.Text = strRtnCounter;

                    ddlProgram.SelectedIndex = 0;
                    txtTelecastDateDt.SelectedDate = null;
                    ddlStatus.SelectedIndex = 0;
                    ddlCategory.SelectedIndex = 0;
                    //txtProgressiveBalance.Text = "";
                    txtProductName.Text = "";
                    txtCaption.Text = "";
                    txtRate.Text = "0";
                    txtFCT.Text = "0";
                    txtAmount.Text = "0";
                    txtDuration.Text = "0";

                    if (sintResult == 1)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "msg('RO saved successfully... Ref No : " + txtCounter.Text + "' );", true);
                    }
                    else if (sintResult == 2)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "msg('RO Updated Successfully');", true);
                    }


                }
                catch (Exception ex)
                {
                    strMsg = ex.Message.ToString();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "msg('" + strMsg + "');", true);
                }

            }
        }
        gvRODetail.Rebind();
        gvRODetail.MasterTableView.Rebind();

    }

    protected void gvRoDetail_ItemUpdated(object sender, GridCommandEventArgs e)
    {
        gvRODetail.Rebind();
        gvRODetail.MasterTableView.Rebind();
    }

}

In the above page after clicking on Add new record in grid header a blank edit template is opened. After feeding in the information  gvRoDetail_ItemInsert event is not fired on first click of save button. If the save button is clicked on again then the data is saved in the table.

Where am I going wrong ?

- Milind Shevade
Yavor
Telerik team
 answered on 03 Nov 2009
6 answers
253 views
My radGrid is placed inside an RadAjaxUpdatePanel which points to the LoadingPanel.  When the page loads and I click an edit button on the grid (add/delete/edit) the whole page refreshes with a full post back.  But subsequent clicks on grid edit buttons cause Ajax behavior as expected.  What is causing this first full postback?

The grid/updatepanel is inside a formview control which is inside a wizard step.  The Formview is set to default to editmode and I only have the FormView.EditItemTemplate configured.

Thanks

Sean

asp below

<asp:Wizard ID="InvestigatorWiz" runat="server" ActiveStepIndex="0" Height="100%" 
        Width="100%" BackColor="Beige" BorderColor="Brown" BorderStyle="Solid" BorderWidth="1px" 
        Font-Names="Verdana" Font-Size="X-Small" DisplaySideBar="False" HeaderText="Investigator Summary" 
        NavigationButtonStyle-CssClass="button" FinishDestinationPageUrl="View_Company.aspx" 
        CancelDestinationPageUrl="View_Company.aspx" OnNextButtonClick="InvestigatorWiz_NextButtonClick"
        <WizardSteps> 
            <asp:WizardStep ID="EditInvestigator" runat="server" StepType="Start" Title="Investigator"
                <asp:FormView ID="MVInvestigator" DataKeyNames="InvestigatorID" runat="server" DataSourceID="CslaDataSourceInvestigator" 
                    DefaultMode="Edit" OnItemUpdated="MVInvestigator_ItemUpdated" OnItemUpdating="MVInvestigator_ItemUpdating"
                    <EditItemTemplate> 
                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" /> 
                        <table style="vertical-align: top; font: 10pt verdana; width: 100%;" bordercolor="brown"
                            <tr> 
                                <td colspan="2" style="height: 10px; width: 100%; border-bottom: tan thin solid; 
                                    font-weight: bold;"> 
                                    <h5> 
                                        <font color="black">Enter Investigator Information:</font></h5
                                    <h6> 
                                        <font color="black"><b>Please enter the Investigator name (First, Middle, and Last) 
                                            and credentials as you wish it to appear on all approval documents. (For example 
                                            - Dave S. Smith M.D., PhD, F.A.C.C or Sally Sue Smith M.D., MBA). </b></font
                                    </h6> 
                                    <br /> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td colspan="2"
                                    Medical Licenses: 
                                </td> 
                            </tr> 
                            <tr> 
                                <td colspan="2"
                                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="250px" Width="100%" LoadingPanelID="RadAjaxLoadingPanel2"
                                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" OnItemUpdated="RadGrid1_ItemUpdated" 
                                            OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" AllowAutomaticDeletes="True" 
                                            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" DataSourceID="CslaDataSourceInvestigatorMEDLicense" 
                                            GridLines="None" Width="100%"
                                            <MasterTableView AutoGenerateColumns="False" DataKeyNames="InvestigatorMEDLicenseID" 
                                                DataSourceID="CslaDataSourceInvestigatorMEDLicense" EditMode="InPlace" CommandItemDisplay="Bottom" 
                                                InsertItemDisplay="Bottom" CommandItemSettings-AddNewRecordText="Add new license"
                                                <RowIndicatorColumn> 
                                                    <HeaderStyle Width="20px" /> 
                                                </RowIndicatorColumn> 
                                                <ExpandCollapseColumn> 
                                                    <HeaderStyle Width="20px" /> 
                                                </ExpandCollapseColumn> 
                                                <Columns> 
                                                    <telerik:GridTemplateColumn HeaderText="State" SortExpression="MEDLicenseState" UniqueName="MEDLicenseState"
                                                        <ItemTemplate> 
                                                            <asp:Label runat="server" ID="lblUnitPrice" Text='<%# Bind("MEDLicenseState") %>'></asp:Label> 
                                                        </ItemTemplate> 
                                                        <EditItemTemplate> 
                                                            <telerik:RadComboBox ID="cboState" runat="server" DataSourceID="XmlStates1" DataTextField="name" 
                                                                DataValueField="abbreviation" SelectedValue='<%# Bind("MEDLicenseState") %>'
                                                            </telerik:RadComboBox> 
                                                            <br /> 
                                                            <asp:RequiredFieldValidator InitialValue="Enter a State" ID="RequiredFieldValidator1" 
                                                                ControlToValidate="cboState" ErrorMessage="This field is required" runat="server"
                                                            </asp:RequiredFieldValidator> 
                                                        </EditItemTemplate> 
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridTemplateColumn HeaderText="License #" SortExpression="MEDLicenseNumber" 
                                                        UniqueName="MEDLicenseNumber"
                                                        <ItemTemplate> 
                                                            <asp:Label runat="server" ID="lblMEDLicenseNumber" Text='<%# Bind("MEDLicenseNumber") %>'></asp:Label> 
                                                        </ItemTemplate> 
                                                        <EditItemTemplate> 
                                                            <telerik:RadTextBox ID="txtMEDLicenseNumber" runat="server" EmptyMessage="Enter License #" 
                                                                Text='<%# Bind("MEDLicenseNumber") %>'
                                                            </telerik:RadTextBox><br /> 
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtMEDLicenseNumber" 
                                                                ErrorMessage="This field is required" runat="server"
                                                            </asp:RequiredFieldValidator> 
                                                        </EditItemTemplate> 
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridTemplateColumn HeaderText="Expires" SortExpression="MEDLicenseEXPDate" 
                                                        UniqueName="MEDLicenseEXPDate"
                                                        <ItemTemplate> 
                                                            <asp:Label runat="server" ID="lblMEDLicenseEXPDate" Text='<%# Bind("MEDLicenseEXPDate") %>'></asp:Label> 
                                                        </ItemTemplate> 
                                                        <EditItemTemplate> 
                                                            <telerik:RadDatePicker AllowEmpty="true" ShowPopupOnFocus="true" DateInput-EmptyMessage="Enter an expiration date" 
                                                                Calendar-RangeMinDate="<%# System.DateTime.Today %>" ID="txtMEDLicenseEXPDate" 
                                                                runat="server" DbSelectedDate='<%# Bind("MEDLicenseEXPDate") %>'
                                                            </telerik:RadDatePicker> 
                                                            <br /> 
                                                            <asp:RequiredFieldValidator ControlToValidate="txtMEDLicenseEXPDate" ID="RequiredFieldValidator3" 
                                                                runat="server" ErrorMessage="This field is required"></asp:RequiredFieldValidator> 
                                                        </EditItemTemplate> 
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                                                    </telerik:GridEditCommandColumn> 
                                                    <telerik:GridButtonColumn ConfirmText="Delete this license?" ConfirmDialogType="RadWindow" 
                                                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                                                        UniqueName="DeleteColumn"
                                                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                                    </telerik:GridButtonColumn> 
                                                </Columns> 
                                            </MasterTableView> 
                                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"
                                                <Selecting AllowRowSelect="True" /> 
                                            </ClientSettings> 
                                        </telerik:RadGrid> 
                                     
                                    </telerik:RadAjaxPanel> 
                                </td> 
                            </tr> 
                        </table> 
                    </EditItemTemplate> 
                </asp:FormView> 
            </asp:WizardStep> 
        </WizardSteps> 
        <StepStyle BorderWidth="0px" ForeColor="#5D7B9D" /> 
        <SideBarStyle BackColor="#7C6F57" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" /> 
        <NavigationButtonStyle CssClass="button" BackColor="#FFFBFF" BorderColor="#CCCCCC" 
            BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" 
            ForeColor="#284775" Width="0px" /> 
        <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="White" /> 
        <HeaderStyle BackColor="Tan" BorderStyle="Solid" Font-Bold="True" Font-Size="Small" 
            ForeColor="White" HorizontalAlign="Center" BorderWidth="1px" VerticalAlign="Middle" /> 
    </asp:Wizard> 

Jeroen de Roos
Top achievements
Rank 1
 answered on 03 Nov 2009
2 answers
119 views
Hello
This is Karthik from bangalore. i have some issues in fire-fox in rad editior. rad editor have one feture called apply css class dropdown tool in tool bar.i bind the css file in server side its working fine IE all the version but fire fox getting problem please check it attached file u will find out the proplem. Please give me the solution for this how to solve this problem.. Here by i pasted my server side Code for your reference..

  RadEditor1.CssFiles.Clear()
        If odb.IsExist("SELECT [StyleSheetID] FROM [" & ClientName & "].[dbo].[Templates] WHERE [TemplateID] = " & TemplateID) Then
            Dim AllCSSFiles As New DataTable
            AllCSSFiles = odb.GetDataTable("SELECT [StyleSheetID] FROM [" & ClientName & "].[dbo].[Templates] WHERE [TemplateID] = " & TemplateID)
            For Each CSSFile As DataRow In AllCSSFiles.Rows
                RadEditor1.CssFiles.Add("http://" & hidStageUrl.Value & "/CSS/css_" & Val(CSSFile("StyleSheetID")) & ".css")
            Next
        End If

Thanks & Regards
Pl.Karthik


Shubod Dev
Top achievements
Rank 1
 answered on 03 Nov 2009
3 answers
153 views
Hi All

Have a radgrid with 3 columns.

There are 25 records.

It woks fine.

The grid height is only 200px;

So only 2 recods can be viewed. scrolling is there.

But while scolling the header (title bar) also scrolls up.

Is there any option to stop this.

Thank You

-Anto

Princy
Top achievements
Rank 2
 answered on 03 Nov 2009
1 answer
98 views
Hi All,
Whatever I do, I cant seem to bind RadToolTipManager with RadPanelBar controls.
I am creating the RadPanelBar controls in the Serverside and binding to the page. That part is working fine. But I need a popup on mouseover to the RadPanelBar.
If I use the RadPanelBar.ToolTip that works fine, but I cant control the length it should stay visible.
Some help in figuring out would be nice.
Thanks
Paul
Telerik team
 answered on 03 Nov 2009
1 answer
164 views
i have this on the front end
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="150px" Height="800px" ExpandMode="FullExpandedItem"   
                        OnItemClick="RadPanelBar1_ItemClick" Skin="Vista">  
                        <Items> 
                            <telerik:RadPanelItem  Value="RadPanelBar_ThumbNail" Text="Pictures" Expanded="true">  
                                <Items> 
                                    <telerik:RadPanelItem Value="ThumbNail_Child" /> 
                                </Items>                              
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelBar> 
and in the server i have
Dim PanelItem As RadPanelItem = DirectCast(RadPanelBar1.Items(0), RadPanelItem)  
            For Each sFile As String In System.IO.Directory.GetFiles(Server.MapPath("images/thumbnail"))  
                Dim sJustFile As String = New System.IO.FileInfo(sFile).Name  
                Dim ChildItem As New RadPanelItem  
                ChildItem.Text = " " 
                ChildItem.ImageUrl = "images/thumbnail/" & sJustFile.ToString  
                ChildItem.Value = Replace(sJustFile.ToString, "-thumb.jpg", "")  
                PanelItem.Items.Add(ChildItem)  
            Next 
this will make my image clickable but if i take out CHILDITEM.TEXT = " " then my items are not clickable anymore. is there any other way to do this? please help thank you very much.
Paul
Telerik team
 answered on 03 Nov 2009
2 answers
101 views
Hi All

I have a radgrid with some 25 records it works fine.

In the right bottom of the grid in the status bar, there is   Displaying page 1 of 2, items 1 to 10 of 12.

Is there any option to customize it, or to remove it,

Because my grid width is just 200px, So I need to cut-short it or remove it.

<telerik:RadGrid Height = "245px" ID = "rgDept" AllowPaging = "true" Skin = "Vista" AllowMultiRowSelection = "false" runat = "server" DataSourceID = "sdsDept" AutoGenerateColumns = "false">  
                    <PagerStyle PagerTextFormat=" "/>    
                        <MasterTableView PagerStyle-Mode = "NextPrevAndNumeric" PageSize = "8" ClientDataKeyNames = "DepartmentCode" AutoGenerateColumns = "false" DataSourceID = "sdsDept" DataKeyNames = "DepartmentCode">  
                            <Columns>  
                                <telerik:GridBoundColumn HeaderText = "Code" Visible = "false" ReadOnly = "true" DataField = "DepartmentCode" UniqueName = "DepartmentCode"></telerik:GridBoundColumn>  
                                <telerik:GridBoundColumn HeaderText = "Department" DataField = "DepartmentName" UniqueName = "DepartmentName"></telerik:GridBoundColumn>  
                            </Columns>  
                        </MasterTableView>  
                        <ClientSettings>  
                        <Selecting AllowRowSelect = "true"/>  
                        </ClientSettings>  
                    </telerik:RadGrid> 


I have aleady posted this one. And I got reply too. But it does't work. And I am not able to reply on that thread, so i have created a new one.

-Anto
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
 answered on 03 Nov 2009
2 answers
71 views
Hi All,

Have a grid with datas and a label with text "WELCOME".

When I select a row in the grid need to change the label to "In THE GRID".

Is there any option like gotfocus to solve this.

Thanking You

-Anto
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
 answered on 03 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?