Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
172 views
hello,
I am using a radgrid.
In that I have some columns. I am also using sorting functionality of radgrid.
<telerik:RadGrid ID="EmployeeRadGrid" runat="server" AllowPaging="True" DataSourceID="EmployeeDataSource"
                AllowFilteringByColumn="True" AutoGenerateColumns="false" OnItemDataBound="EmployeeRadGrid_ItemDataBound"
                GridLines="None" AllowCustomPaging="true" AllowSorting="true" PageSize="10" >
<MasterTableView AllowMultiColumnSorting="true" ClientDataKeyNames="Id" DataKeyNames="All the column names present in the data"
                    CommandItemDisplay="None" DataSourceID="EmployeeDataSource">
         <Columns>
            <telerik:GridBoundColumn DataField="EmployeeId" UniqueName="EmployeeId" HeaderText="employeeid"
                            SortExpression="EmployeeId" AllowSorting="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                            AutoPostBackOnFilter="true">
              </telerik:GridBoundColumn>
          </Columns>
</MasterTableView>

<asp:ObjectDataSource ID="EmployeeDataSource" runat="server" EnablePaging="True"
                TypeName="Layer where my method is present" SelectCountMethod="getEmployeeCount"
                SelectMethod="getAllEmployee" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortBy" ></asp:ObjectDataSource>



Now when I click on the employeeid column, evrytime the call is going to the method "getAllEmployee" to retrieve the data. That method has "startRowIndex", "maximumRows" and "sortBy parameters.
Everytime the startRowIndex and maximumRows parameter values are received correctly according to page size. But the sortBy value is "" always.

So, when i click on the column employeeid, only that page data is getting sorted. The whole data which is bound to radgrid is not getting sorted.

Any help pls.
Thanks in advance.
Iana Tsolova
Telerik team
 answered on 02 Nov 2010
3 answers
118 views
Hi,

I am using Telerik RadEditor ImageManager to upload the Images to my local folder.
Instead of maintaining the Images in folder, I would like to maintain them in SharePoint. Is it possible?
If Yes.. then how can we achieve it?

Thanks & Regards.
Stanimir
Telerik team
 answered on 02 Nov 2010
2 answers
96 views
I have found multiple threads on this issue but none of the solutions work for me.

I am using the solution from here:
http://www.telerik.com/ClientsFiles/207185_printradgrid-ignorepaging.zip

to print a grid with paging temporarily disabled.  However, this line always returns a null:

var radGrid = $find(radGridId);



I've tried using

var

 

 

grd = $find("<%= radgrdMyPrograms.ClientID %>");

to no avail. I always get a null and then the .get_element().outerHTML fails and, of course, the

 

 

.get_masterTableView().fireCommand(

 

'EnablePaging', '') also fails.


here is my entire .aspx:

 

 

<asp:Content ID="Content1" ContentPlaceHolderID="MasterContentPlaceHolder" Runat="Server">
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
    function PrintRadGrid() {
        var grd = $find("<%= radgrdMyPrograms.ClientID %>");
        var previewWnd = window.open('about:blank', '', '', false);
        var sh = '<%= ClientScript.GetWebResourceUrl(radgrdMyPrograms.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",radgrdMyPrograms.Skin)) %>';
        var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
        var htmlcontent = styleStr + "<body>" + grd.get_element().outerHTML + "</body></html>";
        previewWnd.document.open();
        previewWnd.document.write(htmlcontent);
        previewWnd.document.close();
        previewWnd.print();
        previewWnd.close();
        grd.get_masterTableView().fireCommand('EnablePaging', '');
    }
</script>
</telerik:RadScriptBlock>
<style type="text/css">  
.RadMenu .rmGroup .rmText  {  
    font-size: x-small;
    width: 110px; }  
</style>
  
<table width="100%" cellpadding="0px" cellspacing="0px" style="padding-bottom:4px;">
    <tr>
        <td style="width:220px;"><asp:Label ID="Label1" runat="server" class="LabelDarkGrayMedium" Text="My Programs" /> </td>
        <td><asp:ImageButton ID="btnPrint" runat="server" ImageUrl="../img/Print.gif" ToolTip="Print table"/></td>
    </tr>
</table>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="radgrdMyPrograms">
            <UpdatedControls><telerik:AjaxUpdatedControl ControlID="radgrdMyPrograms" /></UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<xc:LinqDataSourceWrapper ID="ldsProgramsAllByUserName" runat="server" TypeName="DMCproWebApp.BALHelper" SelectMethod="GetProgramsAllByUserName" EnableObjectTracking="false" />
