- Home
- LLBLGen Pro
- Bugs & Issues
RadGrid Problem : LLBLGENPro 2
Joined: 11-Nov-2006
Hi Fran,
I'm having a probleming getting an ajaxed RadGrid Control working with the new DataSource2 control. Am pretty sure its the grid (or my use of it) that is at fault but at this stage it is hard to say,
The support team at Telerik have asked me to send through a sample that they can look at. Is it ok for me to send them any assemblies etc they require or do you provide a temporary licence for this sort of thing?
Cheers,
Peter
You can mail them your generated code and the runtime libraries, as these are freely distributable by you. You can't send them the designer of course or code generator related stuff, but that's also not necessary for them to track down the issue.
If they need a temp license, then can download the v2 demo, it's fully functional
Joined: 10-Mar-2006
What exactly is your problem?
I did this whole thing and they just emailed me with a new hotfixed grid to fix it.
Joined: 11-Nov-2006
Hi Wayne,
Am trying to build fairly simple hierachial grid. Am using the Supplier -> Product table from the Nothwind database.
All appears to work ok at first glance but the subgrid only displays the correct rows 1 time in 2.
For example when I select supplier1 the subgrid shows product where supplierId = 1 but if I go on to select supplier2 the subgrid shows product where supplierId = 1 also. This is in no way sequential for if I select Supplier7 its correct but if I follow it by supplier10 the subgrid will show product where SupplierId = 7
Very annoying. Have checked and double checked and the value held in SessionId is correct
Anyway here is some sample code:
View Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20" Namespace="SD.LLBLGen.Pro.ORMSupportClasses" TagPrefix="cc1" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td style="width:50%;">
<asp:Label ID="Label1" runat="server" Text="SessionId"></asp:Label></td>
</tr>
<tr>
<td colspan="2">
<radG:RadGrid ID="RadGrid1" runat="server" DataSourceID="SupplierDataSource"
HorizontalAlign="NotSet" ShowFooter="True" SkinsPath="~/RadControls/Grid/Skins" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" AllowPaging="True">
<ClientSettings AllowExpandCollapse="True">
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataKeyNames="SupplierId" DataSourceID="SupplierDataSource">
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn">
</EditColumn>
</EditFormSettings>
<Columns>
<radG:GridBoundColumn DataField="SupplierId" DataType="System.Int32" HeaderText="SupplierId"
SortExpression="SupplierId" UniqueName="SupplierId">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
UniqueName="CompanyName">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address"
UniqueName="Address">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="ContactTitle" HeaderText="ContactTitle" SortExpression="ContactTitle"
UniqueName="ContactTitle">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Phone" HeaderText="Phone" SortExpression="Phone"
UniqueName="Phone">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="HomePage" HeaderText="HomePage" SortExpression="HomePage"
UniqueName="HomePage">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Fax" HeaderText="Fax" SortExpression="Fax" UniqueName="Fax">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Country" HeaderText="Country" SortExpression="Country"
UniqueName="Country">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="PostalCode" HeaderText="PostalCode" SortExpression="PostalCode"
UniqueName="PostalCode">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="City" HeaderText="City" SortExpression="City" UniqueName="City">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="Region" HeaderText="Region" SortExpression="Region"
UniqueName="Region">
</radG:GridBoundColumn>
<radG:GridBoundColumn DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName"
UniqueName="ContactName">
</radG:GridBoundColumn>
</Columns>
<ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<DetailTables>
<radG:GridTableView runat="server" DataKeyNames="ProductId" DataSourceID="ProductDataSource">
<EditFormSettings>
<EditColumn CancelImageUrl="~/RadControls/Grid/Skins/Default/Cancel.gif" EditImageUrl="~/RadControls/Grid/Skins/Default/Edit.gif"
InsertImageUrl="~/RadControls/Grid/Skins/Default/Insert.gif" UniqueName="EditCommandColumn"
UpdateImageUrl="~/RadControls/Grid/Skins/Default/Update.gif">
</EditColumn>
</EditFormSettings>
<ParentTableRelation>
<radG:GridRelationFields DetailKeyField="SupplierId" MasterKeyField="SupplierId" />
</ParentTableRelation>
<ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn" Visible="False">
<HeaderStyle Width="19px" />
</ExpandCollapseColumn>
<RowIndicatorColumn UniqueName="RowIndicator" Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
</radG:GridTableView>
</DetailTables>
<RowIndicatorColumn UniqueName="RowIndicator" Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
</MasterTableView>
<FilterMenu HoverBackColor="LightSteelBlue" HoverBorderColor="Navy" NotSelectedImageUrl="~/RadControls/Grid/Skins/Default/NotSelectedMenu.gif"
SelectColumnBackColor="Control" SelectedImageUrl="~/RadControls/Grid/Skins/Default/SelectedMenu.gif"
TextColumnBackColor="Window"></FilterMenu>
</radG:RadGrid>
<cc1:LLBLGenProDataSource2 ID="SupplierDataSource" runat="server" AdapterTypeName="Test.Northwind.DatabaseSpecific.DataAccessAdapter, Test.NorthwindDBSpecific"
DataContainerType="EntityCollection" EntityFactoryTypeName="Test.Northwind.FactoryClasses.SuppliersEntityFactory, Test.Northwind">
</cc1:LLBLGenProDataSource2>
<cc1:LLBLGenProDataSource2 ID="ProductDataSource" runat="server" AdapterTypeName="Test.Northwind.DatabaseSpecific.DataAccessAdapter, Test.NorthwindDBSpecific"
DataContainerType="EntityCollection" EntityFactoryTypeName="Test.Northwind.FactoryClasses.ProductsEntityFactory, Test.Northwind">
<SelectParameters>
<asp:SessionParameter Name="SupplierId" SessionField="SupplierId" Type="Int32" />
</SelectParameters>
</cc1:LLBLGenProDataSource2>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Code Behind
using System;
using System.Web.UI;
using Telerik.WebControls;
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void RadGrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
{
GridDataItem parentItem = e.DetailTableView.ParentItem;
if (e.DetailTableView.DataSourceID == "ProductDataSource")
{
Session["SupplierId"] = Convert.ToInt32(parentItem["SupplierId"].Text);
}
}
}
Joined: 10-Mar-2006
It might be related, because it had to do with the binding of parameters in a datasourceobject.
Here is where we figured it out.
http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6808
Though did telerik release the fix to the public?
No - they have not yet, but if he is a customer, he can mention this and get the latest build to try against.