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

I am using telerik controls in a DotNetNuke 6 environment.  I have a RadListBox that needs to be refreshed on DataBind, but no matter what I try, it will not work.  The button is located in a RadWindow, and the page cannot postback upon closing of this window.  I've been trying to figure out the solution for hours and I have yet to find one.  Any help is appreciated, my code is below:

// My RadAjaxManager
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rdlb_assets" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="rdlb_assets">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rdlb_assets" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Windows7" />

// My RadListBox
<telerik:RadListBox ID="rdlb_assets" 
                                            runat="server" 
                                            AutoPostBack="true"
                                            EnableDragAndDrop="True" 
                                            OnClientDragStart="OnClientDragStart"
                                            OnClientDragging="OnClientDragging" 
                                            OnClientDropping="OnClientDropping" 
                                            OnClientLoad="RadListBoxLoad"
                                            OnClientItemDoubleClicked="doubleClick"
                                            EnableEmbeddedSkins="false"
                                            Skin="PrestoRadSkin" 
                                            AllowAutomaticUpdates="True">
                        </telerik:RadListBox>

// Javascript fired once the button to close the window is clicked
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); 

// Code behind for RadAjaxManager1_AjaxRequest
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                    rdlb_assets.Items.Clear();
                    rdlb_assets.DataSource = LoadAssets(thisContent);
                    rdlb_assets.DataBind();
            }
        }

Thank you!

Vanessa
Vanessa
Top achievements
Rank 1
 answered on 18 Jun 2012
5 answers
533 views
Hi

Having looked at some of the examples of people using radwindow and radgrid rebinds. I have worked on trying to get a radgrid rebind using javascript after altering some data in a modal window.

Although what i am trying gets only so far.

I call this following javascript function from the modal window

    function test()       
    {  
        var grid = $find("<%= RadGrid1.ClientID %>");  
        grid.ajaxRequest();      
    } 

the following code is called from the OnAjaxRequest="RadGrid1_AjaxRequest"  set in the telerik:RadAjaxManager
    protected void RadGrid1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
    {  
        RadGrid1.Rebind();  
    } 

on doing this i am getting an "object doesnt support this property method error"

Any help would be greatly appreciated.

Thanks
Robert
Top achievements
Rank 1
 answered on 18 Jun 2012
1 answer
133 views
Hello. I present a simplified version of the implementation in which I found this problem.

Let's suppose I have a user control, called Redirector, which only has a link button for markup, and who's job it is to redirect to a certain page:
Public Class Redirector
Inherits UserControl
Private Sub lnkRedirect_Command(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs) Handles lnkRedirect.Command
Response.Redirect("~/WebForm2.aspx")
End Sub
End Class

I want to put this on a page, inside of a RadWindow, along with some other controls. Here's the markup for my page:

<%@ Register TagPrefix="testApp" TagName="Redirector" Src="~/Redirector.ascx" %>
 
<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1" >
 
    Page 1
    <br />
    <asp:Button ID="btnOpen" runat="server" Text="Open" />
 
 
    <trk:RadWindow runat="server" ID="MainRadWindow">
        <ContentTemplate>
     
            Hello there.
 
            <trk:RadAjaxPanel ID="InnerAjaxPanel" runat="server">
 
                <ul>
                    <li>
                        <testApp:Redirector ID="Redirector1" runat="server" />
                    </li>
                    <li>
                        <asp:Button ID="btnPostBack" runat="server" Text="Postback" />
                    </li>
                    <li>
                        <asp:Label ID="lblTime" runat="server" />
                    </li>
                </ul>
 
            </trk:RadAjaxPanel>
 
        </ContentTemplate>
    </trk:RadWindow>
        
 
</asp:Content>

And here is the code-behind for the page:

Public Class WebForm1
    Inherits System.Web.UI.Page
 
    Private Sub btnOpen_Command(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs) Handles btnOpen.Command
        MainRadWindow.VisibleOnPageLoad = True
    End Sub
 
    Private Sub btnPostBack_Command(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs) Handles btnPostBack.Command
        lblTime.Text = Now.TimeOfDay().ToString
    End Sub
End Class

If the user opens the RadWindow and immediately clicks the linkbutton, Page.Redirect() happens with no problem. However, if the user first clicks on btnPostback, and then clicks the linkbutton, the InnerAjaxPanel throws a javascript error.

    Microsoft JScript runtime error: Unable to get value of the property '_events': object is null or undefined

Could you please look into this and let me know what is causing the problem, and how I could fix it?

Thank you.
Maria Ilieva
Telerik team
 answered on 18 Jun 2012
2 answers
109 views
Dear All,
    I have developing product in 4 tier architecture by asp.net using c sharp and i have done RadGrid but how navigate from grid page to update page with ID.how to pass id from grid page to update page without using NavigateURL

