Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
130 views
Hello,

I currently have RadGrids that I am creating dynamically in Page Load that are embedded in PanelBar Items.  The grids create fine and render on the page.  They have the initial appearance of drag and drop, but when the row is released into the new grid, the routine tied to the RowDrop event (GridRowDrop) does not fire and the Page appears to do a PostBack.  I believe this has to do with something with AJAX settings, but not certain.

Here is a snippet from the code-behind:

Dim SectionGrid As New RadGrid()
 
 With SectionGrid
     .DataSource = GetData(FCTN_TYPE_CD, CALLING_AGENT)
     With .MasterTableView
         .NoMasterRecordsText = "No associates assigned"
         .Columns.Add(New GridDragDropColumn)
     End With
     .Rebind()
 End With
 
 ' Set each grid's properties.
 With SectionGrid
     .ID = "SectionGrid_" & FCTN_TYPE_CD
     .AllowSorting = True
     .Width = Unit.Percentage(99)
     .AutoGenerateColumns = False
     .ShowHeader = False
     .AllowMultiRowSelection = True
     .CssClass = "BottomCorners"
     .Attributes.Add("style", "border:none;")
     With .ClientSettings
         .AllowRowsDragDrop = True
         .Selecting.EnableDragToSelectRows = False
         .Selecting.AllowRowSelect = True
         .ClientEvents.OnRowDropping = "onRowDropping"
         .EnablePostBackOnRowClick = False
     End With
 End With
 
 With SectionGrid.MasterTableView
     .Width = Unit.Percentage(100)
     .DataKeyNames = New String() {"LDAP"}
     .GetColumn("LDAP").Visible = False
 End With
 
 AssignedGrid.Controls.Add(SectionGrid)
 With PanelItem
     .Items.Add(AssignedGrid)
     .Expanded = True
 End With
 
 If SectionGrid.Items.Count = 0 Then PanelItem.Expanded = False
 
 AddHandler SectionGrid.RowDrop, AddressOf GridRowDrop
 AddHandler SectionGrid.NeedDataSource, AddressOf GridNeedDataSource

Any help is appreciated.

regards,

Steve
Steve
Top achievements
Rank 1
 answered on 28 Mar 2012
1 answer
92 views
Hi there,

Am using RadTagCloud.
I have user control on this page with RadTagCloud,  this user control using in my aspx page.
but ItemClick event is giving problem like Object reference not found.

Below find my code snnipet
code behind if UserControl 
public partial class ucCustomerSelector : System.Web.UI.UserControl
  {
    public EventHandler rtcLinksClicks;


    protected void Page_Load(object sender, EventArgs e)
    {
    }


    protected void rtcLinks_ItemClick(object sender, Telerik.Web.UI.RadTagCloudEventArgs e)
    {
      rtcLinksClicks(sender, e);
    }


  }
******************************************
code behind of aspx page
public partial class CustomerPage : System.Web.UI.Page
  {
    


    protected void Page_Load(object sender, EventArgs e)
    {
      
      if (!Page.IsPostBack)
      {
        
        ucCustomerSelector.rtcLinksClicks += new EventHandler(myclick);
      }
    }


    private void myclick(object sender, EventArgs e)
    {
      // my logic wil come here.
    
    }
}
please give me solution, I am waiting for reply.
thanks in advance.
Slav
Telerik team
 answered on 28 Mar 2012
0 answers
99 views

In the popup that opens when I insert or edit one item in the grid, some logic has to be done, for example: enable and disable fields, depending on the values of other fields.

How can I add an onload event for the popup so that I can run js code to perform those enable/disable?

I already tried the OnPopUpShowing event, but it doesn’t work with date pickers, it fails in the get_selectedDate() because the _dateInput is empty (return this._dateInput.get_selectedDate())

Here’s the grid and javascript (simplified):

<RadGrid runat="server" ID="Grid1" AllowPaging="True" GridLines="None" CellSpacing="0" Culture="English (United Kingdom)" AllowSorting="True" AutoGenerateDeleteColumn="True" Width="95%" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" DataSourceID="ControlPanelNotifications_DS">

