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

Please could you assist.  My radwindow seems to load the entire page inside the popup (with menu, footer etc) instead of just the controls.  Screenshot and code below.

Any help will be appreciated.

Clientside code: shows popup on image click

var BaseURL = "<%= WindowBaseURL%>";
            function ShowSearchForm() {
                var toolBar = $find("<%=toolbarInstruments.ClientID%>");
                var tbButton = toolBar.findItemByText("exchange");
                var cbo = tbButton.findControl("cboExchange");
                if ('<%=IsMobile%>' == 'True') {
                    var navURL;
                    navURL = BaseURL + "&EX=" + cbo.get_value();
                    //location.href = navURL;
                    window.location.href =  navURL;
                }
                else {
                    //Open the RADWindow
                    var params = document.getElementById('<%=hfParams.ClientID%>').value;
                    var symbolmanager = $find("<%= rwmWatchlist.ClientID %>");
                    var toolBar = $find("<%=toolbarInstruments.ClientID%>");
                    var tbButton = toolBar.findItemByText("exchange");
                    var cbo = tbButton.findControl("cboExchange");
                    var navURL;
                    navurl = BaseURL + '&EX=' + cbo.get_value();
                    symbolmanager.open(navurl , "FindDialog");
                    symbolmanager.SetTitle("Search");
                    return false;
                }
            };

server code: Radwindow declaration
<telerik:RadWindowManager ID="rwmW" runat="server" EnableShadow="true">
        <windows>
            <telerik:RadWindow ID="FindDialog" Title="Instrument Lookup" runat="server" Modal="true"
                ReloadOnShow="True" Overlay="True" KeepInScreenBounds="True" Behaviors="Close,Move,Resize"
                OnClientClose="OnClientClose" ShowContentDuringLoad="false" EnableShadow="false"
                VisibleStatusbar="false" AutoSize="False" VisibleOnPageLoad="False" rendermode="lightweight" width="1042px" EnableEmbeddedSkins="true"/>
        </windows>
    </telerik:RadWindowManager>

Public
ReadOnly Property WindowBaseURL As String
        Get
            If IsMobile Then
                Return String.Format("{0}/mid/{1}?{2}", DotNetNuke.Common.Globals.NavigateURL("Search"), Me.ModuleId, "popUp=false")
            Else
                Return UrlUtils.PopUpUrl(EditUrl("Search"), Me, PortalSettings, False, True)
            End If
        End Get
    End Property

Marin Bratanov
Telerik team
 answered on 21 Jul 2014
1 answer
93 views
Hi,

Is there any way that on the click of button, I get only the modified cell values from the Grid instead of reading the entire grid and sending this huge data across the network to be stored in database.

Thanks
Nisha
Eyup
Telerik team
 answered on 21 Jul 2014
1 answer
162 views
Hi to all,

I would like to use the RadFileExplorer to connect to multiple FTP servers, the goal is to select in a RadDropDownList a previously configured FTP info from a database (FTP Server, Username, UserPassword) and then open the RadFileExplorer in a RadWindow with the selected RadDropDownList  values, and then pass to the server side or to a hidden the selected file path.

It is posible to change the RadFileExplorer values in the codebehind? Do i need to use always a "FtpSettings.config" file?

I have sean this example but as i understand it only use the .config file:
http://www.telerik.com/support/kb/aspnet-ajax/fileexplorer/details/connecting-the-radfileexplorer-to-a-ftp-filesystem

Thanks in advance.
Dobromir
Telerik team
 answered on 21 Jul 2014
3 answers
235 views
hello
i have a radgrid whit a loading panel. it's work.
i have a problem when i make the export excel. when i click the export excel i want that the loading appear but in this way the export not work.
this is my code:

   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
   <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnPrevisionExport">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="GridPrevision" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>
    
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Skin="Default" runat="server" >
    </telerik:RadAjaxLoadingPanel>

if i don't put the this code

   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
   <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnPrevisionExport">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="GridPrevision" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>

