We have column name Member Name in Data Set and we are using following sql query for getting this name into data set.
Select
COALESCE(
STUFF
(
(
SELECT DISTINCT
''; '' + FirstName + CASE WHEN MI IS NULL THEN '''' ELSE '' '' + MI END + '' '' + LastName
FROM
TestTable1
INNER JOIN TestTable2 on TestTable1.customerid = TestTable2.customerid
WHERE
TestTable2.MemberID = TestTable1.customerid
FOR XML PATH('''')
)
,1,1,''''
),''N/A'') AS [Name]
From TestTable
Based on above query we are getting customer name successfully in data set and bind to grid. Now issue is that we are not able to use Starts with operator and column filter is not returning any result. However when we use “Contains” operator we are able to retrieve correct result.
Also we have another column that simply returns column data as below
Select TestTable.PersonName From TestTable
Using above query we are successfully use starts with operator.
So what can be the problem and how can we resolve it?
Regards,
Dharmesh Solanki
I have a hierarchy grid that is populated on demand (server side) using the NeedDataSource and DetailTableDataBind events (single level detail table) based on your example provided in the documentation.
Everything works fine but I have noticed that if 2 child levels are opened/expanded at the same time the second one does not refresh correctly. When I click to expand to see the details in another row I have correct number of pages but no data in the grid.
If I only have one sub level expanded/opened at the time everything works fine – for example I close/hide the details before I open/expand another row.
What else do I need to do to fix the refresh issue.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %><!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></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true"> </telerik:RadSkinManager> <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Office2007" DecoratedControls="All" /> <asp:Button ID="Button1" runat="server" Text="Button" /> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksLT2008ConnectionString %>" SelectCommand="SELECT top 10 * FROM [SalesLT].[Customer]"></asp:SqlDataSource> </form></body></html>using System;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Configuration;using System.Web.Security;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using Telerik.Web.UI;public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { }}<?xml version="1.0"?><configuration> <connectionStrings> <add name="AdventureWorksLT2008ConnectionString" connectionString="Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=AdventureWorksLT2008;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <compilation debug="true" targetFramework="4.0"> </compilation> <pages> <controls> <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" /> </controls> </pages> <httpHandlers> <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> </httpHandlers> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <handlers> <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" /> </handlers> </system.webServer></configuration><
rad:RadGrid id="dgStock" runat="server" Width="400px" Skin="Windows"
<
ClientSettings Resizing-AllowColumnResize="true" />
then i have this in the code behind
Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.WebControls.GridColumnCreatedEventArgs) Handles dgStock.ColumnCreated
If TypeOf e.Column Is GridGroupSplitterColumn Then
e.Column.HeaderStyle.Width = Unit.Pixel(1)
e.Column.ItemStyle.Width = Unit.Pixel(1)
e.Column.Resizable =
False
End If
End Sub
Private Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgStock.PreRender
For Each column As GridColumn In dgStock.MasterTableView.RenderColumns
If (TypeOf column Is GridGroupSplitterColumn) Then
column.HeaderStyle.Width = Unit.Pixel(1)
column.ItemStyle.Width = Unit.Pixel(1)
column.Resizable =
False
End If
Next
End Sub
The grouping of the grid is achieved as shown below
<
GroupByExpressions>
<
rad:GridGroupByExpression><SelectFields>
<
rad:GridGroupByField FieldName="StockType" FieldAlias="StockType" FormatString="" HeaderText=""></rad:GridGroupByField>
</
SelectFields>
<
GroupByFields>
<
rad:GridGroupByField FieldName="StockType" FieldAlias="StockType" FormatString="" HeaderText=""></rad:GridGroupByField>
</
GroupByFields>
</
rad:GridGroupByExpression>
</
GroupByExpressions>
Many thanks for your help
andrea