<MasterTableView DataKeyNames="fldId" DataSourceID="ControlPanelNotifications_DS" EditMode="PopUp" AutoGenerateColumns="False">

<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>

<Columns>

<ItemStyle HorizontalAlign="Center" Width="40px"></ItemStyle>

</sqr:GridButtonColumn>

</Columns>

<EditFormSettings CaptionFormatString="Detalhes" EditFormType="Template">

<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>

<FormTemplate>

<table style="width: 100%;">

<tr>

    <td>

                label

    <td>

                text

    <td>

                Label2

    <td>

                <RadDatePicker runat="server" ID="dtPracticalDate" Width="100px">

          <ClientEvents OnDateSelected="dtPracticalDate_DateSelected" />

        </RadDatePicker >

                <BindableControl runat="server" DataField="PraticalDate" TargetControlID="dtPracticalDate"></BindableControl>&nbsp;</td>

</tr>

<tr>

    <td>

                Label3

    <td>

text

               

     

    </td>

    <td>

                Label4

    <td>

                <RadDatePicker runat="server" ID="dtConfirmationDate" Width="100px">

          <ClientEvents OnDateSelected="dtConfirmationDate_DateSelected" />

        </RadDatePicker >

                <BindableControl runat="server" DataField="ConfirmationDate" TargetControlID="dtConfirmationDate"></BindableControl>&nbsp;</td>

</tr>

</table>

 

<asp:Button runat="server" CommandName="Cancel" Text="Cancelar"></asp:Button>

 

</FormTemplate>

<PopUpSettings Modal="True" Width="570px"></PopUpSettings>

</EditFormSettings>

</MasterTableView>

<FilterMenu EnableImageSprites="False"></FilterMenu>

<ClientSettings>

<ClientEvents OnPopUpShowing="PopUpShowing"></ClientEvents>

</ClientSettings>

<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>

</RadGrid>

Javascript:

function PopUpShowing(sender, eventArgs) {

    var practicalDate = getElementById('dtPracticalDate').get_selectedDate();

    UpdateConfirmationDate22(practicalDate);

}

function UpdateConfirmationDate22(practicalDate) {

    var confirmationDatePicker = getElementById('dtConfirmationDate');

    if (practicalDate != null) {

        confirmationDatePicker.set_enabled(true);

    }

    else {

        confirmationDatePicker.set_enabled(false);

        confirmationDatePicker.clear();

    }

}

David
Top achievements
Rank 1
 asked on 28 Mar 2012
10 answers
431 views
Hi ,


I would like to know what is the difference between the Telerik.WebControls.RadEditor and the Telerik.Web.UI.RadEditor ?

if I will need to change the existing code to use the Telerik.Web.UI.RadEditor instead of the Telerik.WebControls.RadEditor
 how and where can i find the corresponding property of the Telerik.WebControls.RadEditor with the Telerik.Web.UI.RadEditor ?

for example :  Telerik.WebControls.RadEditor.Editable,  DialogParametersMode,  HasPermission etc.

Any sample or documentation will be greatly appreciated


Thanks In Advance








Rumen
Telerik team
 answered on 28 Mar 2012
1 answer
58 views

Hello, 

I'm using Telerik's RadAjaxManager to update panels independently.

On my page, I have 3 user controls: A, B, C.

My AjaxSettings are:

  • If postback on A, update only A.
  • If postback on B, update only B.
  • I declare nothing for C.

If I do a postback on A, I see the loading panel on A, but (using Chrome dev tool) I see data sent for A and B. Strange to me as only A has loading panel.

If I do as postback on B, same behavior: loading panel on B but data for A and B.

Now, if I remove from AjaxSettings the settings for B, when I do a postback on A, only data for A are sent.

Am I wrong, or I should only see data for the "target" panel defined in AjaxSettings?

Moreover, sometimes in our user controls we access the RadAjaxManager to add response script. Can it be related? For instance, if in B's code-behind I add script to RadAjaxManager, will the entire B content will be sent when I do a postback on A (with rule A updates A only)?

This is really an issue in our app.

Thanks in advance for any help.

FB
Top achievements
Rank 1
 answered on 28 Mar 2012
