i am working with UltraWebGrid
when i click on header of column for sorting its giving me error
here is my Source code
<table width="100%">
<tr>
<td style="width: 5%">
</td>
<td style="width: 90%">
</tr>
<tr style="display:none">
<td>
<igtbar:UltraWebToolbar ID="UltraWebToolbar2" runat="server" OnButtonClicked="UltraWebToolbar1_ButtonClicked">
<SeparatorStyle BorderColor="ActiveBorder" BorderStyle="Double" Font-Bold="true" />
<Items>
<igtbar:TBarButton Key="Edit" Text="Edits">
<Images>
<DefaultImage Url="images/edit_icon.jpg" />
</Images>
</igtbar:TBarButton>
<igtbar:TBarButton Key="New" Text="New">
<DefaultImage Url="images/add_new_icon.jpg" />
<igtbar:TBarButton Text="Delete" Key="Delete">
<DefaultImage Url="images/delete_icon.jpg" />
</Items>
</igtbar:UltraWebToolbar>
<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" OnItemCommand="gvInfra_ItemCommand"
StyleSetName="Claymation">
<DisplayLayout AllowColSizingDefault="Free" AllowDeleteDefault="Yes" BorderCollapseDefault="Separate"
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>
<Pager AllowPaging="True" MinimumPagesForDisplay="2" StyleMode="ComboBox" PageSize="15">
<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
</PagerStyle>
</Pager>
<EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
</EditCellStyleDefault>
<FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
</FooterStyleDefault>
<BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px">
</BorderDetails>
<HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid" HorizontalAlign="Left">
</HeaderStyleDefault>
<RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
<Padding Left="3px" />
<BorderDetails ColorLeft="Window" ColorTop="Window" />
<Padding Left="3px"></Padding>
<BorderDetails ColorLeft="Window" ColorTop="Window"></BorderDetails>
</RowStyleDefault>
<GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
</GroupByRowStyleDefault>
<SelectedRowStyleDefault BackColor="Green">
</SelectedRowStyleDefault>
<GroupByBox Hidden="True">
<BoxStyle BackColor="ActiveBorder" BorderColor="Window">
</BoxStyle>
</GroupByBox>
<AddNewBox Hidden="False">
<BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px">
</AddNewBox>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
<FilterOptionsDefault FilterUIType="HeaderIcons" AllowRowFiltering="OnClient" FilterComparisonType="CaseSensitive">
<FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
CustomRules="overflow:none;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
Font-Size="11px" Height="300px" Width="200px">
<Padding Left="2px" />
</FilterDropDownStyle>
<FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
</FilterHighlightRowStyle>
<FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
Font-Size="11px">
</FilterOperandDropDownStyle>
</FilterOptionsDefault>
</DisplayLayout>
<Bands>
<igtbl:UltraGridBand DataKeyField="CustomerId" Hidden="false">
<Columns>
<igtbl:UltraGridColumn BaseColumnName="CustomerId" IsBound="true">
<Header Caption="Sno">
</Header>
</igtbl:UltraGridColumn>
<igtbl:UltraGridColumn Width="35%" BaseColumnName="CustomerName" IsBound="true">
<Header Caption="CustomerName">
<RowLayoutColumnInfo OriginX="1"></RowLayoutColumnInfo>
<Footer>
</Footer>
<igtbl:UltraGridColumn Width="25%" BaseColumnName="CustomerAddress">
<Header Caption="Address">
<RowLayoutColumnInfo OriginX="1" />
<igtbl:UltraGridColumn Width="20%" BaseColumnName="Cityname">
<Header Caption="City Name">
<RowLayoutColumnInfo OriginX="2" />
<igtbl:UltraGridColumn Width="20%" BaseColumnName="Gender">
<Header Caption="Gender">
<RowLayoutColumnInfo OriginX="4"></RowLayoutColumnInfo>
<igtbl:TemplatedColumn Hidden="true">
<HeaderTemplate>
Select
</HeaderTemplate>
<CellTemplate>
<asp:Button ID="btnSelect" runat="server" CommandName="Select" Text="Select" />
</CellTemplate>
<Header Caption="Select">
<RowLayoutColumnInfo OriginX="3" />
</igtbl:TemplatedColumn>
</Columns>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
</igtbl:UltraGridBand>
</Bands>
</igtbl:UltraWebGrid>
</igmisc:WebAsyncRefreshPanel>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="BindGv"
DataObjectTypeName="Customer" TypeName="OFRS.Development">
</asp:ObjectDataSource>
</table>
Here is my code to call function which is used with ObjectDataSource
public IList<Cusomer_City> BindGv()
{
IList<City> lstCityExtract= new List<City>();
IList lstCustomerExtract = new List<Customers>();
IList<Cusomer_City> ooCusomer_City = new List<Cusomer_City>();
try
Customers o = new Customers();
oSessionFactory = new SessionFactory();
I_session = oSessionFactory.Getsession("thkspf");
trans = I_session.BeginTransaction();
IList<City> Lst = new List<City>();
Lst = I_session.CreateCriteria<City>().Add(Restrictions.Disjunction()
.Add(Restrictions.Eq("Cityname", "Karachi"))
.Add(Restrictions.Eq("Cityid", 2))).List<City>();
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<City>();
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
Hi qasimidl,
Please contact me if you have any further questions regarding this matter.
Thank you for posting in the community.
As the message you are getting suggests, UltraWebGrid does not support automatic sorting with ObjectDataSource. Please refer to the following thread for more information:
http://blogs.infragistics.com/forums/p/56860/290787.aspx
Note that the UltraWebGrid control is now outdated and as of .NetAdvantage 2011 Volume 2 is no longer included in our product package. I would suggest that you consider switching to the WebDataGrid/WebHieararchicalDataGrid. More information regarding these controls is available at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Web_WebDataGrid_WebDataGrid.html
Additional samples demonstrating the features of these grids can be found at:http://samples.infragistics.com/aspnet/
Feel free to contact me if you have any questions.