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

I am obviously not seeing something here. I have a simple grid instance with its the necessary ajaxsettings declared:

Ajax Setting for grid:

<telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="UserView">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserView" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

Grid instance: (allowsort and allowpaging both = true)
<telerik:RadGrid ID="UserView" GridLines="None" runat="server" AllowPaging="True"
                AutoGenerateColumns="False" Skin="Windows7" AllowSorting="true" Width="722" OnNeedDataSource="UserViewNeedDataSource" PageSize="20">
                <PagerStyle Mode="NextPrevAndNumeric"/>
                <MasterTableView Width="722">
                    <Columns>
                        <telerik:GridBoundColumn DataField="FullName" HeaderText="Name" SortExpression="FullName"
                            UniqueName="FullNameColumn" />
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName"
                            UniqueName="AdUserNameColumn" />
                        <telerik:GridBoundColumn DataField="Domain" HeaderText="Domain" SortExpression="Domain"
                            UniqueName="AdDomainColumn" />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
<telerik:RadGrid ID="UserView" GridLines="None" runat="server" AllowPaging="True"
                AutoGenerateColumns="False" Skin="Windows7" AllowSorting="true" Width="722" OnNeedDataSource="UserViewNeedDataSource" PageSize="20">
                <PagerStyle Mode="NextPrevAndNumeric"/>
                <MasterTableView Width="722">
                    <Columns>
                        <telerik:GridBoundColumn DataField="FullName" HeaderText="Name" SortExpression="FullName"
                            UniqueName="FullNameColumn" />
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" SortExpression="UserName"
                            UniqueName="AdUserNameColumn" />
                        <telerik:GridBoundColumn DataField="Domain" HeaderText="Domain" SortExpression="Domain"
                            UniqueName="AdDomainColumn" />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Assignment of data:

protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                GetUsers();
            }
        }
 
        private void GetUsers()
        {
            UserView.DataSource = _client.GetUsers(null);
          
        }

And from the documentation, it says the OnNeedDataSource event will fire after a page or sort event, so I have a handler:

protected void UserViewNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            GetUsers();
        }
protected void UserViewNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            GetUsers();
        }

The ajax call is happening, the event handler is being hit, but nothing happens. No sort, no paging.

Feedback would be appreciated. Version of control suite: v2010.2.929.40

Cheers,

Derek
Nikolay Rusev
Telerik team
 answered on 23 Nov 2010
1 answer
80 views
I have a RadGrid (RadGrid1) that has a nestedViewTemplate. In this NestedViewTemplate, another grid (RadGrid2) is loaded.
RadGrid2 has an imagebutton in each row that opens a RadWindow, where the user can make modifcations to the row in RadGrid2.
When the RadWindow is closed (OnClientClose="refreshGrid" ), this function is run
function refreshGrid() {
        var args = null;
        args = document.getElementById("inpHidden").value;
        if (args) {
            var mgr = $find("<%= RadAjaxManager1.ClientID %>");
            if (mgr) {
                mgr.ajaxRequest(args);
            }
        }
    }

The RadAjaxManager1_AjaxRequest method rebinds the grid in the NestedViewTemplate without reloading the main grid RadGrid1. This is the desired behavior and works fine. However, if I click on the image button again, the function can no longer find a reference to RadAjaxManager1, which is on the control that holds the Main grid
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
            </UpdatedControls>
        </telerik:AjaxSetting
        <telerik:AjaxSetting AjaxControlID="RadGrid2">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
            </UpdatedControls>
        </telerik:AjaxSetting
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxPanel ID="RadAjaxPanel4" runat="server" Width="100%" LoadingPanelID="RadAjaxLoadingPanel4">
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel4" runat="server"">
telerik:RadAjaxLoadingPanel>
<telerik:RadGrid ID="RadGrid1" ....

Any idea why the manager can no longer be found?
Radoslav
Telerik team
 answered on 23 Nov 2010
5 answers
134 views
Just updated to the new internal build and now i cannot enter a negative timeZoneOffset.  I was using -06:00:00, but now I get an exception.  Is there a better way to enter negative timeZoneOffsets?




The added or subtracted value results in an un-representable DateTime.
Parameter name: value

