Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
242 views
Hi,

I have a table named Orders with a field "ChildFirstName". I like to get the total count of each ChildFirstNameand its percentage against total number of table. I create the query for that is

SelectCommand="SELECT [ChildFirstName], [COUNT(ChildFirstName) AS QuantityOrdered], [(QuantityOrdered * 100 / (SELECT COUNT(*) FROM Orders)) AS Percentage] FROM [Orders] GROUP BY [ChildFirstName] ORDER BY [ChildFirstName] DESC"

I create radgrid to display it,
                    <Columns>
                            <telerik:GridBoundColumn DataField="ChildFirstName" HeaderText="Child's First Name"
                            SortExpression="ChildFirstName" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="ChildFirstName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="QuantityOrdered" HeaderText="Quantity Ordered"
                            SortExpression="QuantityOrdered" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="QuantityOrdered">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Percentage" HeaderText="Percentage"
                            SortExpression="Percentage" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="Percentage">
                        </telerik:GridBoundColumn>
                    </Columns>
 
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:freepersonalizedConnectionString %>"
            SelectCommand="SELECT [ChildFirstName], [COUNT(ChildFirstName) AS QuantityOrdered], [(QuantityOrdered * 100 / (SELECT COUNT(*) FROM Orders)) AS Percentage] FROM [Orders] GROUP BY [ChildFirstName] ORDER BY [ChildFirstName] DESC">
        </asp:SqlDataSource>
But it gives error:
Invalid column name 'COUNT(ChildFirstName) AS QuantityOrdered'.
Invalid column name '(QuantityOrdered * 100 / (SELECT COUNT(*) FROM Orders)) AS Percentage'.


How to do it in right? Thanks.
Marin
Telerik team
 answered on 25 Jul 2011
1 answer
80 views
When i keep zooming a RadDock for more than 100%, dotted lines appear under panels. The scenario exist only in IE, firefox doesnot render these kinds of defects. What can be done for avoiding such unwanted lines?
Bozhidar
Telerik team
 answered on 25 Jul 2011
1 answer
132 views
Proble:
In NeedDataSourece event I need to find the source event which has trigerred the NeedDataSource.

Senario :
Steps:
1. In my Radgrid I have set the EnableViewState="false",  then I set the AllowRowSelect="true" in <clientsettings>

2. In code behing I have written a custom function to identify a the selected rows

3. After selecting a page number in my Radgrid pager, it is triggering the NeedDatasource event.

4. I need to Identify whether the NeedDatasource is trigerred from the PageItemChanged Event

5. Before moving to the another page, I have to get the selected rows from the current page.



 

Shinu
Top achievements
Rank 2
 answered on 25 Jul 2011
5 answers
176 views
Hello

I'm currently running the Rad editor v 4.4.1.0 in a sharepoint environment and I've noticed that if I insert the tags select(dropdown) or <script>(for javascript) that the editor would remove certain attributes or the whole tags.

Is there any way to work around this issue?
Stanimir
Telerik team
 answered on 25 Jul 2011
1 answer
112 views
hi

I have a table with only one TemplateColumn.
but this column must show different figures by TYPE column of dataset. for example, if TYPE=1 then show user picture, Name and Family
and if TYPE=2 then show some other columns with a special figure.
that means i want make a table with Facebook wall stye that in every rows shows some data with true Template.
witch solution do you refer?

best regards
Mohammad

Princy
Top achievements
Rank 2
 answered on 25 Jul 2011
1 answer
105 views
This is strange. I have a radgrid with GridButtonColumn. The gridbuttoncolumn has a commandname of DeleteItem.

I pick this up on the server side in the Radgrid_Itemcommand sub. 

At this point I want to reference items in the grid to perform other functions. 

The code I have been using for an ID databound column (unique name mnu_3_id)

id =  radgrid1.Items.Item(e.Item.RowIndex)("mnu_3_id").Text

However, the rowindex that is returned is incorrect. It returns a number twice as big + 1. 

i.e. clicking row 0 results in a 2 being returned, row 1 a 4, row 2 a 6 etc.

I can obviously work around this, but why does it return the incorrect index?

Cheers

Tox
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2011
2 answers
59 views
... now you don't.

