Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
56 views
I have run into a problem where I am doing a databind and it causes invalid postback errors in the system events log.  I am doing the rebind to change the appearance of the grid. i.e. turn of sort, display on line in grid not 20, hide a couple columns etc..   I am not changing the underlying data that has been selected.   Calling the databind sometime causes errors. Is there a way to refresh the appearance of the grid without using the databind?

RadGrid1.AllowSorting = false;                      // Turn off column sorting when in Display mode
RadGrid1.Columns[c1ASelectFile].Visible = false;    // Hide "Select View" Column
RadGrid1.Columns[c1APrintFile].Visible = false;     // Hide "Print" Column
RadGrid1.ClientSettings.Resizing.AllowColumnResize = false;
RadGrid1.ClientSettings.Resizing.ResizeGridOnColumnResize = false;
RadGrid1.ClientSettings.Resizing.ClipCellContentOnResize = false;
RadGrid1.ClientSettings.AllowColumnsReorder = false;
 
RadGrid1.CurrentPageIndex = iRecord;                // Set document to display
RadGrid1.PageSize = 1;                              // Set to one record per page when displaying document
RadGrid1.DataBind();

Event error being generated.

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 10/31/2011 3:43:14 PM
Event time (UTC): 10/31/2011 10:43:14 PM
Event ID: e83be8bc2dcb4fac96c0f6d752826fe9
Event sequence: 2063
Event occurrence: 5
Event detail code: 0
  
Application information:
    Application domain: /LM/W3SVC/1/Root/SpeechRecords-1-129645654292996087
    Trust level: Full
    Application Virtual Path: /SpeechRecords
    Application Path: C:\WebSite\SpeechRecords\
    Machine name: SVRTEONLINE
  
Process information:
    Process ID: 97572
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
  
Exception information:
    Exception type: ArgumentException
    Exception message: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
  
Request information:
    Request path: /SpeechRecords/Records.aspx
    User host address: 192.168.1.131
    User: 
    Is authenticated: False
    Authentication Type: 
    Thread account name: NT AUTHORITY\NETWORK SERVICE
  
Thread information:
    Thread ID: 1
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
   at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  
  
Custom event details:
 
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Pavlina
Telerik team
 answered on 07 Nov 2011
2 answers
74 views
Hi Telerik Team,

Can anyone help me on my below query:

I want to display "RadGrid" in "RadTabStrip" which will be in "RadPane" of "RadSplitter" control.
i have done this but i cant see the Grids in "RadTab".
Please provide me the proper code.

Thanks and Regards,
Simon.
Dobromir
Telerik team
 answered on 07 Nov 2011
1 answer
105 views
Hi All,
I am using RadSplitter and it contents RadPane. I want to show loading image during pane's page load.I read the artile-
http://demos.telerik.com/aspnet-ajax/splitter/examples/showcontentduringload/defaultcs.aspx
and it works fine, but I have a concern In my case the size of pane is very large and RadSplitter don't have any scroll bar but page have, so the loading image  appear very down of the page. Can we set the position of that loading image of pane on top portion of RadPane.
Thanks..
Dobromir
Telerik team
 answered on 07 Nov 2011
1 answer
107 views
Hi all,

In my code behind I'm setting a string behaviour for the items in my grid in the radgrid item created event.  I want to be able to the following client side in jscript.

TextBox txtBox = (TextBox)dataItem.FindControl("rtbDIN");
              TextBoxSetting stringSetting = (TextBoxSetting)RadInputManager1.GetSettingByBehaviorID("StringBehavior");
              stringSetting.TargetControls.Add(new TargetInput(txtBox.UniqueID, true));

Any ideas / input ?

Thanks,
Jim
Jim
Top achievements
Rank 1
 answered on 07 Nov 2011
2 answers
115 views
I've got a combobox that I want to place focus into the box and have it ready for a person to enter in the next item after they hit the add button. So, the person starts typing the item information, and it finds the match in the drop down, they hit tab and enter to add the item, and the focus then needs to go back to the textbox for them to enter the next item. However, I don't want to clear out the entry of the combobox.

Originally, I was calling combo.focus in the code behind. That seems to set the focus correctly, but it could place the cursor at the beginning or the end and doesn't select all the text for them to be able to simply start typing again. I've resorted to use this code instead:

ajxManager.ResponseScripts.Add("$find('" & cboFrom.ClientID & "').get_inputDomElement().focus();$find('" & cboFrom.ClientID & "').selectText(0, $find('" & cboFrom.ClientID & "').get_text().length);")

It appears to be working, but I just want to know if there is a better method for doing this or if what I have is the best route to go down.

Thanks,
Adam
Ivana
Telerik team
 answered on 07 Nov 2011
2 answers
42 views
Hello,