my code is:
<telerik:RadGrid ID="radgrdUserList" runat="server" AllowPaging="true" AllowSorting="true"
                AutoGenerateColumns="false" >
                <MasterTableView ClientDataKeyNames="ID" DataKeyNames="ID">
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="UserName" HeaderText="User Name">
                            <ItemTemplate>
                                <asp:HyperLink ID="lnkUserName" runat="server" Text='<%#Eval("UserName") %>' NavigateUrl='<%#"~/UserDetails.aspx?ID=" +
                                                                Eval("ID") %>'></asp:HyperLink></ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn HeaderText="First Name" UniqueName="FirstName" DataField="FirstName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Last Name" UniqueName="LastName" DataField="LastName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Date of Join" UniqueName="DOB" DataField="DOB">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Created By" UniqueName="CreatedBy" DataField="CreatedBy">
                        </telerik:GridBoundColumn>
                          </Columns>
                </MasterTableView></telerik:RadGrid>

When i click UserName then pass Id from gridview page to update page in code behind code using query string or session, and how to receive ID in update page for update particular row details.
Susi
Top achievements
Rank 1
 answered on 18 Jun 2012
2 answers
153 views
Just bought the telerik controls, have radgrid working on other pages fine, but this one is not selecting the right value from the database. it shows the dropdownlist but it's always the first one.

Select Command returns: 1 or 0 bit value in sql
ColumnName in sql is :EventTitleStatus

The odsGetTitleStatuses: returns a datatable:
Yes: 1
No: 0


   <telerik:GridDropDownColumn DataSourceID="odsGetTitleStatuses"  DataType="System.Int32" HeaderText="Visible"
                    FilterControlAltText="Filter column1 column" ListTextField="StatusText" SortExpression="EventTitleStatus"
                    ListValueField="StatusValue" UniqueName="EventTitleStatus" DataField="EventTitleStatus">
                </telerik:GridDropDownColumn>

What am I doing wrong??
Charles
Top achievements
Rank 1
 answered on 18 Jun 2012
1 answer
211 views
Hi,

I find combobox little complex in its usage.     This is what i wish to do while using it inside grid control , I am using form template (in grid)...

1. I want combo to display intital value as "select"   (to force user to select dropdown)
2. if user does not select it should show error message.  
3. Above should also be true when user resets this choice back to "select" (initial value)
4. Since this is multicolumn using template,   it should display 1st row as "select" in all columns available in multicolumn
    or atleast in 1st column.


I tried doing above but failed on point #2 and Point #4.  

<telerik:RadComboBox Width="250px" HighlightTemplatedItems="true"
                    runat="server"   ID="cbCurrencyCode" AppendDataBoundItems="True"
                    DataSourceID="EntityDataSource2"
                    SelectedValue='<%# Bind("FKCurrencyCode") %>'
                    onitemdatabound="cbCurrencyCode_ItemDataBound"  >
      <Items>
          <telerik:RadComboBoxItem runat="server" Text="- Select -" Value="- Select -" />
      </Items>
     <HeaderTemplate>
            <ul>
                <li class="col1">Code</li>
                <li class="col2">Name</li>
            </ul>
        </HeaderTemplate>
        <ItemTemplate>
            <ul>
                <li class="col1">
                    <%# DataBinder.Eval(Container.DataItem, "CurrencyCode")%></li>
                <li class="col2">
                    <%# DataBinder.Eval(Container.DataItem, "CurrencyName")%></li>
            </ul>
        </ItemTemplate>
                </telerik:RadComboBox>
  
                <br />
  <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="cbCurrencyCode"
InitialValue="- Select -" ErrorMessage="Please select." ValidationGroup="SearchFormValidationGroup"
CssClass="validator" />


protected void cbCurrencyCode_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
     {
         e.Item.Text = ((DAL.MasterCurrency)e.Item.DataItem).CurrencyCode;
         //((DataRowView)e.Item.DataItem)["CurrencyCode"].ToString();
         e.Item.Value = ((DAL.MasterCurrency)e.Item.DataItem).CurrencyCode;
         //((DataRowView)e.Item.DataItem)["CurrencyCode"].ToString();
     }


a. I also had to write above code, which i feel is unnecessary and there should be a better approach.
b. Form do get submitted, without doing any selection.  validationcontrol should have stopped, but it did not.
c. first row in the multicolumn list remains blank.  I want that it should display 'Select' and its value also should be "Select" so that validation can stop form submit.


I hope i was able to explain.  Any advice?

Regards












Peter
Telerik team
 answered on 18 Jun 2012
0 answers
85 views
Hi Guys

I attached one image , my client need same as that
Can you please let me know whether i can do like the same in grid
 that view will have some buttons above the cross image which is in the center and link buttons in all other cell
Initially i need to show a grid with same type with out any data
and after the link button is clicked user will insert data

My requirement
1) I need to show the grid same as like this with out any data
2) Whether this type of design is possible .If yes?Please guide

Karthik.K
Karthik Kantharaj
Top achievements
Rank 1
 asked on 18 Jun 2012
1 answer
148 views
Hi,

my problem is a little bit tricky. I will try to explain it as clear as I can.

I am using alot of grid in my application. For the moment I have a function called UpdateDefault which looks like this:

