Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
75 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
164 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
916 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
246 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
95 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
154 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
147 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
5 answers
170 views
http://englishflashcard.org/calendar/

I can only navigate last month and current month and next month with my IIS server, and I cannot navigate next two month, or last two month.

How to solve this problem?
Peter
Telerik team
 answered on 31 Mar 2008
1 answer
191 views
Hi,
I have two raddockZones, say zoneLeft and zoneRight, in different tables on a page.
ZoneA top point is 300px below the ZoneB top point, at all times.
These zones are filled with dynamically created docks, and their height grows, as they have more docks.

I want these zones' bottom points be on the same line, at all times. In other words, if zoneLeft grows up to 500px, zoneRight should grow to 800px. (Because zoneLeft is 300px below)

I thouht of css expression, likely to work for me. Unfortunately no browser,but IE supports it. Is there any other way to achieve such a situation ?

Thanks.
Sophy
Telerik team
 answered on 31 Mar 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?