I can't believe I am having this problem. I can make the rad window appear via a client side call to open it, but after postback the very same javascript will not open it.

I have created a small test project  to demonstrate the issue. I don't mind if this my own dumb fault, I just need to know why this is happening. :)

The form has a RadWindow inside a RadWindowManager and two buttons.

The first button is a regular html input type button that's 'onclick' calls the showWindow()  JS function.

The 2nd button is an asp:Button that on click postback to its own event handler. This method simply sets a value on the textbox that is in the window, then it registers some javascript that will call the ShowWindow function. It is on this 2nd call the ShowWindow fails to find the Window.

Here is the relevant part of the aspx code.

<head>
    <title>Now you see it...</title>
</head>
<body>
    <form id="form1" runat="server">
      
    <script type="text/javascript" language="javascript">
 
            function showWindow() {
                var win = $find("<%= RadWindow1.ClientID %>");
                alert(win); // Is NULL after post back
                win.show();
                win.center();
            }
 
    </script>  
 
    
   <asp:ScriptManager ID="ScriptManager1" runat="server">
   </asp:ScriptManager>
               
               <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                <Windows>
                    <telerik:RadWindow ID="RadWindow1" runat="server">
                        <ContentTemplate>
                            <asp:TextBox ID="tbTest" runat="server" />
                        </ContentTemplate>
                    </telerik:RadWindow>
                </Windows>
            </telerik:RadWindowManager>
    
    
           <input type="button" onclick="showWindow()" value="Client Side" />
                 
           <asp:Button ID="btnShowWindow"  runat="server" OnClick="btnShowWindow_Click" Text="Postback"/>
          
    </form>
</body>
</html>

The button event btnShowWindow_Click looks like this.

protected void btnShowWindow_Click(object sender, EventArgs e)
{
    tbTest.Text = "The window will not appear";
    string jScript = "showWindow();";
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", jScript, true);
}

showWindow gets called just fine. However this time  does not work as the window is not found. (the Alert shows NULL)

This has to be simple. What am I missing here?


Brad
Top achievements
Rank 1
 answered on 25 Jul 2011
1 answer
1.4K+ views
How to remove the Alternative Row color in RadGrid?.

I have used the following two properties

ItemStyle-BackColor

 

="White" AlternatingItemStyle-BackColor="White"

 


When I use the above property the grid visibility having some patches. The attached image having the sample.

Princy
Top achievements
Rank 2
 answered on 25 Jul 2011
0 answers
64 views
Hi,
 I am new for this product. I have sharepoint 2007 and vs 2008. i would like to use RADGRID to display multiple sharepoint list with add and edit feature and also want to use master child feature. i would like to make custom web part only in C#. So can you please help me to create this web part.  I am looking for any example in C# so i can start.


Thank You So much in advance !!!
Dipesh
Top achievements
Rank 1
 asked on 25 Jul 2011
23 answers
339 views
I am using RADcontrols for ASP.NET version 2008.2.804.20

The documentation at http://www.telerik.com/help/aspnet-ajax/onpopupshowing.html has the following example:

ascx/aspx

<ClientEvents OnPopUpShowing ="PopUpShowing" />

JavaScript

   <script type="text/javascript">
        function PopUpShowing(sender, eventArgs)
        {
                var  popUp = eventArgs.get_popUp();
        }

        or

        function PopUpShowing(sender, eventArgs)
        {
               eventArgs.set_cancel(true);
        }

  </script>

Which by the way does not work for my version of the controls.

I figured out I need to change

 <ClientEvents OnPopUpShowing ="PopUpShowing" />
  to
<ClientSettings  ClientEvents-OnPopUpShowing="PopUpShowing()" >

My javascript function that is called when the popup shows is

     function PopUpShowing(sender, eventArgs) {
         $('.GridEditForm_Custom').height($('#AnswerOptionsGrid').height() + 230);
     }

which uses jQuery to change the height of the grid edit form based on the height of a sub grid on the form.

The height does get adjusted, however a "sys.InvalidOperationException: handler must be a function" error is also thrown.

If I replace the $('.GridEditForm_Custom').height($('#AnswerOptionsGrid').height() + 230);
with a simple alert('test'); the same error is produced.

Any help will be appreciated,

Keith E.


cory
Top achievements
Rank 1
 answered on 25 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?