Public Sub GridCGSI_UpdateDefaults(ByVal tmpGrid As RadGrid)
    AddHandler tmpGrid.HeaderContextMenu.ItemCreated, AddressOf GridCGSI_HeaderContextMenu_ItemCreated
 
 
    tmpGrid.CellSpacing = "0"
    tmpGrid.AutoGenerateColumns = False
    tmpGrid.AllowPaging = True
    tmpGrid.PageSize = 40
    tmpGrid.AllowSorting = True
 
    tmpGrid.GridLines = GridLines.None
    tmpGrid.AllowFilteringByColumn = True
    tmpGrid.EnableHeaderContextMenu = True
    tmpGrid.ShowStatusBar = True
 
    tmpGrid.HeaderContextMenu.Enabled = True
 
 
    tmpGrid.GroupingSettings.CaseSensitive = False
    tmpGrid.ClientSettings.AllowColumnHide = True
    tmpGrid.ClientSettings.AllowColumnsReorder = True
    tmpGrid.ClientSettings.AllowKeyboardNavigation = True
    tmpGrid.ClientSettings.EnableRowHoverStyle = True
    tmpGrid.ClientSettings.Selecting.AllowRowSelect = True
    tmpGrid.ClientSettings.Scrolling.AllowScroll = True
    tmpGrid.ClientSettings.Scrolling.UseStaticHeaders = True
    tmpGrid.ClientSettings.Resizing.AllowColumnResize = True
    tmpGrid.ClientSettings.Resizing.AllowResizeToFit = True
    tmpGrid.ClientSettings.Resizing.EnableRealTimeResize = True
 
    tmpGrid.FilterMenu.EnableImageSprites = False
 
    tmpGrid.SortingSettings.SortedAscToolTip = "Trié asc"
    tmpGrid.SortingSettings.SortedDescToolTip = " desc"
    tmpGrid.SortingSettings.SortToolTip = "Cliquez ici pour trier"
    tmpGrid.StatusBarSettings.LoadingText = "Chargement..."
    tmpGrid.StatusBarSettings.ReadyText = GetMessageEx(3282).Texte
 
    tmpGrid.GroupingSettings.CaseSensitive = False
 
    tmpGrid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
 
 
    tmpGrid.MasterTableView.TableLayout = GridTableLayout.Fixed
    tmpGrid.MasterTableView.EnableHeaderContextAggregatesMenu = "True"
    tmpGrid.MasterTableView.NoMasterRecordsText = "Aucun enregistrement à afficher"
    tmpGrid.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.PushButton
    tmpGrid.MasterTableView.EditFormSettings.EditColumn.UpdateImageUrl = "Images/Icons/055-Check-ok-Icon.png"
    tmpGrid.MasterTableView.EditFormSettings.EditColumn.CancelImageUrl = "Images/Icons/056-Check-not-ok-Icon.png"
    tmpGrid.MasterTableView.EditFormSettings.EditColumn.InsertImageUrl = "Images/Icons/055-Check-ok-Icon.png"
    tmpGrid.MasterTableView.EditFormSettings.EditColumn.CancelText = GetMessageEx(5352).Texte
    tmpGrid.MasterTableView.EditFormSettings.EditColumn.UpdateText = GetMessageEx(4479).Texte
    tmpGrid.MasterTableView.EditFormSettings.EditColumn.InsertText = GetMessageEx(3177).Texte
    tmpGrid.MasterTableView.CommandItemSettings.AddNewRecordText = GetMessageEx(3177).Texte
    tmpGrid.MasterTableView.CommandItemSettings.RefreshText = "Rafraîchir"
End Sub

As you can see, I am settings some default settings for my grid. The best way it would be to put this in the grid constructor.

I am not familiar with custom user control. I know I can create a class and inherits from RadGrid and extend the constructor, but I don't know how I can implement this in the xaml and use it properly in code behind.

I need your help Telerik! Could you make me a little Project Sample with an example?

Regards,

- Jocelyn
Jocelyn
Top achievements
Rank 1
 answered on 18 Jun 2012
0 answers
39 views
Hello,

I have a nested RadGrid. I want to be able to expand the selected node when returning to the grid from an edit page. I know how to return to the selected page of the RadGrid, but which property is the selected expanded node?

Thanks
Thomas
Thomas
Top achievements
Rank 1
 asked on 18 Jun 2012
1 answer
136 views
I have this on my RagGrid Edit FormTemplate:              

       <telerik:RadButton ID="RadBtnUpdate" runat="server" Text="Update" CommandName="Update"
                            Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>' CssClass="ComandButton">
                        </telerik:RadButton>
                       
       <telerik:RadButton ID="RadBtnInsert" runat="server" Text="Insert" CommandName="PerformInsert"
                            Visible='<%# DataItem is Telerik.Web.UI.GridInsertionObject %>' CssClass="ComandButton">
                        </telerik:RadButton>

When i "press" insert my "update button" is visible, not "insert button". (on edit appears update button, which is ok)
Any ideea why this?
Shinu
Top achievements
Rank 2
 answered on 18 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?