I am very new to Telerik. So I apologize if this is a silly question... but, I have been looking at the forum and I am unable to find the right solution for my problem. I need to display a list of documents in a grid that is coming from DataSource1(DS1). Once the user selects a row in edit mode (He may choose to change an original field or not...), I need to insert or update the row in another DataSource2(DS2). I was able to successfully display the list from DS1 and bring the edit mode. In the code behind, I wrote an updateCommand method where I would take the editable values and send them to my store procedure in DS2. The issue I am facing is. I am not able to retrieve the field I modify on my form. It is retirving the original one displayed from DS1. How do I retrieve the value I modified on the screen and send it to my code behind? Bellow a snnipets of my code.

<

 

 

telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" PageSize="10"

 

 

 

AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnUpdateCommand="RadGrid1_UpdateCommand"

 

 

 

OnDataBound="RadGrid1_DataBound">

 


....

<

 

 

asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:GCOM %>"

 

 

 

ProviderName="System.Data.OracleClient" SelectCommand="Select * from GA_DOC D, GA_DOC_Evidence E, GA_Evidence Ev

 

where D.DOC_ID = E.DOC_ID (+)

and E.EVIDENCE_ID = Ev.EVIDENCE_ID (+)

and LIVE_DATE is not null

and ARCHIVE_DATE is null

and DOC_TYPE_ID = 3"

 

 

OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues">

 


....

protected

 

 

void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 