Description: Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime.
Parameter name: value

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime.Parameter name: value]   System.DateTime.AddTicks(Int64 value) +7658243   Telerik.Web.UI.RadScheduler.UtcToDisplay(DateTime utcDate) +46   Telerik.Web.UI.AdvancedTemplate.PrefillRecurrenceControls() +68   Telerik.Web.UI.AdvancedTemplate.CreateControls(Control container) +68   Telerik.Web.UI.AdvancedTemplate.InstantiateIn(Control container) +78   Telerik.Web.UI.RadScheduler.CreateHiddenAdvancedInsertForm(Control container) +221   Telerik.Web.UI.RadScheduler.CreateHiddenAdvancedForms() +102   Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +339   Telerik.Web.UI.RadScheduler.CreateChildControls() +10   System.Web.UI.Control.EnsureChildControls() +87   System.Web.UI.Control.PreRenderRecursiveInternal() +44   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
            
brijesh
Top achievements
Rank 1
 answered on 23 Nov 2010
3 answers
214 views
hi all,
i designed an asp:updatepanel within that some RadDatePicker control is there. Now the problem is if i run the page then i didnt see the calender styles. if i removed the update panel then i can see the styles of the RadDatePicker.

how to solve this problem? experts please help me.

please look on the attached screen shot
SamJ
Top achievements
Rank 1
 answered on 23 Nov 2010
1 answer
79 views
I have a page with a radgrid on it.  The grid gets loaded with different datasets from code behind.  Is there a way to set default filters for dynamically added columns?  From what I read, this is not supported.
SamJ
Top achievements
Rank 1
 answered on 23 Nov 2010
0 answers
114 views
not
Hello,
       Ive Created rad-combobox in code-behind (.cs file) and assign "RadComboBoxItem" collection through dataset.
Like - 

public void PopulateDROPDOWN(RadComboBox drp,string dataval,string datatxt,string selected,string strSQL)
        {
            DataSet objdr;
            RadComboBoxItem mylist;
            try
            {
                objdr=GetDataSet(strSQL);
                drp.Items.Clear();
                mylist = new RadComboBoxItem();
                mylist.Value = "0";
                mylist.Text = "Select";
                if (selected == null)
                {
                    mylist.Selected = true;
                }
                drp.Items.Add(mylist);
                foreach (DataRow myDatarow in objdr.Tables["cnpl"].Rows)
                {
                    mylist = new RadComboBoxItem();
                    mylist.Value = myDatarow[dataval].ToString();
                    mylist.Text = myDatarow[datatxt].ToString();
                    if (selected ==myDatarow[dataval].ToString())
                    {
                        mylist.Selected = true;
                         
                    }
                    drp.Items.Add(mylist); 
                }
            }
            catch
            {
                drp.Items.Clear();
                mylist = new RadComboBoxItem();
                mylist.Text = "Error";
                mylist.Value = "Error";
                drp.Items.Add(mylist);
            }
        }

But when I used foll. code to get selectedValue from combobox , it gives selectedText.
string val = FRM.Page.Request["radCombo_drp"];

In above code,  val = selectedText.
I want to assign val = selectedValue

Please Help,
Thanks in advance... 
Abhi Shinde
Top achievements
Rank 1
 asked on 23 Nov 2010
3 answers
125 views
Hi,

I need to have a dropdown in the titlebar of my "Weather" dock widget and have it sending city values to my custom "Weather" control.
I am struggling to pass the slected value to my ObjectDataSource's ControlID. Is my request possible at all?

The dropdown works fine inside the Weather control but will look much better if its part of the dock's titlebar.

<telerik:RadDock ID="Weather" Runat="server" Width="300px" Skin="MyCustomSkin" EnableEmbeddedSkins="false" 
                                            EnableRoundedCorners="True" BackColor="#F3F3F3" 
BorderStyle="None" Title="Weather" AutoPostBack="True"  >
  
  
                                       <ContentTemplate>
                                                     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <ContentTemplate
        
  
        <%-- INCLUDE CONTENT - WEATHER --%>
                           
                                        <content:Weather ID="Weather1" runat="server"></content:Weather></ContentTemplate>  
     </asp:UpdatePanel>
                                       </ContentTemplate>
                                    </telerik:RadDock>
  
  
  
  
<asp:XmlDataSource ID="XmlWeather" runat="server"></asp:XmlDataSource>
                                               <telerik:RadComboBox ID="CityList" Runat="server" AutoPostBack="true">
                                               <Items>
                                               <telerik:RadComboBoxItem Text="Bloemfontein" Value="Bloemfontein"  />
                                               <telerik:RadComboBoxItem Text="Cape Town" Value="Cape Town"/>
                                               <telerik:RadComboBoxItem Text="Durban" Value="Durban"/>
                                               <telerik:RadComboBoxItem Text="East London" Value="East London"/>
                                               <telerik:RadComboBoxItem Text="Johannesburg" Value="Johannesburg"/>
                                               <telerik:RadComboBoxItem Text="Nelspruit" Value="Nelspruit"/>
                                               <telerik:RadComboBoxItem Text="Pietermaritzburg" Value="Pietermaritzburg"/>
                                               <telerik:RadComboBoxItem Text="Polokwane" Value="Polokwane"/>
                                               <telerik:RadComboBoxItem Text="Port Elizabeth" Value="Port Elizabeth"/>
                                               <telerik:RadComboBoxItem Text="Pretoria" Value="Pretoria"/>
                                               </Items>
  
  
  