3 answers
178 views
Hi there, I have come across a problem with the Rad Grid shrinking in size when it's rebound, or when it's item command it hit.

I will explain where my grid sits, It is in a control which is situated in a RadWindow which contains a tab strip it is one of the page contols of one of the rad tabs.

The RadGrid is set up with the following code:


    <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true" AllowPaging="true" AutoGenerateColumns="true" OnNeedDataSource="RadGrid1_NeedDataSource"
        OnColumnCreated="RadGrid1_ColumnCreated" OnItemDataBound="RadGrid1_ItemDataBound" AllowMultiRowSelection="true" ShowGroupPanel="true" OnItemCommand="RadGrid1_ItemCommand">
        <MasterTableView TableLayout="Fixed" Width="100%">     
            <Columns>
                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                    <HeaderStyle Width="50px" />
                </telerik:GridClientSelectColumn>
                <telerik:GridButtonColumn DataTextFormatString="Download" UniqueName="DownloadLink" CommandName="Download"
                        runat="server" DataTextField="ID" ButtonType="LinkButton" >                    
                </telerik:GridButtonColumn>                                     
            </Columns>                        
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="true" AllowColumnsReorder="true">
            <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true" />      
            <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="false"
              ClipCellContentOnResize="false" EnableRealTimeResize="false" AllowResizeToFit="false" />                   
        </ClientSettings> 
    </telerik:RadGrid> 

When the page first loads the grid renders as desired, however once it has been updated or the Download command has been run the grid shrinks all columns so that the contents of the cells are spread over 3 lines.

Any ideas on how to stop this from happening?

Regards
Ryan
Andrey
Telerik team
 answered on 28 Mar 2012
12 answers
383 views
When y try to filter, the exception "Invalid column name" shows up
Here is the aspx
<p>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="RadGrid1" Width="100%" DataSourceID="SqlDataSource1" AllowFilteringByColumn="True"
        AllowSorting="True" AllowPaging="True" PageSize="7" runat="server" AutoGenerateColumns="False"
        OnPreRender="RadGrid1_PreRender" ShowStatusBar="true" EnableLinqExpressions="false">
        <MasterTableView DataKeyNames="IdEmpresa">
            <Columns>
                <telerik:GridBoundColumn UniqueName="Empresa" DataField="Empresa" HeaderText="Empresa"
                    AllowFiltering="false" HeaderStyle-Width="200px" />
                <telerik:GridBoundColumn UniqueName="Supergrupo" DataField="Supergrupo" HeaderText="Super Grupo"
                    HeaderStyle-Width="200px">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxTitle" DataSourceID="SqlDataSource2" DataTextField="SuperGrupo" AutoPostBack="false"
                            DataValueField="SuperGrupo" Height="200px" AppendDataBoundItems="true"
                            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("SuperGrupo").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="Todos" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
                            <script type="text/javascript">
                                function TitleIndexChanged(sender, args)
                                {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("SuperGrupo", args.get_item().get_value(), "EqualTo");
 
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Grupo" DataField="Grupo" HeaderText="Grupo" HeaderStyle-Width="200px">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxCity" DataSourceID="SqlDataSource3" DataTextField="Grupo" AutoPostBack="false"
                            DataValueField="Grupo" Height="100px" AppendDataBoundItems="true"
                            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Grupo").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="CityIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
 
                            <script type="text/javascript">
                                function CityIndexChanged(sender, args)
                                {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("Grupo", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
 
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <br />
    <telerik:RadToolTip ID="RadToolTip1" runat="server" OffsetY="3" Position="TopCenter"
        ShowCallout="false" Height="20px" ShowEvent="fromcode" />
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:BTIMEXICO_DESConnectionC %>"
        ProviderName="System.Data.SqlClient" runat="server"
        SelectCommand="SELECT E.idEmpresa, E.Nombre AS Empresa, GE.idgrupo, G.Descripcion AS Grupo, SG.Descripcion AS SuperGrupo
                       FROM tbl_empresa E
                       LEFT JOIN tbl_grupoempresa GE
                       ON E.idEmpresa = GE.idEmpresa
                       LEFT JOIN tbl_grupos G
                       ON GE.idgrupo = G.idgrupo
                       LEFT JOIN tbl_Supergrupo SG
                       ON SG.idsupergrupo = G.idsupergrupo
                       ORDER BY Nombre">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:BTIMEXICO_DESConnectionC %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT Descripcion AS SuperGrupo FROM tbl_supergrupo"
        runat="server">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:BTIMEXICO_DESConnectionC %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT Descripcion AS Grupo FROM tbl_grupos"
        runat="server">
    </asp:SqlDataSource>
</p>

And the Code-behind
using System;
using System.Linq;
using System.Data;
using Telerik.Web.UI;
 
namespace BCD.PP.VIEW
{
    public partial class Client_Question_Config_A : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
            }
        }
 
        protected void ImportedFilter_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
            DataRowView rowView = (DataRowView)e.Item.DataItem;
            if (rowView["Bool"] is DBNull)
            {
                e.Item.Text = "No";
                e.Item.Value = "0";
            }
            else if ((bool)rowView["Bool"])
            {
                e.Item.Text = "Yes";
                e.Item.Value = "1";
            }
        }
 
        protected void RadGrid1_PreRender(object sender, System.EventArgs e)
        {
            if (RadGrid1.MasterTableView.FilterExpression != string.Empty)
            {
                RefreshCombos();
            }
        }
        protected void RefreshCombos()
        {
            SqlDataSource2.SelectCommand = SqlDataSource2.SelectCommand + " WHERE " + RadGrid1.MasterTableView.FilterExpression.ToString();
            SqlDataSource3.SelectCommand = SqlDataSource3.SelectCommand + " WHERE " + RadGrid1.MasterTableView.FilterExpression.ToString();
            RadGrid1.MasterTableView.Rebind(); //<<< Here is where the exception pops up
        }
    }
}

