Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET NHibernate , +
i am working with UltraWebGrid
 
when i click on header of column for sorting its giving me error

 
The data source 'ObjectDataSource1' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.
 

here is my Source code


 


 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<igtbar:UltraWebToolbar ID="UltraWebToolbar2" runat="server" önButtonClicked="UltraWebToolbar1_ButtonClicked">
 

 

 

 
<Images>
 

 
</Images>
 

 

 
<Images>
 

 
</Images>
 

 

 
<Images>
 

 
</Images>
 

 

 

 
 
 
 
 
 
 
 
<igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel2" runat="server" Height="20px"
 
Width="100%" BackImageUrl="~/images/plus.gif">
 
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataKeyField="CustomerId" EnableAppStyling="True"
 
Width="100%" DataSourceID="ObjectDataSource1" Browser="Xml" önItemCommand="gvInfra_ItemCommand"
 
StyleSetName="Claymation">
 

 

 
HeaderClickActionDefault="SortMulti" Name="UltraWebGrid1" RowHeightDefault="20px"
 
SelectTypeRowDefault="Extended" StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True"
 
TableLayout="Fixed" Version="4.00" ViewType="OutlookGroupBy" AutoGenerateColumns="False"
 
AllowUpdateDefault="Yes" RowSelectorsDefault="Yes" LoadOnDemand="Xml" AllowColumnMovingDefault="OnClient">
 
<FrameStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"
 
BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt" Width="100%">
 
</FrameStyle>
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
<HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid" HorizontalAlign="Left">
 

 

 

 
</HeaderStyleDefault>
 

 
Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
 

 

 

 

 

 

 

 
<SelectedRowStyleDefault BackColor="Green">
 
</SelectedRowStyleDefault>
 

 

 

 

 

 

 
CustomRules="overflow:none;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
 
Font-Size="11px" Height="300px" Width="200px">
 

 

 

 

 

 
BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
 
Font-Size="11px">
 

 

 

 

 

 

 

 

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="BindGv"
 
DataObjectTypeName="Customer" TypeName="OFRS.Development">
 

 

 
 
 
 
 

 
Here is my code to call function which is used with ObjectDataSource
 

public IList BindGv()
 
{
 

 
IList lstCityExtract= new List();
 
IList lstCustomerExtract = new List();
 

 
IList ooCusomer_City = new List();
 
try
 
{
 
Customers o = new Customers();
 
oSessionFactory = new SessionFactory();
 
I_session = oSessionFactory.Getsession("thkspf");
 
trans = I_session.BeginTransaction();
 
IList Lst = new List();
 
Lst = I_session.CreateCriteria().Add(Restrictions.Disjunction()
 
.Add(Restrictions.Eq("Cityname", "Karachi"))
 
.Add(Restrictions.Eq("Cityid", 2))).List();
 

 
string CustomerQuery = "select cust.* from Customer cust inner join city c on c.cityid=cust.cityid";
 
ISQLQuery oIqueryCustomer = I_session.CreateSQLQuery(CustomerQuery).AddEntity(typeof(Customers));
 
lstCustomerExtract = oIqueryCustomer.List();
 
foreach (Customers cust in lstCustomerExtract)
 
{
 
Cusomer_City oCusomer_City = new Cusomer_City();
 

lstCityExtract = I_session.CreateCriteria(typeof(City)).Add(Restrictions.Eq("Cityid", cust.Cityid)).List();
 

 
oCusomer_City.CustomerName = cust.CustomerName;
 
oCusomer_City.CustomerId = cust.CustomerId;
 
oCusomer_City.CustomerAddress = cust.CustomerAddress;
 
oCusomer_City.Cityid = lstCityExtract[0].Cityid;
 
oCusomer_City.Cityname = lstCityExtract[0].Cityname;
 
oCusomer_City.Gender = cust.Gender==1?"Male":"Female";
 
ooCusomer_City.Add(oCusomer_City);
 
}
 

 
}
 

catch (Exception ex)
 
{
 
trans.Rollback();
 
throw ex.InnerException;
 
}
 
return ooCusomer_City;
 
}

kindly help me manage it
Posted 19-Apr-12 1:20am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 515
1 Maciej Los 340
2 Richard MacCutchan 265
3 BillWoodruff 225
4 Mathew Soji 155
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411028.1 | Last Updated 19 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100