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

I have got a page with several dynamically loaded user controls. Each of the controls has an RadAjaxPanel inside.

The page by itself does not contain any AjaxPanels. Controls are being added each time the page is requested (get or post) in PageInit.

If I click a button on a page and inside the server side ButtonClick try to remove all dynamically added controls and then add them back, I get an exception of this type later on during the PreRender:

Object reference not set to an instance of an object. at Telerik.Web.UI.RadAjaxControl.OnPagePreRender(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Control.OnPreRender(EventArgs e)

Regards,
Konstantin
Konstantin
Top achievements
Rank 1
 answered on 01 Apr 2008
2 answers
117 views
Hi,

I m using client side code to move nodes from one tree to another.
My code here:

treeSrc.trackChanges();

treeDst.trackChanges();

var count = selectedNodes.length;

for(var i = 0; i < count; i++)

{

treeSrc.get_nodes().remove(selectedNodes[i]);

treeDst.get_nodes().add(selectedNodes[i]);

}

treeSrc.commitChanges();

treeDst.commitChanges();
...


When I work with several tree nodes it seems ok. However once I try to move 50 nodes at the same time it stucks for approximately 10sec!

Is there any problem with my code? Or some tips for this issue?

Regards,
Elton

Elton
Top achievements
Rank 1
 answered on 31 Mar 2008
0 answers
73 views
I have pagging enabled for my RadGrid, when I select the next page, the control moves to the next page but adds two additional coulums with the following data in them: System.Data.DataRowView

My code is below:

protected

void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

}

}

protected void Page_PreRender(object sender, EventArgs e)

{

this.BuildGrid();

}

protected void Page_Init(object source, System.EventArgs e)

{

}

private void BuildGrid()

{

GridBoundColumn boundColumn;

boundColumn = new GridBoundColumn();

boundColumn.DataField = "CountryId";

boundColumn.HeaderText = "Country Number";

this.RadGrid1.MasterTableView.Columns.Add(boundColumn);

boundColumn = new GridBoundColumn();

boundColumn.DataField = "CountryName";

boundColumn.HeaderText = "Country Name";

this.RadGrid1.MasterTableView.Columns.Add(boundColumn);

RadGrid1.Width = Unit.Percentage(50);

RadGrid1.PageSize = 50;

RadGrid1.AllowPaging = true;

RadGrid1.PagerStyle.Mode = Telerik.Web.UI.GridPagerMode.NextPrevNumericAndAdvanced;

RadGrid1.AutoGenerateColumns = false;

RadGrid1.ShowStatusBar = true;

RadGrid1.Skin = "Web20";

RadGrid1.ShowStatusBar = true;

RadGrid1.GridLines = GridLines.Horizontal;

RadGrid1.HorizontalAlign = HorizontalAlign.Left;

RadGrid1.ShowFooter = true;

RadGrid1.ShowHeader = true;

RadGrid1.ShowStatusBar = true;

RadGrid1.AllowSorting = true;

RadGrid1.Visible = true;

this.RadGrid1.DataSource = this.GetData();

this.RadGrid1.DataBind();

}

private DataSet GetData()

{

SqlConnection sqlConnection = new SqlConnection();

SqlCommand sqlCommand = new SqlCommand();

SqlParameter sqlParameter = new SqlParameter();

DataSet dataSet = new DataSet();

try

{

if (sqlConnection.State != ConnectionState.Open)

{

sqlConnection.ConnectionString = SqlConnectionString.GetConnectionString();

sqlConnection.Open();

}

sqlCommand.Connection = sqlConnection;

sqlCommand.CommandType = CommandType.StoredProcedure;

sqlCommand.CommandText = ApplicationStoredProcedures.GetCountries();

sqlCommand.Parameters.Add("@WebPageName", SqlDbType.NVarChar).Value = "Authors.aspx";

sqlCommand.Parameters.Add("@CultureCode", SqlDbType.NVarChar).Value = "en-US";

sqlCommand.Parameters.Add("@ControlName", SqlDbType.NVarChar).Value = "ddlCountry";

sqlCommand.ExecuteNonQuery();

SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);

sqlDataAdapter.Fill(dataSet);

return dataSet;

}

catch (SqlException sql)

{

throw sql;

}

catch (Exception ex)

{

throw ex;

}

finally

{

if (sqlConnection.State != ConnectionState.Closed)

{

sqlConnection.Close();

}

sqlCommand.Dispose();

}

}

