
Hi,
I am using hierarchical telerik gird with mode HierarchyLoadMode="Client"
When I use it on the aspx page it works fine. But when I shift the same grid to the usercontrol it shows me following error. I am sure it is because of telerik embedded javascript. I am only using expand/collapse from the grid javascript. Tell me how can I avoid follwing error.
---------------------------
Windows Internet Explorer
---------------------------
Stop running this script?
A script on this page is causing Internet Explorer to run slowly.
If it continues to run, your computer may become
unresponsive.
---------------------------
Yes No
---------------------------
Please reply asap.
I want to create a cross-table using RadGrid. The table contains 56 rows and 24 columns which is displayed on a single page.
I found that the scroll column, static header, and frozen column of RadGrid are so great. The problem is that using the scrollbars (in particular the horizontal bar) induces some kind of temporary blocking giving the impression that everything is completely stuck.
I would like to create a cross-table with "scrolling images" on the top-right conner.
(see the picture at: http://i577.photobucket.com/albums/ss220/maidinhnga/radgrid.jpg?t=1239869301)
When clicking on the images the columns of the Grid (except the "Designation" column) the will slide to left/right to show the hidden columns.
Is there any solution?
thanks.
Inside every datalist row there is a button that initiates DataList ItemCommand, where it updates the label.
Inside repeater ItemDataBound I am adding the AjaxSettings for the RadAjaxManager.
The problem is, when I click on the button that's inside the datalist, the loading panel shows up and never disappear.
Here is my ASPx code:
| <radA:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| </radA:RadAjaxManager> |
| <asp:Repeater ID="rpCategories" runat="server" DataSourceID="dsCategories" |
| onitemdatabound="rpCategories_ItemDataBound"> |
| <HeaderTemplate> |
| <table width="100%" cellpadding="0" cellspacing="0" border="1" bordercolor="#ffffff"> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <tr> |
| <td> |
| <asp:Literal ID="litCatID" runat="server" Text='<%# Eval("CategoryID") %>' Visible="false"></asp:Literal> |
| <asp:Image runat="server" ID="imgCat" ImageUrl='<%# Eval("CategoryImage")%>' Width="100px" /> |
| <asp:label runat="server" CssClass="CatName" id="lblCatName" Text='<%# Eval("CategoryName")%>'></asp:label> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:label runat="server" CssClass="CatDesc" id="lblCatDesc" Text='<%# Eval("CategoryDesc")%>'></asp:label> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:DataList OnItemCommand="dlItems_OnItemCommand" DataKeyField="ProductID" ID="dlItems" Width="100%" runat="server"> |
| <HeaderTemplate> |
| <table width="100%" cellpadding="0" cellspacing="2"> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <tr style="background-color:#e6caae;"> |
| <td valign="top"> |
| <asp:Literal ID="litProductID" runat="server" Text='<%# Eval("ProductID") %>' visible="false"></asp:Literal> |
| <asp:Label ID="lblModelName" runat="server" Text='<%# Eval("ModelName") %>' CssClass="ItemName"></asp:Label> |
| </td> |
| <td width="50"> |
| <asp:Label ID="lblUnitCost" runat="server" Text='<%# Eval("UnitCost") + "/person" %>' CssClass="ItemDesc"></asp:Label> |
| </td> |
| <td width="50" rowspan="2"> |
| <asp:Button CommandName="AddToBasket" CommandArgument='<%# Eval("ProductID") %>' ID="btnAddToBasket" runat="server" Text="Add to basket" /> |
| </td> |
| </tr> |
| <tr style="background-color:#e6caae;"> |
| <td colspan="2" valign="top"> |
| <asp:Label ID="lblDesc" runat="server" Text='<%# Eval("Description") %>' CssClass="ItemDesc"></asp:Label> |
| </td> |
| </tr> |
| <tr style="background-color:#e6caae;"> |
| <td colspan="3"> |
| <span class="ItemDesc"># of persons:</span> <asp:TextBox ID="txtPersons" runat="server" Text="1"></asp:TextBox> |
| </td> |
| </tr> |
| <tr style="background-color:#e6caae;"> |
| <td colspan="3"> |
| <span class="ItemDesc">Notes:</span> <asp:TextBox ID="txtNotes" runat="server" Text="" style="width:83%"></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="3"><hr /></td> |
| </tr> |
| </ItemTemplate> |
| <FooterTemplate> |
| </table> |
| </FooterTemplate> |
| </asp:DataList> |
| </ItemTemplate> |
| <FooterTemplate> |
| </td> |
| </tr> |
| </table> |
| </FooterTemplate> |
| </asp:Repeater> |
| <asp:SqlDataSource ID="dsCategories" runat="server" |
| SelectCommand="SELECT * FROM [CMRC_Categories] ORDER BY [SortNo]"> |
| </asp:SqlDataSource> |
| </td> |
| <td style="width:30%" valign="top"> |
| <div id="MiniBasket" style="position:relative"> |
| <asp:DataList ID="dlBasket1" runat="server" DataSourceID="dsOrder" |
| BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" |
| CellPadding="3" CellSpacing="2" GridLines="Both"> |
| <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" /> |
| <ItemStyle BackColor="#FFF7E7" ForeColor="#8C4510" /> |
| <SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" /> |
| <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" /> |
| <ItemTemplate> |
| <table cellspacing="1" class="style1"> |
| <tr> |
| <td> |
| <asp:Label ID="lblITem" runat="server" Text='<%# Eval("ModelName") %>'></asp:Label> |
| </td> |
| <td> |
| <asp:Label ID="lblQuan" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label> |
| </td> |
| <td><asp:Button ID="Button1" runat="server" Text="Button" /></td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </asp:DataList> |
| <asp:Label ID="lblCount" runat="server" Text="0"></asp:Label> |
| <asp:SqlDataSource ID="dsOrder" runat="server" |
| SelectCommand="SELECT dbo.CMRC_ShoppingCart.UserName, dbo.CMRC_ShoppingCart.IsCheckedOut, dbo.CMRC_ShoppingCartItems.Quantity, dbo.CMRC_ShoppingCartItems.ModelName, dbo.CMRC_ShoppingCartItems.Price, dbo.CMRC_ShoppingCartItems.BasketItemID, dbo.CMRC_ShoppingCart.cartID FROM dbo.CMRC_ShoppingCart INNER JOIN dbo.CMRC_ShoppingCartItems ON dbo.CMRC_ShoppingCart.cartID = dbo.CMRC_ShoppingCartItems.CartID WHERE (dbo.CMRC_ShoppingCart.IsCheckedOut = 0) AND (dbo.CMRC_ShoppingCart.UserName = @Username)"> |
| </asp:SqlDataSource> |
| public partial class Order : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| dsCategories.ConnectionString = LesPreasso.Properties.Settings.Default.ConnectionString; |
| dsOrder.ConnectionString = LesPreasso.Properties.Settings.Default.ConnectionString; |
| dsOrder.SelectParameters.Add("username", this.User.Identity.Name); |
| } |
| protected void rpCategories_ItemDataBound(object sender, RepeaterItemEventArgs e) |
| { |
| DataList dl = new DataList(); |
| Literal pcatid; |
| dl = (DataList)(e.Item.FindControl("dlItems")); |
| pcatid = (Literal)e.Item.FindControl("litCatID"); |
| if (!(dl ==null)) |
| { |
| DataSet oData = new DataSet(); |
| SqlConnection conn = new SqlConnection(); |
| conn.ConnectionString = LesPreasso.Properties.Settings.Default.ConnectionString; |
| SqlDataAdapter cmd = new SqlDataAdapter("select * from CMRC_Products where CategoryID=@CategoryID", conn); |
| cmd.SelectCommand.Parameters.AddWithValue("CategoryID", pcatid.Text); |
| cmd.Fill(oData); |
| if (oData.Tables[0].Rows.Count > 0) |
| { |
| dl.DataSource = oData.Tables[0].DefaultView; |
| dl.DataBind(); |
| } |
| RadAjaxManager1.AjaxSettings.AddAjaxSetting(dl, lblCount, LoadingPanel1); |
| } |
| } |
| protected void dlItems_OnItemCommand(object sender, DataListCommandEventArgs e) |
| { |
| if (e.CommandName=="AddToBasket") |
| { |
| lblCount.Text= Convert.ToString(Convert.ToInt32(lblCount.Text)+ 1); |
| } |
| } |
| } |
Hi,
I am trying to get RadGrid to work. What I want to achive is simply a Grid that lets me modify the content of a database table. However, most online samples using the Grid Control is based on ASP.NET - I'm using the Grid Control within a SharePoint WebPart, and therefore needs to do it all programmatically (C# .NET)
When I execute my WebPart, I receive no errors. The Grid simply dosn't render. My code follows below. Any ideas?
- Thanks in advance.
Regards
Jimmy Thomsen
=============================================================================
namespace CompGrid
{
public class Grid : WebPart
{
private ScriptManager sm;
private RadGrid grid;
protected override void OnLoad(EventArgs e)
{
this.EnsureChildControls();
}
protected override void CreateChildControls()
{
if (ScriptManager.GetCurrent(this.Page) != null)
{
this.sm = ScriptManager.GetCurrent(this.Page);
}
else
{
this.sm = new ScriptManager();
this.Controls.Add(this.sm);
}
this.grid = new RadGrid();
this.Controls.Add(this.grid);
this.grid.AllowAutomaticDeletes = true;
this.grid.AllowAutomaticInserts = true;
this.grid.AllowAutomaticUpdates = true;
this.grid.AllowMultiRowEdit = true;
this.grid.AutoGenerateColumns = true;
this.grid.AutoGenerateDeleteColumn = true;
this.grid.AutoGenerateEditColumn = true;
if (this.Page.IsPostBack == false)
{
SqlDataSource dataSource = new SqlDataSource("Data Source=Comp-demo;Initial Catalog=TestDB;User ID=admin;Password=test", "SELECT xaxis, series1, series2 FROM testdata");
dataSource.UpdateCommand = "UPDATE testdata SET xaxis=@xaxis, series1=@series1, series2=@series2 WHERE id=@id";
dataSource.DeleteCommand = "DELETE FROM testdata WHERE id=@id";
dataSource.InsertCommand = "INSERT INTO testdata VALUES (xaxis=@xaxis, series1=@series1, series2=@series2)";
this.grid.DataSourceID = dataSource.ID;
}
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
this.sm.RenderControl(writer);
this.grid.RenderControl(writer);
}
}
}
var dbMedication =
document.getElementById(
'<%=MedicationControl.FindControl("RadComboBoxMedication").ClientID%>').get_text();//it shows error get_text method not found.
RadComboBoxMedication is id of combo box.
MedicationControl is usercontrol.
Plz help me.