<telerik:RadGrid ID="radgrdMyPrograms" runat="server" Width="100%" DataSourceID="ldsProgramsAllByUserName" EnableLinqExpressions="true"
    EnableEmbeddedSkins="false" Skin="DMCpro" ShowStatusBar="true"
    AutoGenerateColumns="false" AllowFilteringByColumn="true" AllowPaging="true" AllowSorting="true" PageSize="20" >
    <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView TableLayout="Fixed" DataKeyNames="ProgramID,ProgramName,ClientId,Client" >
        <ItemStyle Font-Size="Small" Wrap="false" />
        <AlternatingItemStyle Font-Size="Small" Wrap="false" />
        <Columns>
            <telerik:GridHyperLinkColumn HeaderText="Program #" DataTextField="ProgramID" SortExpression="ProgramID" UniqueName="ProgramID" 
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="80px" HeaderStyle-HorizontalAlign="Left" 
                AllowFiltering="false" />
            <telerik:GridBoundColumn HeaderText="Program" DataField="ProgramName" SortExpression="ProgramName" UniqueName="ProgramName"
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="150px" HeaderStyle-HorizontalAlign="Left"
                AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="150px" />
            <telerik:GridBoundColumn HeaderText="AE" DataField="AEName" SortExpression="AEName" UniqueName="AE"
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="35px" HeaderStyle-HorizontalAlign="Left" 
                AllowFiltering="false" />
            <telerik:GridBoundColumn HeaderText="Start Date" DataField="StartDate" SortExpression="StartDate" UniqueName="StartDate"
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="95px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:MM/dd/yyyy}" DataType="System.String" 
                CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" FilterControlWidth="60px" />
            <telerik:GridBoundColumn HeaderText="End Date" DataField="EndDate" SortExpression="EndDate" UniqueName="EndDate"
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="95px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:MM/dd/yyyy}" DataType="System.String" 
                CurrentFilterFunction="LessThanOrEqualTo" AutoPostBackOnFilter="true" FilterControlWidth="60px" />
            <telerik:GridBoundColumn HeaderText="Status" DataField="Status" SortExpression="Status" UniqueName="Status"
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="92px" HeaderStyle-HorizontalAlign="Left" 
                CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="90px" />
            <telerik:GridBoundColumn HeaderText="Revenue" DataField="Revenue" SortExpression="Revenue" 
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Right" 
                AllowFiltering="false" />
            <telerik:GridHyperLinkColumn HeaderText="Client" DataTextField="Client" SortExpression="Client" UniqueName="Client" 
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="170px" 
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="170px" />
            <telerik:GridBoundColumn HeaderText="Market" DataField="Market" SortExpression="Market"
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="90px" HeaderStyle-HorizontalAlign="Left" 
                AllowFiltering="false" />
            <telerik:GridBoundColumn HeaderText="Bus. Source" DataField="BusinessSource" SortExpression="BusinessSource" 
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" 
                AllowFiltering="false" />
            <telerik:GridBoundColumn HeaderText="Pax" DataField="Guests" SortExpression="Guests"
                HeaderStyle-CssClass="radGridViewHeader" HeaderStyle-Width="45px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Right" 
                AllowFiltering="false" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
</asp:Content>


and the relevant codebehind:

Private Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnPrint.Click
    radgrdMyPrograms.AllowPaging = False
    radgrdMyPrograms.Rebind()
    ScriptManager.RegisterStartupScript(Me.Page, Me.Page.GetType, "PrintGrid", "PrintRadGrid();", True)
End Sub

 

 

Jerry T.
Top achievements
Rank 1
 answered on 02 Nov 2010
1 answer
210 views
hey everyone,

I have a radcombobox & 3 textboxes.on page load radcombobox is visible,and first textbox is not.On combobox selected index change event of combobox,i fill other 2 text boxes for address and phoneNo.I have validated each 4 controls with required field validator,And added a validation summmary.I have added a button of new user where onClick radcombobox is invisible and textbox is visible.

Now,if i fill values for new user that is all through 3 textBoxes i got validation error for combobox "please select an item".And if i am using combobox then my selected index change from codebehind is not fired.Validation asks for "filling address and Phone no."

What to do?...

Thanks
Amit

Simon
Telerik team
 answered on 02 Nov 2010
