Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Hello Rad-Community!

I´m trying to make the Grid support insert/update in a unlimited Category function based on a ID/ParentID structure. It´s very easy to make this work in one level scenario or where you know how deep things will go. It´s also very easy to just show an unlimited level structure WITHOUT insert/update. 

I havent found an example where it shows how this is done in an unlimited nested version.with insert/update function

Is there anyone out there that have made this and are willing to share an example.

/M
Mike Nogen
Top achievements
Rank 1
 answered on 09 Jan 2011
1 answer
111 views
Hi,

I'm using the example http://demos.telerik.com/aspnet-ajax/combobox/examples/programming/performance/defaultcs.aspx
and needed to make a change in case of webservice, but I have no idea how.

In the example listed webservice code checks the value of the information reported for the combobox and performs a filter on the database, I needed to make a filter using another combobox to check the values listed, as is being done?
msigman
Top achievements
Rank 2
 answered on 09 Jan 2011
2 answers
54 views
We are using a combination of RadToolBar as Command Item (http://demos.telerik.com/aspnet-ajax/toolbar/examples/applicationscenarios/gridcommanditem/defaultcs.aspx?product=grid) and custom styled edited rows (http://demos.telerik.com/aspnet-ajax/grid/examples/styles/editrowstyle/defaultcs.aspx) to display grid with users information.  Passwords are not displayed in the grid and are not available for editing, but we have to have password field available at the time of new user creation.  Any tips as to how we can make this happen?

Thank you!
Bogdan
Top achievements
Rank 1
 answered on 09 Jan 2011
2 answers
204 views

Hi,

I have a grid and  i used the sorting functionality. so if no records in grid and when i clicked on sorting it will fill the data to the grid.
Is there any way to disable sorting for a column header when there are no record in the grid. 

thanks
waruni
waruni
Top achievements
Rank 1
 answered on 09 Jan 2011
1 answer
38 views
I have a hierarchy grid and I want the master table to display a different color background if the underlying table has records. What is the best method for applying the formatting?
Mike Nogen
Top achievements
Rank 1
 answered on 09 Jan 2011
2 answers
266 views
Hi everyone and happy new year to all coders.

My problem is , I have a radgrid with custom paging, (based on Grid/Pager Template) i put a linkbutton and a textbox filter to load with data the radgrid 
When a write something to find in the textbox filter the radgrid it´s loaded correctly, the linkbutton it´s call one time.
When a click in the button (first, prev, next, last ) work ok to, but when I change the page size in the radcombox the RadGrid1_PageSizeChanged is called twice and if a write the number of the page in the RadNumericTextBox, the RadGrid1_PageIndexChanged it´s called one and then the LinkButton1_Click also.
Anyone can say what i am missing here?

I put here all the code.
Thank in advance.

Jolynice

ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="example.aspx.cs" Inherits="OralOffice_Pacientes_example" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
     <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
     <script type="text/javascript">
            var tableView = null;
            function pageLoad(sender, args) {
                tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
            }
 
            function RadComboBox1_SelectedIndexChanged(sender, args) {
                tableView.set_pageSize(sender.get_value());
            }
 
            function changePage(argument) {
                tableView.page(argument);
            }
 
            function RadNumericTextBox1_ValueChanged(sender, args) {
                tableView.page(sender.get_value());
            }
        </script>
 
    </telerik:RadScriptBlock>
 
            <!-- content start -->
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
 
            <div>
 
 
            <asp:Button ID="LinkButton1" runat="server"  Text="Find CompanyName" onclick="LinkButton1_Click">
            </asp:Button>  
            <input type="text" runat="server" name="fname" id="Text1"  style="width:370px;"/>
 
            </div>
 
            <telerik:RadGrid ID="RadGrid1" AllowPaging="true"
            DataSourceID="SqlDataSource1" runat="server" Skin="Vista"
            OnPageIndexChanged="RadGrid1_PageIndexChanged" onPagesizechanged="RadGrid1_PageSizeChanged">
                <MasterTableView>
                    <PagerTemplate>
                        <asp:Panel ID="PagerPanel" Style="padding: 6px; line-height: 24px" runat="server">
                            <div style="float: left">
                                <span style="margin-right: 3px;">Page size:</span>
                                <telerik:RadComboBox ID="RadComboBox1" DataSource="<%# new object[]{10, 20, 30, 40, 50} %>"
                                    Style="margin-right: 20px;" Width="40px" SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>'
                                    runat="server" OnClientSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
                                </telerik:RadComboBox>
                            </div>
                            <div style="margin: 0px; float: right;">
                                Displaying page
                                <%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>
                                of
                                <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                                , items
                                <%# (int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") + 1 %>
                                to
                                <%# (int)DataBinder.Eval(Container, "Paging.LastIndexInPage") + 1 %>
                                of
                                <%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>
                            </div>
                            <div style="width: 400px; margin: 0px; padding: 0px; float: left; margin-right: 10px;
                                white-space: nowrap;">
                                <asp:Button ID="Button1" runat="server"  OnClientClick="changePage('first'); return false;"
                                    CommandName="Page" CommandArgument="First" Text="|<" CssClass="PagerButton FirstPage" />
                                <asp:Button ID="Button2" runat="server" OnClientClick="changePage('prev'); return false;"
                                    CommandName="Page" CommandArgument="Prev" Text=" <" CssClass="PagerButton PrevPage" />
                                <span style="vertical-align: middle;">Page:</span>
                                <telerik:RadNumericTextBox ID="RadNumericTextBox1" Width="25px" Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>'
                                    runat="server">
                                    <ClientEvents OnValueChanged="RadNumericTextBox1_ValueChanged" />
                                    <NumberFormat DecimalDigits="0" />
                                </telerik:RadNumericTextBox>
                                <span style="vertical-align: middle;">of
                                    <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                                </span>
                                <asp:Button ID="Button3" runat="server" OnClientClick="changePage('next'); return false;"
                                    CommandName="Page" CommandArgument="Next" Text=" >" CssClass="PagerButton NextPage" />
                                <asp:Button ID="Button4" runat="server" OnClientClick="changePage('last'); return false;"
                                    CommandName="Page" CommandArgument="Last" Text=" >|" CssClass="PagerButton LastPage" />
                            </div>
                            <asp:Panel runat="server" ID="NumericPagerPlaceHolder" />
                        </asp:Panel>
                    </PagerTemplate>
                    <PagerStyle Mode="NumericPages" PageButtonCount="10" />
                </MasterTableView>
            </telerik:RadGrid>
            <br />
            <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                ProviderName="System.Data.SqlClient"
                SelectCommand="SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City FROM Customers"
                runat="server"></asp:SqlDataSource>
            <!-- content end -->
    </div>
    </form>
</body>
</html>

C#
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class OralOffice_Pacientes_example : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            setdatasourceGrid();
            RadGrid1.DataBind();
        }
    }
 
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        setdatasourceGrid();
        RadGrid1.DataBind();
    }
 
 
    internal void setdatasourceGrid()
    {
        //To see the headers only
        if (String.IsNullOrEmpty(Text1.Value))
            SqlDataSource1.SelectCommand = "SELECT top 0 CustomerID, CompanyName, ContactName, ContactTitle  FROM  Customers ";
        //To see all records
        else if (Text1.Value.Equals("*"))
            SqlDataSource1.SelectCommand = "SELECT  CustomerID, CompanyName, ContactName, ContactTitle  FROM  Customers ";
        //filter
        else
            SqlDataSource1.SelectCommand = "SELECT CustomerID, CompanyName, ContactName, ContactTitle  FROM  Customers  WHERE  (CompanyName like  '%" + Text1.Value + "%')";
    }
 
 
    protected void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)
    {
        RadGrid1.CurrentPageIndex = e.NewPageIndex;
        setdatasourceGrid();
        RadGrid1.DataBind();
    }
 
    protected void RadGrid1_PageSizeChanged(object source, Telerik.Web.UI.GridPageSizeChangedEventArgs e)
    {
        setdatasourceGrid();
        RadGrid1.DataBind();
    }
}