{

 

 

GridEditableItem item = (GridEditableItem)e.Item;

 

 

 

String documentId = item.GetDataKeyValue("DOC_ID").ToString();

 

 

 

String title = item.GetDataKeyValue("TITLE").ToString();

 

 

 

String price = item.GetDataKeyValue("SALE_PRICE").ToString();

 

 

 

SqlConnection conn = null;

 

 

 

SqlDataReader rdr = null;

 

conn =

 

new SqlConnection(ConfigurationManager.ConnectionStrings["FTPFactoryConnStr"].ConnectionString);

 

 

 

try

 

{

 

 

//Open the connection and save data on Application's SQL DB.

 

conn.Open();

 

 

SqlCommand cmd = new SqlCommand(ConfigurationManager.AppSettings["ADDCONTROLFILE"].ToString(), conn);

 

cmd.CommandType =

 

CommandType.StoredProcedure;

 

cmd.Parameters.Add(

 

new SqlParameter("@FTPAction", "N"));

 

cmd.Parameters.Add(

 

new SqlParameter("@ExpirationDate", new DateTime(DateTime.Now.Ticks + 2).ToString("yyyyMMdd")));

 

cmd.Parameters.Add(

 

new SqlParameter("@ResearchId", Convert.ToInt32(documentId)));

 

cmd.Parameters.Add(

 

new SqlParameter("@Ticker", "abc"));

 

cmd.Parameters.Add(

 

new SqlParameter("@PPVDocumentPrice", price));

 





Thank you!
Mariella.  
Mariella
Top achievements
Rank 1
 answered on 07 Nov 2011
1 answer
72 views
I'm trying to set up a 'lazy spool', background-cache type system in a very large menu which loads its items from a webservice.
when a menu item opens (and populates its items from a webservice), I'd like to catch the Populated event for that item, and iterate the loaded items and force a populate on them in the background.

I thought calling get_items() would initiate the webservice call - but it doesn't seem to. Open is the only thing which seems to start the webservice request.

Is this technically possible?

function TelerikMenu_OnClientItemPopulated(sender, eventArgs) {
        var items = eventArgs.get_item().get_items();
        for (var i = 0; i < items.get_count(); i++) {
            var item = items.getItem(i);
            if (item != null) {
                item.get_items();
            }
        }
 
}
Andrew
Top achievements
Rank 1
 answered on 07 Nov 2011
2 answers
86 views
I have a grid that looks roughly like this:
<telerik:RadGrid ID="grdItem" runat="server" secure="Estimate" AutoGenerateColumns="false" OnItemCreated="grdItem_ItemCreated" mapping="TEST" errorImageField="imgGridError" errorTextField="txtGridError" OnDataBound="grdItem_DataBound">
<MasterTableView>
<SortExpressions>
<telerik:GridSortExpression FieldName="ITEM_NUM" SortOrder="Descending" />
</SortExpressions>
<Columns>
<telerik:GridTemplateColumn HeaderText="BOGUS_HEADER" UniqueName="Item_QuantityHeader" SortExpression="Item_QuantityHeader" ItemStyle-Width="50">
<ItemTemplate>
                                &nbsp;
                                </ItemTemplate>
</telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="BOGUS_HEADER" UniqueName="Item_UnitPriceHeader" SortExpression="Item_UnitPriceHeader" ItemStyle-Width="100">
                        <ItemTemplate>
                                        &nbsp;
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>

I am adding text boxes to columns in the code behind like this:

protected void grdItem_ItemCreated(object sender, GridItemEventArgs e)
{
    try
    {
        if (e.Item.DataItem != null && e.Item is GridDataItem)
        {
            CE_ESTIMATE_ITEM tempDataItem = (CE_ESTIMATE_ITEM)e.Item.DataItem;
            GridDataItem tempItem = (GridDataItem)e.Item;
            TextBox quantityBox = new TextBox();
            quantityBox.TextChanged += new System.EventHandler(quantityChanged);
            quantityBox.AutoPostBack = true;
            quantityBox.Width = 50;
            quantityBox.Style.Add("text-align", "right");
            quantityBox.Text = Convert.ToString(tempDataItem.QUANTITY);
            quantityBox.TabIndex = tabOrder++;
            tempItem["Item_QuantityHeader"].Controls.Add(quantityBox);
            quantityBox.Attributes.Add("onchange", "javascript:alert('Got a change')");
            ajaMain.AjaxSettings.Add(new AjaxSetting(quantityBox.UniqueID));


            TextBox unitPriceBox = new TextBox();
            unitPriceBox.TextChanged += new System.EventHandler(quantityChanged);
            unitPriceBox.AutoPostBack = true;
            unitPriceBox.Width = 100;
            unitPriceBox.Style.Add("text-align", "right");
            unitPriceBox.Text = Convert.ToString(tempDataItem.UNIT_PRICE);
            unitPriceBox.TabIndex = tabOrder++;
            tempItem["Item_UnitPriceHeader"].Controls.Add(unitPriceBox);
            ajaMain.AjaxSettings.Add(new AjaxSetting(unitPriceBox.UniqueID));
        }
    }
    catch (Exception ex)
    {
        Debug.WriteLine(ex.Message);
        Debug.WriteLine(ex.StackTrace);
        Gadgets.writeLogEntry(ex.Message, 0);
        Gadgets.writeLogEntry(ex.StackTrace, 0);
        Response.Redirect("../General/Error.aspx");
    }
}

The text boxes are created,as expected, but no matter what I try, I can't get the TextChanged call to be an AJAX call; it always functions as a postback.  The postback causes these text boxes to disappear and even if they weren't dynamically created but rather, were created in ASPX, the tab order would be lost.

I have tried using an AjaxManager, as you see here, and enclosing the entire RadGrid in a RadAjaxPanel; neither attempt worked.

My RadAjaxManagerASPX looks like this:

    <telerik:RadAjaxManager ID="ajaMain" runat="server" DefaultLoadingPanelID="pnlAjaxLoading"> 
        <AjaxSettings> 
          <telerik:AjaxSetting AjaxControlID="grdItem"> 
            <UpdatedControls> 
              <telerik:AjaxUpdatedControl ControlID="grdItem" LoadingPanelID="pnlAjaxLoading"> </telerik:AjaxUpdatedControl>
              <telerik:AjaxUpdatedControl ControlID="ajaMain" LoadingPanelID="pnlAjaxLoading"> </telerik:AjaxUpdatedControl>
            </UpdatedControls> 
          </telerik:AjaxSetting>
          <telerik:AjaxSetting AjaxControlID="ajaMain"> 
            <UpdatedControls> 
              <telerik:AjaxUpdatedControl ControlID="grdItem" LoadingPanelID="pnlAjaxLoading"> </telerik:AjaxUpdatedControl>
              <telerik:AjaxUpdatedControl ControlID="ajaMain" LoadingPanelID="pnlAjaxLoading"> </telerik:AjaxUpdatedControl>
            </UpdatedControls> 
          </telerik:AjaxSetting>
        </AjaxSettings> 
      </telerik:RadAjaxManager>
      <telerik:RadAjaxLoadingPanel ID="pnlAjaxLoading" runat="server" Visible="false"/>

Any help or hints you can provide would be great.  I would much rather not have to code my own XMLHTTPRequest calls.
Tsvetina
Telerik team
 answered on 07 Nov 2011
9 answers
442 views
RadDatePicker is not displaying the popup image at page post back only text is displaying in Google Chrome but its working in FireFox.
 RadDatePicker is used in a page inherited from master page.
Andrey
Telerik team
 answered on 07 Nov 2011
1 answer
109 views
We are currently using RadControls for ASP.NET (not AJAX) Q1 2009, and upgrading is not yet feasible. We are trying to make the following charts more legible by using IntelligentLabelsEnabled, but the firs chart (all.png) seems to create and infinite loop when using it and the second does not show all datapoints. Is there anything that can be done aside from upgrading?
Evgenia
Telerik team
 answered on 07 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?