Telerik Forums
UI for ASP.NET AJAX Forum
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
207 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
40 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
272 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
66 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
140 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
119 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
112 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
1 answer
60 views
I am using the RadGrid in a page - but for some reason it displays without any skin / styling. The grid is in a usercontrol - and I have a RadFormDecorator declared in the main page.

Here is the code I am using to display the grid:
<telerik:RadGrid ID="AddUserGrid" AutoGenerateColumns="false" ShowFooter="true" Width="400px" runat="server">
 <PagerStyle Mode="NextPrevAndNumeric" />
 <MasterTableView AutoGenerateColumns="false" TableLayout="Auto" ShowFooter="true">
     <Columns>
         <telerik:GridBoundColumn DataField="email" HeaderText="Email" />
         <telerik:GridBoundColumn DataField="username" HeaderText="UserName" />
                                 
     </Columns>
 </MasterTableView>
 <ClientSettings>
     <Selecting AllowRowSelect="true" />
 </ClientSettings>
 
 </telerik:RadGrid>

And here is how it looks:
Rendered Grid

Any idea on why all the style would be missing?
Christopher
Top achievements
Rank 1
 answered on 07 Jan 2011
9 answers
363 views
I am trying to do the tutorial located at:http://www.telerik.com/help/aspnet-ajax/grddesigncreatinghierarchicalgrids.html that a telerik staffer recommended I complete.  The problem is (as always) I can not find all the components to even learn the tutorial, namely, the ACCESS database file called Nwind.mdb.  I looked in the Live Demos/App_Data file (C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Data) and there is no Nwind.mdb file residing there.  I performed a search on my box and found this particular ACCESS database within another application (Developer Express .net), but nothing in the Live Demos/App_Data folder as the tutorial instructs, only Northwind.mdf and the Northwind.ldf. 

Now because I needed the .MDB file, not a .MDF file, I copied and pasted the Nwind.mdb file from the Developer Express folder and pasted it in the Live Demos/App_Data folder in Telerik.  I then copied said database file from the Dev Express directory and pasted it from that directory into the Live Demos/App_Data file of my telerik project as the tutorial instructs.  However, when I try to configure the database to the AccessDataSource1 control for the RadGrid to display the data, I keep receiving the following error:

  • Database schema could not be retrieved for this connection.  Please make sure the connections settings are correct and that the databse i online.  Unspecified error

Why can't I connect to the database?  I'm online, which I don't know how that makes any difference since the Live Demos/App_data directory is on hard drive.
 

Dan
Top achievements
Rank 2
 answered on 07 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?