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

I am getting a strange error when I try to insert records on a sub radgrid and I still have one other to build in yet.  What happens is that it grabs all the fields and inserts into the database just fine, but when it rebinds it tells me that the intPositionId from the sub table does not exist.  The following is the error that it gieves me.  This is the PK of of sub table and is inserted fine, like I said its just on rebinding of the table that it goes whacky, but if I leave page and come back normal everything I inserted is there and it works just fine.  It has something to do with the postback and rebind.  If I take out postback rebind it works just fine but then the data inserted is not there.


if (e.CommandName == RadGrid.PerformInsertCommandName && e.Item.OwnerTableView.Name == "Positions")
       {
           GridEditableItem item = e.Item as GridEditableItem;
           GridDataItem parentItem = e.Item.OwnerTableView.ParentItem;
           //int sectionId = Convert.ToInt32(item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["intSectionId"]);
           int secId = Convert.ToInt32(parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["intSectionId"]);
           TextBox descrip = (TextBox)item.FindControl("txtdescription");
           TextBox scale = (TextBox)item.FindControl("txtScale");
           TextBox posType = (TextBox)item.FindControl("txtPosType");
           TextBox grade = (TextBox)item.FindControl("txtGrade");
 
           sql = "Execute usp_InsertPosition " + secId + ", '" + c.SanitizeString(descrip.Text) + "', '" + c.SanitizeString(scale.Text) + "', '" + c.SanitizeString(posType.Text) + "', '" + c.SanitizeString(grade.Text) + "'";
 
           c.InsertUpdateDelete(sql);
           myradGrid.Rebind();  """"""If I remove works fine but in sub grid gives below error.
       }


intPositionId is neither a DataColumn nor a DataRelation for table .
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.ArgumentException: intPositionId is neither a DataColumn nor a DataRelation for table .
 
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:
 
 
[ArgumentException: intPositionId is neither a DataColumn nor a DataRelation for table .]
   System.Data.DataRowView.get_Item(String property) +1353926
   Telerik.Web.UI.GridTableView.PopulateDataKey(Object dataItem, DataKey key, String name) +86
   Telerik.Web.UI.GridTableView.PopulateDataKeys(Object dataItem) +194
 
[GridException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.]














































Princy
Top achievements
Rank 2
 answered on 10 Jun 2014
3 answers
401 views
How can I redirect the user to a required page on radalert. This is my radalert

string scriptstring = "radalert('You must save Location for Employee..', 250, 80,'Information');";
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);
Here after clicking Ok I would like to redirect the user to that particular page can some one help me
Shinu
Top achievements
Rank 2
 answered on 10 Jun 2014
8 answers
134 views
Hello, I have created a web part using a RadScheduler and have followed all the instructions to add RadAjaxManager support for the scheduler.

This all works fine but I have noticed an issue with the advanced edit/insert form.

The scheduler is configured to use the advanced form (StartInsertingInAdvancedForm) and when I double click a time slot, the advanced editor opens up.

However, if a user forgets to enter text in the Subject textbox and clicks Save, the Subject textbox border changes to red to prompt the user to enter the subject text. But once this has happened, clicking on Save, Cancel or the X to close the advanced edit form has no effect at all. Nothing happens. And due to the modal nature of the advanced edit form, the only way to go back to the scheduler itself is to refresh the page, losing any changes the user has made.

I have tested this without the AjaxManager and this issue does not appear - so must be to do with ajaxifying the scheduler.

Any ideas why this might happen?

Thanks,
Jonathan
Plamen
Telerik team
 answered on 10 Jun 2014
1 answer
386 views
Hai All I am new to telerik i have a Radbutton when i click on button it will do some operation and at the same time it will show radwindow with yes and no buttons if you 
click on yes it will show alert message saved sucessfully when i click on ok it will go to another page 

Exmple:

<asp:Button ID="Button1" runat="server" Text="Save" CssClass="btnSaveForm" OnClick="btnTotalaSave_Click" />
        
Shinu
Top achievements
Rank 2
 answered on 10 Jun 2014
1 answer
71 views
Hello, 
I was wondering if the listbox drag and drop functionality would be good for the following scenario: building a toy.

The source listbox will contain items (e.g. toy components) that can be double-clicked or dragged over to the destination listbox. 
The destination listbox will contain all the items needed to build the toy. There can be one or more items from the source listbox that can be added to the destination listbox. 

For example: Building a car. 
- in source listbox select the wheels and drag it to the destination listbox. 
- the wheels in the source listbox should still be there for me to re-select it again and drag it to the destination listbox because a car needs two sets of wheels. 
- if we wanted, we can drag another set of wheels to the car.

Question:
is there a setting where i drag and drop but have the item not being removed in the source listbox so I can keep on selecting and dragging it over to the destination listbox?
or is this something that i need to do client-side or server-side?
thanks for the help.
mike
Top achievements
Rank 1
 answered on 10 Jun 2014
3 answers
2.0K+ views
In my ASP.NET 4.0 project, I have many RadWindow-powered dialog boxes that are defined like this partial code example:

<telerik:RadWindow ID="rwChangePassword" runat="server" Behaviors="Close,Move" EnableShadow="true" VisibleStatusbar="false" VisibleTitlebar="true" AutoSize="true" Modal="true">
  <ContentTemplate>
    <div class="dialogMain smallText" style="width:330px">
      <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
          <div style="margin:10px 0 0 5px">
            <div style="width:95%">
              Please enter the user's new password, enter it a second time to confirm, and then press OK:
            </div>
            .
            .
            .

To turn them on/off I use server-side code like this:

public bool ModalDialogIsActive
{
  get
  {
    return Convert.ToBoolean(ViewState["ModalDialogIsActive"]);  // Note: Returns 'false' if the value is 'null'
  }
 
  set
  {
    if (value)
      Website.Common.ShowDialog(rwChangePassword);
    else
      Website.Common.HideDialog(rwChangePassword);
 
    ViewState["ModalDialogIsActive"] = value;
  }
}

That all works fine.  But now I'm trying to introduce a title to such a dialog, which I will dynamically generate depending on various factors.  For example, for the Change Password dialog box above, I might have a title like "Changing Password for John Smith".

I tried doing this by simply setting the Title property of the RadWindow before activating the dialog box.  Here's an example:

rwChangePassword.Title = "Changing Password for " + userName;
ModalDialogIsActive = true;

This didn't work though.  No matter what I tried, the title always remained blank.

So how does one dynamically set the Title of a RadWindow?

Robert



Raj
Top achievements
Rank 1
 answered on 09 Jun 2014
1 answer
83 views

I have copy this data into editor
" <div itemscope itemtype="http://data-vocabulary.org/Review-aggregate">    <span itemprop="itemreviewed">Pizza Amorata</span>    <img itemprop="photo" src="pizza.jpg" />    <span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating">      <span itemprop="average">9</span>      van <span itemprop="best">10</span>    </span>    op basis van <span itemprop="votes">24</span> beoordelingen.  </div>    "

then i look in the source of my website and see this:
<div ? itemtype="http://data-vocabulary.org/Review-aggregate"><span itemprop="itemreviewed">SiteToGo websites</span><img alt="" itemprop="photo" src="http://www.webaan.nl/pizza.jpg" /><span itemprop="rating" itemtype="http://data-vocabulary.org/Rating"><span itemprop="average">9</span>van <span itemprop="best">10</span></span>op basis van <span itemprop="votes">24</span> beoordelingen.</div>

there is a difference. the word 'itemscope' in the first line is removed.
I got this content from using this method
Editor.Content

Please resolve this issue

 

 

Ianko
Telerik team
 answered on 09 Jun 2014
1 answer
66 views
In FF and IE, when you've entered as many list items as you want, you can hit enter to 'end' the list. In Chrome, hitting enter has no effect.

Example:
Go to the Telerik demo editor,
remove all the content,
click the 'numbered list' or 'bullet list' toolbar button to start a new list,
type some text for the first item in the list,
hit enter to move to the second line in the list,
now hit enter again to finish the list

in Chrome, nothing happens; in FF and IE, the list is ended and the cursor is moved down.

Could we have Chrome work the same as the other browsers?  Thanks.

Trevor.
Ianko
Telerik team
 answered on 09 Jun 2014
1 answer
140 views
I'm dynamically populating an UpdatePanel within a ModalPopupExtender'd panel with a RadEditor.

RadEditor tbQuestion = new RadEditor();
tbQuestion.ID = "tbQuestion";
tbQuestion.Skin = "Default";
cell.Controls.Add(tbQuestion);

When the control loads, all the images appear, but none of them are clickable except the three at the bottom which control which view the editor is displaying (Design, HTML, Preview).  The rest of the images have alt text.

There is no textbox displayed at all unless RenderAsTextArea == true, but then it doesn't display any formatting.  If I manually show the textareas generated whose style display is set to "none" via Chrome's Developer Tools, they show up but again, don't have any formatting.

Per the pinned thread from 2011, I've added

<Telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadEditor), "Telerik.Web.UI.Skins.Editor.css") %>'
        rel="stylesheet" type="text/css" />
    <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadEditor), "Telerik.Web.UI.Skins.Default.Editor.Default.css") %>'
        rel="stylesheet" type="text/css" />
    <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadWindow), "Telerik.Web.UI.Skins.Window.css") %>'
        rel="stylesheet" type="text/css" />
    <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadWindow), "Telerik.Web.UI.Skins.Default.Window.Default.css") %>'
        rel="stylesheet" type="text/css" />
</Telerik:RadCodeBlock>

to my Default.aspx page, but nothing has changed.

Thanks for your help!
-Jordan
Ianko
Telerik team
 answered on 09 Jun 2014
7 answers
896 views
According to details here: http://www.telerik.com/help/aspnet-ajax/grid-getting-cell-values-for-selected-rows-client-side.html 
in client side code I should be able to access the value of a grid cell by looking at innerHTML (and presumably innerText).
However, when I try that with cells that are editable, the cell contains data *and* hidden controls for when the row is in edit mode.

A the innerText of a cell that is in a GridDateTimeColumn willl contain
"6/12/2014\r\nRadDatePicker \r\nOpen the calendar popup.\r\n"
instead of simply "6/12/2014".
I can write a routine that parses out the values I want, but isn't there something in the Telerik client-side API that will do this?

Example:
In this client-side code, the date parsing fails because the innerText is not just the date.

function ValidateRow(rowIndex) {
 
    var rowData;
    var objCell;
    var val;
    var mtv;
    var bContinue = true;
    try {
        mtv = $find('ctl00_ContentPlaceHolder1_TestGrid').get_masterTableView();
        rowData = mtv.get_dataItems()[rowIndex];
    } catch (e) {
        bContinue = false;
    }
 
 
    // Validate Implemented Date --------------------------------------------------------------------
 
    var validDate = true;
    if (bContinue) {
        try {
            objCell = rowData.get_cell('ImplementedDate');
            val = objCell.innerText;
            var completetionDate = Date.parse(val);
...
...
...



Thanks!
-Matt


Matt
Top achievements
Rank 1
 answered on 09 Jun 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?