jolynice
Top achievements
Rank 1
 answered on 09 Jan 2011
2 answers
64 views
Hello Sir.

I would like to retrieve the value of the seletect row, i have  AllowKeyboardNavigation="true"   and i catch the key enter  
<ClientEvents OnRowDblClick="RowDblClick" OnKeyPress="KeyPress"></ClientEvents>  

When the enter key is pressed i want to go to another detail page based of the value of the row selected.

With RowDblClick i achived correctly but with the event onKeypress i don´t.

Can you help me.

Thanks.


  function RowDblClick(sender, eventArgs)
 {                       
             PacienteId = eventArgs.getDataKeyValue("CustomerID"));
 }

function KeyPress(sender, eventArgs)
{
  ?????????
}

jolynice
Top achievements
Rank 1
 answered on 09 Jan 2011
3 answers
132 views
Hi All,

I have some strange behaviours with the toolbars in the editor.
See the attached images.

The toolbar in the back (screen1) is only showing when you change the default toolstrip, removed the font button

<telerik:RadEditor ID="edtClosed" runat="server" EditModes="Design" EnableResize="False"
                    Height="100px" Language="nl-NL" Width="500px">
                    <Tools>
                        <telerik:EditorToolGroup Tag="MainToolbar">
                            <telerik:EditorTool Name="FindAndReplace" />
                            <telerik:EditorSeparator />
                            <telerik:EditorSplitButton Name="Undo" Width="80px">
                            </telerik:EditorSplitButton>
                            <telerik:EditorSplitButton Name="Redo" Width="80px">
                            </telerik:EditorSplitButton>
                            <telerik:EditorSeparator />
                            <telerik:EditorTool Name="Cut" />
                            <telerik:EditorTool Name="Copy" />
                            <telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
                            <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" />
                        </telerik:EditorToolGroup>
                        <telerik:EditorToolGroup Tag="Formatting">
                            <telerik:EditorTool Name="Bold" />
                            <telerik:EditorTool Name="Italic" />
                            <telerik:EditorTool Name="Underline" />
                            <telerik:EditorSeparator />
                            <telerik:EditorSplitButton Name="ForeColor" Width="80px">
                            </telerik:EditorSplitButton>
                            <telerik:EditorSplitButton Name="BackColor" Width="80px">
                            </telerik:EditorSplitButton>
                        </telerik:EditorToolGroup>
                    </Tools>
                    <Content>
                    </Content>
                </telerik:RadEditor>