the export work but i haven't the loading on the grid.
Any ideas to make export and have the loading on the grid?
Thanks
   

Sureshkumar
Top achievements
Rank 1
 answered on 21 Jul 2014
1 answer
75 views
Hello there,

im using radeditors to update news content. when i click in the radgrid on some row, it opens a jquery dialog and sets two radeditor using set_html(Preview and Content).

This works perfect in google chrome but not on IE and FF. the html field has the content, but the design field dont and i cant even type on it.

here's the code:
var varTitle = eventArgs.getDataKeyValue("title");
var varInitialDate = eventArgs.getDataKeyValue("initial");
var varEndDate = eventArgs.getDataKeyValue("end");
var varPreview = eventArgs.getDataKeyValue("prev");
var varContent = eventArgs.getDataKeyValue("content");
*** Opens the dialog ***
$find('<%= Title.ClientID%>').set_value(varTitle);
$find('<%= ID.ClientID%>').get_textBox().control.set_value(varInitialDate);
$find('<%= ED.ClientID%>').get_textBox().control.set_value(varEndDate);
$find('<%= Preview.ClientID%>').set_html(varPreview);
$find('<%= Content.ClientID%>').set_html(varContent);

any ideas on what the problem is?

thanks
Ianko
Telerik team
 answered on 21 Jul 2014
1 answer
96 views
Good Morning

I use the property ImagesFolderPath="Images" but in this folder containts images  with format .png . The Gallery not show the images, would you help me or do you exist one solution

Thanks and regards  
Shinu
Top achievements
Rank 2
 answered on 21 Jul 2014