public void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)

{

this.RadGrid1.CurrentPageIndex = e.NewPageIndex;

}

/// <summary>

/// You can get the exact numbers of rows in your RadGrid either directly from the DataSource or in the following manner in the ItemDataBound event:

/// </summary>

/// <param name="sender"></param>

/// <param name="e"></param>

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)

{

if (e.Item is GridPagerItem)

{

Label1.Text = (e.Item as GridPagerItem).Paging.DataSourceCount.ToString();

}

}

 

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

{

// RadGrid1.DataSource = this.GetData() ;

}

I cannot find the issue. Am I doing something wrong.

R Brown
Top achievements
Rank 1
 asked on 31 Mar 2008
1 answer
159 views
We are experiencing a major road block. Our content creators are being trained to click on the "Save and Stop Editing" option in the Page menu once they are finished creating page content. However, whatever content they create using the RadEditor is lost. They are forced to click on either "OK" or "Apply" in the tool pane in order for their content to be saved within the RadEditor control. This is, as they put it, "a deal breaker" in terms of using Telerik's RadEditor control. We need a way for the control to update using MOSS's standard "Save and Stop Editing" functionality. Thank you in advance.
Lini
Telerik team
 answered on 31 Mar 2008
5 answers
911 views
I have a group of approx 20 radNumericTextBox on one screen.  I need them all to show three digits of precision.  So need them to show values like:

0.123
0.120
0.100
0.321
0.320
0.300

I have tried everything I can think of to get that display.  First setting the DecimalDigits to 3 and setting the radNumericTextBox value to the double value, no effect, if value in my double is 0.3 I get 0.3 displayed not 0.300

Next tried setting the radNumericTextBox text to 0.300 no luck it displays 0.3

Any Suggestions?

Thanks
John
Top achievements
Rank 1
 answered on 31 Mar 2008
4 answers
243 views
Hi,
How can I attach a JS file to the iframe of the editor so that I can include javascript calls in my content? 

For example, I have a simple "show/hide div" javascript function in a file called scripts.js. I have content, managed via the editor, that contains the following HTML:
<a href="#" onclick="toggle_visibility('foo');">CLICK HERE</a>
<div id="foo" style="DISPLAY: none">MY CONTENT</div>
This code simply shows or hides the div named "foo".

The problem is that when editing the HTML in the editor, the page quickly displays a javascript error, breaking the editor. My best guess is that the iframe used by the editor cannot see the linked JS file. So it seems that attaching the JS file to the editor or iframe somehow would solve this.

Make sense?
Thanks for any help,
Joe
Joe
Top achievements
Rank 2
 answered on 31 Mar 2008
3 answers
91 views
One of the fields I use in my grid contains a text (abstract).
In edit mode I want to view the whole text but in gridmode I only want to see 2 or 3 lines (just to see whether something is filled in or not).
How can I restrict the number of lines shown?

Thanks

Daniel
Sebastian
Telerik team
 answered on 31 Mar 2008
4 answers
152 views
I have this list box that updates several check boxes (asp:CheckBox) whenever the user selects a new value in the list. I've noticed that the check boxes don't display correctly now that I've wired them up using a RadAjaxManagerProxy.

The problem I am having is that the check boxes are each followed by an asp:Label which gets broken to a new line only when wired up using ajax manager. I want the check box and text to remain on the same line.

I can see that the combo box is getting rendered with a surrounding div. I'm assuming the problem has something to do with the div since it's display mode is block? For some reason this gets rendered in the browser differently depending on whether or not ajax manager is involved.

Thanks,
Joe
Joe
Top achievements
Rank 2
 answered on 31 Mar 2008
1 answer
134 views
When someone insert a new record, how can you check whether this allready exist (validate?) before submitting it to the database?

Thanks

Daniel

Sebastian
Telerik team
 answered on 31 Mar 2008
1 answer
144 views

Hi

I have just updated to the new Futures release and I run into a problem with a calendar control inside of a tooltip (in IE only - works in firefox).  The problem is that the calendar appears under the tooltip making it impossible to to select dates.  I haven't had this problem with Q3 2007.

Is there anything that can be done to quickly solve this? I tried to find z-index or something like that but not sure where to look since I'm just using the embedded skins.

Thanks,

Marek

p.s. Screenshot of the problem: http://www.flickr.com/photos/25041241@N04/2364095418


Svetlina Anati
Telerik team
 answered on 31 Mar 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?