This is a migrated thread and some comments may be shown as answers.

Can not sort a grouped image column

6 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raymond Andrews
Top achievements
Rank 1
Raymond Andrews asked on 17 Oct 2010, 07:28 PM
I'm trying to present a boolean column from a MySql table graphically with a GridImageColumn.  I added a the GridImageColumn (myauth) and set it to emulate the boolean column (authorized).  (myauth) GroupByExpression="Group By authorized" and SortExpression="authorized". 

This works well, I can click on the (myauth) column header to change the sorting of the column, and I can drag the (myauth) column header to the group panel and group records.  If however I try to click the sort icon on the (myauth) button added to the group panel, then the button is reduced to just a few pixels, and I loose the ability to group, ungroup, or sort by that column or any others on the grid.


<%@ Page Language="Oxygene" AutoEventWireup="true" CodeBehind="Default.aspx.pas" Inherits="RadGridGroupSortTest._Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="Devart.Data.MySql.Web, Version=5.50.79.0, Culture=neutral, PublicKeyToken=09af7300eec23701" Namespace="Devart.Data.MySql.Web" TagPrefix="cc1" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.1.519.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
 
<head runat="server">
  <title>Untitled Page</title>
</head>
 
<body>
  <form id="form1" runat="server">
  <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">
  </telerik:RadScriptManager>
  <div>
 
    <cc1:MySqlDataSource ID="MySqlDataSource1" runat="server" ConnectionString="User Id=livewire3server;Password=lw3server;Host=192.168.1.5;Database=livewire3;Persist Security Info=True;"
      OldValuesParameterFormatString="Original_{0}" SelectCommand="select id,sender,receiver,authorized from dummydata_testbank" DeleteCommand="DELETE FROM livewire3.dummydata_testbank WHERE ((id = :Original_id))"
      InsertCommand="INSERT INTO livewire3.dummydata_testbank (sender, receiver, authorized) VALUES (:sender, :receiver, :authorized)" UpdateCommand="UPDATE livewire3.dummydata_testbank SET sender = :sender, receiver = :receiver, authorized = :authorized WHERE ((id = :Original_id))">
      <DeleteParameters>
        <asp:Parameter Name="Original_id" Type="String" />
      </DeleteParameters>
      <UpdateParameters>
        <asp:Parameter Name="sender" Type="String" />
        <asp:Parameter Name="receiver" Type="String" />
        <asp:Parameter Name="authorized" Type="Byte" />
        <asp:Parameter Name="Original_id" Type="String" />
      </UpdateParameters>
      <InsertParameters>
        <asp:Parameter Name="sender" Type="String" />
        <asp:Parameter Name="receiver" Type="String" />
        <asp:Parameter Name="authorized" Type="Byte" />
      </InsertParameters>
    </cc1:MySqlDataSource>
 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="MySqlDataSource1" GridLines="None" ShowGroupPanel="True">
      <MasterTableView DataKeyNames="id" DataSourceID="MySqlDataSource1">
        <RowIndicatorColumn>
          <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
          <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
          <telerik:GridBoundColumn DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" UniqueName="id">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="sender" HeaderText="sender" SortExpression="sender" UniqueName="sender">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="receiver" HeaderText="receiver" SortExpression="receiver" UniqueName="receiver">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="authorized" DataType="System.Int16" HeaderText="authorized" SortExpression="authorized" UniqueName="authorized">
          </telerik:GridBoundColumn>
          <telerik:GridImageColumn GroupByExpression="Group By authorized" HeaderText="myauth" SortExpression="authorized" UniqueName="myauth">
          </telerik:GridImageColumn>
        </Columns>
      </MasterTableView>
      <ClientSettings AllowDragToGroup="True">
      </ClientSettings>
    </telerik:RadGrid>
 
  </div>
  </form>
</body>
 
</html>


6 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 22 Oct 2010, 08:18 AM
Hello Raymond,

I am afraid that I am unable to replicate such behavior. Could you please prepare runnable sample that illustrates the behavior and send it to us via formal support ticket? Thus we'll be able to assist you further.

Best wishes,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Raymond Andrews
Top achievements
Rank 1
answered on 23 Oct 2010, 03:20 PM
This was the entirety of the code for the project, there was no server side code.
I cant post formal ticket, wont be current till next calendar year (long story), and can't provide running sample (security issue).  I will however try to replicate with a different database and without using the Devart / MySql to rule them out.  Thank you though.
0
Nikolay Rusev
Telerik team
answered on 27 Oct 2010, 12:15 PM
Hello Raymond,

Can you please check the attached page. It seems to be working properly on my end.
Could you try replicate it on that project?

Best wishes,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Raymond Andrews
Top achievements
Rank 1
answered on 27 Oct 2010, 08:10 PM
Well first, thank you for the continued support. Secondly, thanks of the idea, I was planning on a simple database and it hadn't occurred to me to just create the data dynamically. 

This has turned into a bit of a head-scratcher. I couldn't get your sample to build without running into 'The name RadGrid1 does not exist in the current context'.  My C# skills aren't that polished and I'm pretty sure I did everything right, but I can attribute that problem to my own error.

I took your code and the aspx table definition and started a new Delphi Prism project which compiled and ran, but with some odd results.

Under Firefox
I can drag the column headers, but not place them on the group panel, the cursor remains as a circle with a line through it.

Under IE
I can not drag the column headers at all.  IE also reports page errors (firefox may just be ignoring them)

Message: ASP.NET Ajax client-side framework failed to load.

Line: 40   Char: 34  Code: 0  URI: http://localhost:2743/Default.aspx

 

Message: 'Sys' is undefined

Line: 55  Char: 1  Code: 0  URI: http://localhost:2743/Default.aspx

 

Message: 'Sys' is undefined

Line: 104  Char: 1  Code: 0  URI: http://localhost:2743/Default.aspx


If I go to the RadGrid's task menu and select 'Replace ScriptManager with RadScriptManager it compiles and runs under both FireFox and IE, allowing me to group by the myauth column, but the initial problem still exists

video of the problem in action : http://steeltoad.com/groupsort/groupsort.wmv

project with scriptmanager : http://steeltoad.com/groupsort/with_scriptmanager.zip

project with radscriptmanager : http://steeltoad.com/groupsort/with_radscriptmanager.zip

Again, thank you for the help.
0
Accepted
Radoslav
Telerik team
answered on 02 Nov 2010, 03:48 PM
Hello Raymond,

Could you please try changing the GridImageColumn declaration as following and let me know if the issue still persists:
<telerik:GridImageColumn HeaderText="myauth" DataAlternateTextField="authorized" SortExpression="authorized" DataType="System.String" UniqueName="myauth">
</telerik:GridImageColumn>

Looking forward for your reply.

Regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Raymond Andrews
Top achievements
Rank 1
answered on 02 Nov 2010, 05:50 PM
YES, that seems to be it.  Using the DataAlternateTextField instead of GroupByExpression seems to be what was needed. I added to the code, setting the image based on the authorization column in the ItemDataBound event, and the Grouping/Sorting works exactly as it should.  Thank you again.
Tags
Grid
Asked by
Raymond Andrews
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Raymond Andrews
Top achievements
Rank 1
Radoslav
Telerik team
Share this question
or