1 answer
138 views
Hi. I have a RadGrid with a Combobox FilterTemplate
<telerik:RadGrid ID="rgvEquipos" Width="70%" DataSourceID="SqlDataSource1" AllowFilteringByColumn="True"
            AllowSorting="True" AllowPaging="True" PageSize="30" runat="server" AutoGenerateColumns="False" ShowFooter="true"
            OnPreRender="rgvEquipos_PreRender" ShowStatusBar="true" EnableLinqExpressions="false" OnItemDataBound="rgvEquipos_ItemDataBound">
                <MasterTableView DataKeyNames="equipoId" ShowFooter="true">
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="equipoId" DataField="equipoId" HeaderText="equipoId"
                            AllowFiltering="false" HeaderStyle-Width="80px" />
                        <telerik:GridBoundColumn UniqueName="centro" DataField="centro" HeaderText="centro"
                            HeaderStyle-Width="80px">
                            <FilterTemplate>
                                <telerik:RadComboBox ID="rcbCentro" DataSourceID="SqlDataSource2" DataTextField="centro"
                                    DataValueField="centro" Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("centro").CurrentFilterValue %>'
                                    runat="server" OnClientSelectedIndexChanged="centroIndexChanged">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="Todos" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                    <script type="text/javascript">
                                        function centroIndexChanged(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            tableView.filter("centro", args.get_item().get_value(), "EqualTo");
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Denominacion" DataField="Denominacion" HeaderText="Denominacion"
                            AllowFiltering="false" HeaderStyle-Width="300px" />
                        <telerik:GridBoundColumn UniqueName="Ubicacion" DataField="Ubicacion" HeaderText="Ubicacion"
                            AllowFiltering="false" HeaderStyle-Width="300px" />
                        <telerik:GridBoundColumn UniqueName="centroCosto" DataField="centroCosto" HeaderText="centroCosto"
                            AllowFiltering="false" HeaderStyle-Width="80px" />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
....
<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:PlanMantenimientoConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT [equipoId], [centro], [activoFijo], [Denominacion], [areaEmpresa], [Ubicacion], [GP], [fabricante], [tipoObjeto], [numSerie], [statusSistema], [centroCosto], [calle], [creadoEl], [creadoPor] FROM [inventarioPM] WHERE (calle LIKE '%TRANSMIS%' OR calle = '') AND Ubicacion NOT LIKE '%ERO%' AND GP <> ' '"
        runat="server"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:PlanMantenimientoConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT [centro] FROM [inventarioPM] WHERE (calle LIKE '%TRANSMIS%' OR calle = '') AND Ubicacion NOT LIKE '%ERO%' AND GP <> ' ' Order By Centro"
        runat="server"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:PlanMantenimientoConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT [GP] FROM [inventarioPM] WHERE (calle LIKE '%TRANSMIS%' OR calle = '') AND Ubicacion NOT LIKE '%ERO%' AND GP <> ' ' Order By GP"
        runat="server"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource4" ConnectionString="<%$ ConnectionStrings:PlanMantenimientoConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT [activoFijo] FROM [inventarioPM] WHERE (calle LIKE '%TRANSMIS%' OR calle = '') AND Ubicacion NOT LIKE '%ERO%' AND activoFijo = 'gggg'"
        runat="server"></asp:SqlDataSource>

And i want the combobox to have a Defalut value depending on a URL parameter... with this code the combo is selectd right by the parameter, but the Grid is not populated by this filter.

protected void Page_Load(object sender, EventArgs e)
        {
            esp = Request["esp"];
            zona = Request["zona"];
        }
        protected void rgvEquipos_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridFilteringItem)
            {
                GridFilteringItem filterItem = (GridFilteringItem)e.Item;
                RadComboBox comboCentro = (RadComboBox)filterItem.FindControl("rcbCentro");// accessing RadComboBox in FilterTemplate
                RadComboBox comboGP = (RadComboBox)filterItem.FindControl("rcbGP");// accessing RadComboBox in FilterTemplate
                RadComboBox comboActivo = (RadComboBox)filterItem.FindControl("rcbactivoFijo");// accessing RadComboBox in FilterTemplate
                if (!IsPostBack)
                {
                    comboCentro.SelectedValue = zona;
                    comboGP.SelectedValue = esp;
                }
            }
        }
        protected void rgvEquipos_PreRender(object sender, System.EventArgs e)
        {
            if (rgvEquipos.MasterTableView.FilterExpression != string.Empty)
            {
                RefreshCombos();
            }
        }
        protected void RefreshCombos()
        {
 
            SqlDataSource2.SelectCommand = "SELECT DISTINCT [centro] FROM [inventarioPM] WHERE (calle LIKE '%TRANSMIS%' OR calle = '') AND Ubicacion NOT LIKE '%ERO%' AND GP <> ' ' AND " + rgvEquipos.MasterTableView.FilterExpression.ToString() + " Order By centro";
            SqlDataSource3.SelectCommand = "SELECT DISTINCT [GP] FROM [inventarioPM] WHERE (calle LIKE '%TRANSMIS%' OR calle = '') AND Ubicacion NOT LIKE '%ERO%' AND GP <> ' ' AND " + rgvEquipos.MasterTableView.FilterExpression.ToString() + " Order By GP";
            SqlDataSource4.SelectCommand = SqlDataSource4.SelectCommand + " AND " + rgvEquipos.MasterTableView.FilterExpression.ToString();
            rgvEquipos.MasterTableView.Rebind();
        }

Could yo please help me with this.
Thankss

Shinu
Top achievements
Rank 2
 answered on 21 Jul 2014
7 answers
194 views
Hi:

I am going down a different path, I am trying to implement a FormView with the Radgrid.  I have the following, but I have a couple of problems.
1) edit form is a popup,... I would like in-line,
2) the insert event is not fully wired-up.  The ItemCommand event has the Insert command but the InsertCommand is not triggered:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MasterFormDetailProdGrid.aspx.cs" Inherits="Telerik.RadGrid.MasterFormDetailProdGrid" %>
<%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <Telerik:RadGrid
        ID="categoriesGrid" runat="server"
        DataSourceID="categoriesDataSource"
        AllowFilteringByColumn="True"
        AllowPaging="True"
        AutoGenerateColumns="False"
        allowautomaticdeletes="True"
        allowautomaticinserts="True"
        allowautomaticupdates="True"
        Skin="Office2007" CellSpacing="0"
        OnItemCommand="categoriesGrid_ItemCommand" OnInsertCommand="categoriesGrid_InsertCommand" OnItemInserted="categoriesGrid_ItemInserted"
        >
        <MasterTableView
            CommandItemDisplay="Top"
            DataSourceID="categoriesDataSource"
            EditMode="InPlace"
            DataKeyNames="CategoryID" GridLines="None"
            PageSize="1" ShowHeader="False">
            <Columns>
                <Telerik:GridTemplateColumn HeaderText="CategoryID" UniqueName="CategoryIDColumn" AllowFiltering="False" ItemStyle-BorderStyle="None" >
                    <ItemTemplate>
                        <table style="padding: 0; margin: 0; width: 100%">
                            <tr>
                                <td class="rightDetail" style="width: 120px;">
                                    CategoryID:
                                </td>
                                <td class="leftDetail">
                                    <asp:Label ID="categoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="rightDetail">
                                    CategoryName:
                                </td>
                                <td class="leftDetail">
                                    <asp:Label ID="categoryNameLabel" runat="server" Text='<%# Eval("CategoryName") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="rightDetail">
                                    Description:
                                </td>
                                <td class="leftDetail">
                                    <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("Description") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="rightDetail">
                                    Picture:
                                </td>
                                <td class="leftDetail">
                                    <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%# Eval("Picture") == DBNull.Value? new System.Byte[0]: Eval("Picture") %>'
                                        AutoAdjustImageControlSize="false" Width="150px" Height="150px" ToolTip='<%#Eval("CategoryName", "Photo of {0}") %>'
                                        AlternateText='<%#Eval("CategoryName", "Photo of {0}") %>' />
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:Label ID="CategoryIDLabel" runat="server" Text='<# Eval("CategoryID") %>' />
                    </EditItemTemplate>
                </Telerik:GridTemplateColumn>
                <Telerik:GridEditCommandColumn EditText="Edit"
                    ItemStyle-VerticalAlign="Top" ItemStyle-Width="40px"
                    ItemStyle-BorderStyle="None" />
                <Telerik:GridButtonColumn Text="Delete" CommandName="Delete"
                    UniqueName="DeleteColumn" ItemStyle-VerticalAlign="Top" ItemStyle-Width="50px" ItemStyle-BorderStyle="None"
                    ConfirmText="Are you sure you want to delete this data?" />
            </Columns>
            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <EditItemStyle CssClass="EditedTelerikGrid"/>
            <EditFormSettings EditFormType="Template">
                <FormTemplate>
            <table style="padding: 0; margin: 0; width: 100%">
                <tr>
                    <td colspan="3" class="rightDetail">
                        <asp:LinkButton id="insertButton" runat="server" CausesValidation="True"
                            CommandName="Insert" Text="Save" CssClass="buttonBlue" CommandArgument="close"
                            ValidationGroup="insertValidationGroup" />
                          |  
                        <asp:LinkButton id="InsertCancelButton" runat="server" CausesValidation="False"
                            CommandName="Cancel" Text="Cancel" CssClass="buttonBlue" />
                    </td>
                </tr>
                <tr>
                    <td class="rightDetail">
                        CategoryID:
                    </td>
                    <td class="leftDetail">
                        <asp:Label ID="categoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>' />
                    </td>
                    <td class="leftDetail">
                    </td>
                </tr>
                <tr>
                    <td class="rightDetail">
                        CategoryName:
                    </td>
                    <td class="leftDetail">
                        <telerik:RadTextBox ID="categoryNameTextBox" runat="server" Text='<%# Bind("CategoryName") %>' Columns="14" MaxLength="15" />
                    </td>
                    <td class="leftDetail">
                        <asp:RequiredFieldValidator id="categoryNameValidator" runat="server"
                            ControlToValidate="categoryNameTextBox" ValidationGroup="insertValidationGroup"
                            ErrorMessage="'CategoryName' is required" Text="*" />
                    </td>
                </tr>
                <tr>
                    <td class="rightDetail">
                        Description:
                    </td>
                    <td class="leftDetail">
                        <telerik:RadTextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("Description") %>' Columns="80" Rows="3" />
                    </td>
                    <td class="leftDetail">
                        <asp:RequiredFieldValidator id="descriptionValidator" runat="server"
                            ControlToValidate="descriptionTextBox" ValidationGroup="insertValidationGroup"
                            ErrorMessage="'Description' is required" Text="*" />
                    </td>
                </tr>
                <tr>
                    <td class="rightDetail">
                        Picture:
                    </td>
                    <td class="leftDetail">
                    </td>
                    <td class="leftDetail">
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:ValidationSummary id="insertValidationSummary" runat="server"
                            ValidationGroup="insertValidationGroup" />
                    </td>
                </tr>
            </table>
 
                </FormTemplate>
            </EditFormSettings>
            <CommandItemSettings AddNewRecordText="Add"  RefreshText="Refresh" />
        </MasterTableView>
        <FilterMenu EnableTheming="True" Skin="Office2007">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </FilterMenu>
    </Telerik:RadGrid>
    <asp:HiddenField ID="CategoryIDHidden" runat="server" Value='' />
    <asp:SqlDataSource ID="categoriesDataSource" runat="server"
        ConnectionString="<%$ ConnectionStrings:Northwind %>"
        SelectCommand="SELECT * FROM [Categories]"
        DeleteCommand="DELETE FROM [Categories] WHERE [CategoryID] = @CategoryID"
        InsertCommand=" INSERT INTO [Categories] ( [CategoryName], [Description] )
    VALUES ( @CategoryName, @Description )"
        UpdateCommand=" UPDATE [Categories]
    SET
        [CategoryName] = @CategoryName,
        [Description] = @Description
    WHERE
        [CategoryID] = @CategoryID ">
        <DeleteParameters>
            <asp:Parameter Name="CategoryID" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="CategoryName" />
            <asp:Parameter Name="Description" />
            <asp:Parameter Name="Picture" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="CategoryName" />
            <asp:Parameter Name="Description" />
            <asp:Parameter Name="Picture" />
            <asp:Parameter Name="CategoryID" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:Label ID="messageLabel" runat="server" Text="" CssClass="notification"></asp:Label>