Following the example from here

I suspect the problem may be because the SQLDataSource is composed by joins instead of being a single table
any idea on how to solve this?
James Campbell
Top achievements
Rank 1
 answered on 28 Mar 2012
1 answer
86 views
Sorry if this has been posted this in somewhere else.   


I'm using a RadComboBox (ASP.Net) that has properties:
CloseDropDownOnBlur="true"
MarkFirstMatch="true"
AllowCustomText="true"


The Problem I'm facing is: 
If user start typing your own title, the pre-defined values starts to appear.
Say, the user types a single letter, say "N" into the box and it instantly selects the first option that starts with a 'N' (the list is presorted) and fill in that option in the box.
When you click off the combobox, is takes what you typed followed with the predefined value.


For e.g.: 'nNetwork Administrator'

I typed in "n"

'Network Administrator' automatically got taged on to the end there.


This happens on IE 9, IE8, Safari and Chrome but not on Mozilla (My Mozilla version is 3.6.28).
The Telerik RdComboBox Version I'm using is: 2.8.5.0

Please advice. 
Thanks in Advance
Ivana
Telerik team
 answered on 28 Mar 2012
1 answer
60 views
Dear Telerik,

After the upgrade form 2011.3.1115.40  to 2012.1.215.40 I had I lot of errors. Some thinks where fixed by the CAG and copieing dll's in the bin dir.

Any update gives me the creeps, it's giving me always troubles so it is not a thing I looking forward to.

This time I've spend over two days struggeling with the newest update, conlcuding that i had to roll back everything and stick with the 2011Q3 version.
For example im using the Documentmanger with Physical Paths which didnt work out.
So in the end ive build a new project complete according to the Telerik examples, and thank god... it didnt work in that project either...

Everything works fine until you want to insert that selected document into the RadEditor. I have search the code for a javascript Event on the insert button, I have set on every JS function a breakpoint none of them has been hit.

We did a rollback and it worked like a charme!

So there must be somthing wrong with it.

Regards Marco.
Rumen
Telerik team
 answered on 28 Mar 2012
3 answers
227 views
I am try to access the GridFooterItem on databound event and GridFooterItem.DataItem is nothing. 

Why I am getting Nothing for  "GridFooterItem.DataItem"?
Eyup
Telerik team
 answered on 28 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?