<asp:ObjectDataSource ID="WeatherFeed" runat="server" 
    SelectMethod="GetForecast" TypeName="xxx.Controls.Conditions">
    <SelectParameters>
        <asp:ControlParameter ControlID="CityList" Name="location" 
            PropertyName="SelectedValue" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>
 
khathu
Top achievements
Rank 1
 answered on 23 Nov 2010
0 answers
61 views
I use RadCombobox , when event value change happen, It lost my embeded or linked css when I turn on Support Parital Rendering on ascx control of Dotnetnuke portal.
If I turn off Support Parital Rendering. It's OK.
So How can I fix it!
ken
Top achievements
Rank 1
 asked on 23 Nov 2010
2 answers
159 views
Hi all,

protected void btnSignUp_Click(object sender, EventArgs e)
        {
            try
            {
                
                string guid = System.Guid.NewGuid().ToString();
                System.Guid g = new Guid(guid);
                string txtName = (fvwSignUp.Row.FindControl("txtName") as TextBox).Text;
                string txtEmail = (fvwSignUp.Row.FindControl("txtEmail") as TextBox).Text;
                string txtPassword = (fvwSignUp.Row.FindControl("txtPassword") as TextBox).Text;
                string rcbGender = (fvwSignUp.Row.FindControl("rcbGender") as RadComboBox).SelectedValue;
               // DateTime rdpDate = (fvwSignUp.Row.FindControl("rdpDate") as RadDatePicker).SelectedDate;
         
                  
                strConnection = ConfigurationManager.ConnectionStrings["pfms"].ConnectionString;
                dbConn = new SqlConnection(strConnection);
                dbConn.Open();
                SqlCommand da = new SqlCommand("insert into SignUp values(@UserID,@UserName,@Email,@Password,@Gender,@BirthDate)", dbConn);
               da.Parameters.Add("@UserID", SqlDbType.VarChar, 200).Value =guid;
                da.Parameters.Add("@UserName", SqlDbType.VarChar).Value = txtName;
                da.Parameters.Add("@Email", SqlDbType.VarChar).Value = txtEmail;
                da.Parameters.Add("@Password", SqlDbType.VarChar).Value = txtPassword;
                da.Parameters.Add("@Gender", SqlDbType.Int).Value = rcbGender;
                SqlParameter p1 = da.Parameters.Add("@BirthDate", SqlDbType.DateTime);
                p1.Value = rdpDate.Value;
               // DateTime dMyDate = rdpDate.Value;
  
                da.ExecuteNonQuery();
                fvwSignUp.ChangeMode(FormViewMode.ReadOnly);
                 
            }
  
            finally
            {
  
                if (dbConn != null)
                {
                    dbConn.Close();
                    bindData();
                }
            }
 I have an error msg show that:-
Error 5 The name 'rdpDate' does not exist in the current context 

if i declare this radDatePicker, another error msg will display which is:-

Error 5 'System.DateTime' does not contain a definition for 'Value' and no extension method 'Value' accepting a first argument of type 'System.DateTime' could be found (are you missing a using directive or an assembly reference?) 


Any help is appreciated....

Best regards,
Nasri
Arteta Sam
Top achievements
Rank 1
 answered on 23 Nov 2010
2 answers
70 views
I have 2 RadTextBox controls that I want to flow one after the other on a page if there is room.  They work correctly until I ajaxify them, then they line up, the second one below the first (even though there is room on the page for them to be side by side.
The only difference I see in the HTML code as it runs is that the ajaxified controls are each wrapped with an additional <div >.

 

<telerik:RadTextBox ID="rtbIncidentStartTime" runat="server" ReadOnly="true" BackColor="#F8F8F8" Label="Incident Start Time" Width="310px">

 

 

</telerik:RadTextBox>&nbsp&nbsp

 

 

<telerik:RadTextBox ID="rtbIncidentRestoreTime" runat="server" ReadOnly="true" BackColor="#F8F8F8" Label="Incident Restore Time" Width="310px">

 

 

</telerik:RadTextBox><br />

How do I get the ajaxified controls to behave like the non-ajaxified  version?

 

Michael
Top achievements
Rank 1
 answered on 22 Nov 2010
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
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
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?