With or without a stylesheet, it doesn't mather

In screen2 the dropdown arrows are at the wrong place

What can I do to correct it?

Regards,

Marco
Rumen Jekov
Top achievements
Rank 1
 answered on 08 Jan 2011
1 answer
114 views
I have a bound RadGrid which has three columns that are aggregated (Aggregate="Avg") on it. These three columns are of type currency. My challenge here is that the aggregation needs to be conditional based upon the value in the cell. If the value is $0.00, then it should not be included in the Average calculation. I know this seems odd, but it's the request that my users are giving to me.

Take the following example of the data in a segment of the grid

Sale Amount
$45.00
$50.00
$100.00
$0.00
-----------
Avg $48.75

The average calculation will be the sum of fields divided by the row count or (45 + 50 + 100 + 0) / 4 = 48.75

HOWEVER

What my users want is for this calculation to be (45 + 50 + 100 + 0) / 3 = 65  They want the row with $0.00 to not be included in the average calculation.

The documentation for the Aggregate (http://www.telerik.com/help/aspnet-ajax/grdtotalsingridfooters.html) has a little tidbit on the first page which *might* be what I'm looking for, but I'm not sure if it is or how to use it:

" RadGrid will calculate aggregates over the entire data source and will respect the filter expression applied (if present)"

Any assistance is very much appreciated!


Thank you,
Michael Smith

Mike Nogen
Top achievements
Rank 1
 answered on 08 Jan 2011
1 answer
108 views
hi
please see the attached file
how can i make this picture with treeview?
thanks a lot
niloofar
Top achievements
Rank 1
 answered on 08 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?