</asp:Content>
Sorry about the size, I tried the simplest example.  The code behind is nothing.
This comes from:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx
Phil
Princy
Top achievements
Rank 2
 answered on 21 Jul 2014
5 answers
345 views
Hai,

I got one problem in my Radwindow i have some fields its wroking properly before inserting RequiredFieldValidator  after inserting RequiredFieldValidator  
when i click on Add button the Radwindow is not opening.In my page When i click on Add and Edit buttons it will open but now its not opening my code is 
<cc1:RadWindow ID="RadWin_AddEdit" runat="server" Modal="true" Width="730" Height="370"
                VisibleOnPageLoad="false" Visible="false"
                Behaviors="Close,Reload" VisibleStatusbar="false">
                <ContentTemplate>
                    <asp:UpdatePanel ID="upnlSaveUpdateGangway" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <table id="tblAddGangway" width="100%">
                                  <tr>
                            <td>Category: </td>
                            <td>
                                <div style="display: inline-block">
                                    <cc1:RadComboBox ID="cmbCategory" runat="server" EmptyMessage="- Select Category -" OnSelectedIndexChanged="cmbCategory_SelectedIndexChanged"
                                        AutoPostBack="true" Width="150px">
                                    </cc1:RadComboBox>
                                </div>
                                <div style="display: inline-block">
                                    <cc1:RadComboBox ID="cmbSubCategory" runat="server" EmptyMessage="- Select Sub-category -" OnSelectedIndexChanged="cmbSubCategory_SelectedIndexChanged"
                                        AutoPostBack="true" Width="150px">
                                    </cc1:RadComboBox>
                                </div>
                                </tr>
                                 <tr>
                                <div style="display: inline-block">
                                    <td>Item Master: </td>
                                    <td>
                                    <cc1:RadSearchBox  runat="server" ID="cmbItemMaster" OnSearch="cmbItemMaster_Search" Skin="WebBlue" Style="padding-right: 5px; padding-left: 5px; font-family: Calibri;"
                                                Width="85%" AutoPostBack="true" ZIndex="10000000" DropDownSettings-Width="200px" DropDownSettings-Height="200px">
                                            </cc1:RadSearchBox>
                                     <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="cmbItemMaster"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
 
                                    </cc1:RadSearchBox>
                                        </td>
                                </div>
                        </tr>
                          
                               <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblMaterialCode" runat="server" Text="Material Code"></asp:Label>
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                      <cc1:RadComboBox AutoPostBack="true" ID="ddlMaterialCode" OnSelectedIndexChanged="ddlMaterialCode_SelectedIndexChanged"
                                             runat="server" Width="40%" EmptyMessage="- Select Material code -">
                                        </cc1:RadComboBox>
                                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="ddlMaterialCode"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblMaterialName" runat="server" Text="Material Name"></asp:Label>
                                       
 
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                   <%--     <asp:TextBox ID="tbMaterialName" runat="server" MaxLength="100" Width="160px"></asp:TextBox>--%>
                                            <asp:Label ID="lblMName" runat="server" ></asp:Label>
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblQtyRequired" runat="server" Text="Qty Required"></asp:Label>
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                        <asp:TextBox ID="tbQtyRequired" runat="server" MaxLength="100" Width="160px"></asp:TextBox>
                                 <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="tbQtyRequired"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
                                </tr>
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblPriority" runat="server" Text="Priority"></asp:Label>
                                    </td>
                                    <td style="height: 31px" class="tdField" colspan="3">
                                        <asp:DropDownList ID="ddlPriority" runat="server" Width="40%">
                                        </asp:DropDownList>
                                      <asp:RequiredFieldValidator runat="server" ID="rfvDuration" ControlToValidate="ddlPriority"
                                ForeColor="Red" ValidationGroup="SaveUpdate" Display="Dynamic">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 31px;">
                                        <asp:Label ID="lblRemarks" runat="server" Text="Remarks"></asp:Label>
                                    </td>
                                    <td style="height: 31px" colspan="3">
                                        <asp:TextBox ID="tbRemarks" runat="server" MaxLength="400" TextMode="MultiLine" Width="160px"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%">
                                <tr>
                                    <td class="tdControl" align="center">
                                        <asp:Button ID="btnSave" runat="server" Width="50px" OnClick="btnSave_Click"
                                            CommandName="Insert" ValidationGroup="SaveUpdate" Text="Save" />  
 
                                        <input id="btnCancel" onclick="CloseChildWindow();" style="width: 50px;" type="button"
                                            value="Cancel" name="Cancel" />
                                        <asp:HiddenField ID="hdnMRDId" runat="server" />
 
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
 
                </ContentTemplate>
            </cc1:RadWindow>
Shinu
Top achievements
Rank 2
 answered on 21 Jul 2014
2 answers
90 views
Dear All,

I have a project that contains numerous radgrid, and need to rebind them all in timely manner. I'm just wonder will it be even possible to use a for loop to reduce the length of my code?

Some thing like this (just an idea, obviously the type conversion is incorrect):

//For RadGrid1, RadGrid2,... to RadGrid20, I have a click function using a button
 protected void Refresh_Click(object sender, EventArgs e)
        {
                string raw_radgridname = "RadGrid";
                string radgridname = "";

                for (int i = 0; i<20; i++)
                {     
                        radgridname = "";
                        radgridname = raw_radgridname + Convert.ToString(i);
                       (radgridname as RadGrid).Rebind();
                } 
        }

Many Thanks!
Tim
Top achievements
Rank 1
 answered on 20 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?