5 answers
301 views
Hi,

I want to be able to implement client-side validation for data entered into the filter text box of a column. The things I want to check for include:

1. Data type, e.g., only numbers are allowed in a column with numeric data
2. Based on the filter function selected, check that the data has been specified in the correct format. For example, when the EQUALTO function is selected, only a single value is specified (if a comma-separated list is specified instead, it should fail the validation check).

Here's is what I think I would need:

A. When a filter function is selected from the dropdown, a client-side function handles the event. The following information would need to be available:
    (i) The filter function that was clicked
    (ii) The data specified in the filter textbox

I'm not sure how to obtain the above information on the client side. Can you please help implement the above scenario, or suggest an alternative solution?

Thanks.
Radoslav
Telerik team
 answered on 02 Nov 2010
3 answers
506 views
I need to find the data key value (the identity value) of a record immediately after it is inserted.  I tried the GetDataKeyValue method on the GridEditFormInsertItem in the ItemInserted event but it is coming back null.  See below...

 

GridEditFormInsertItem i = (GridEditFormInsertItem)e.Item;

 

 

string keyValue = i.GetDataKeyValue("id").ToString();

I am able to this in the ItemUpdated using almost the exact same code...

 

 

GridEditableItem i= (GridEditableItem)e.Item;

 

 

string keyValue = i.GetDataKeyValue("id").ToString();

and that works.

Anyone know how to do this?

 

Marin
Telerik team
 answered on 02 Nov 2010
1 answer
91 views
Hi Telerik Team,

  Could you please clarify the below query ?

    How can I child grid (DetailsTable) kept open after page refreshing ?
                       

Regards,
Rajesh Kumar C
Mira
Telerik team
 answered on 02 Nov 2010
1 answer
121 views
I wish to read the files uploaded right after they are uploaded.
I tried to use _FileUploaded event but the files are not copied into the target directory until after this event ends.
I don't want two buttons for the user, one for copying the files to the target directory and the other to read the file.

Any sugestions?
Genady Sergeev
Telerik team
 answered on 02 Nov 2010
3 answers
118 views
My Design page
<
telerik:RadTreeView ID="tvPropertyType" runat="server" Skin="Outlook" EnableDragAndDrop="True" OnClientNodeDropping="onNodeDropping" CheckBoxes="True" CheckChildNodes="True" TriStateCheckBoxes="True" EnableDragAndDropBetweenNodes="True" DataSourceID="ObjectDataSource1" DataTextField="DocumentType" DataValueField="DocumentTypeID">
    <Nodes>
    <telerik:RadTreeNode runat="server" Text="Root RadTreeNode1">
        <Nodes>
              <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 1">
                  <NodeTemplate>
                    <telerik:RadGrid ID="rgForTree" runat="server">
                  </telerik:RadGrid>
              </NodeTemplate>
              </telerik:RadTreeNode>
              </Nodes>
        </telerik:RadTreeNode>
     </Nodes>
</telerik:RadTreeView>

My Code Behind
Protected Sub tvPropertyType_NodeDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles tvPropertyType.NodeDataBound
 
Dim rgForTree As RadGrid = DirectCast(e.Node.FindControl("rgForTree"), RadGrid)
        rgForTree.DataSource = Documents.GetPropertyDocumentsForUser(CInt(Me.lblPropertyID.Text), CurrentUser.UserID, e.Node.Value)
        rgForTree.DataBind()
 
    End Sub

I am not able to get the reference for the grid.
I have tried the code in "tvPropertyType_DataBound" as well.
I have tried the same code in a button click which is outside the tree.

Still not able to refer the grid in the treeview node
Nikolay Tsenkov
Telerik team
 answered on 02 Nov 2010
1 answer
93 views
Hi,

I have a Treeview control nested inside a RadComboBox. The Expand mode is ServerSideCallBack. I want to select a node in the tree through javascript. But the branch for that node is not expanded. I know all the ancestors of that node. So I tried to expand that branch starting from the top level parent. I use the following piece of code to expand the parent.

if

 

(parentNode != null && !parentNode.get_expanded()) {

 

_treeFirst.trackChanges();

parentNode.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack);

parentNode.set_expanded(

true);

 

_treeFirst.commitChanges();

}


This expands only the second level parent (the first level parent is already there and expanded on the initial load). I am not able to expand further from the second level. Please help!!
Nikolay Tsenkov
Telerik team
 answered on 02 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?