Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
66 views
Hi,

Currently I am reviewing the most recent ASP.NET Ajax toolkit available from Telerik

With regards to the ASP.NET Ajax RadGrid, is it possible to achieve a multi-record insert functionality similar to that available out of box with the Silverlight RadGrid? Would there be any examples available of ASP.NET Ajax RadGrid implementations that have achieved multi-record insert functionality?
Evidently this would achievable with javascript client side however I would like to know of any known patterns to approach extension of the ASP.NET Ajax Telerik Rad Grid/

Kind regards,

Jean-Paul
Jean-Paul
Top achievements
Rank 1
 answered on 31 May 2013
5 answers
392 views
Hi,
If there is more than one  PivotGridAggregateField (lets say Aggregate="Sum") it adds "Sum of <filedname>" header.
So how can I change "Sum of <filedname>" and more over; "{0} Total" , "Grand Total" texts? I need to localize those strings.

TIA
Eyup
Telerik team
 answered on 31 May 2013
3 answers
69 views
How do you leverage both the Drill Down function and the Rendered Fields together? I see example of each, just not together. I do not want to use grouping. Thanks in advance.
Peter Filipov
Telerik team
 answered on 31 May 2013
5 answers
143 views
Hi .
I have a Scenrio. I want to use RadAlert instead Javascript alert when out of range is Selected in RadCalender. 
For description I am attaching a Screen cast. 
Any Help ?

http://screencast.com/t/6ijQg1Oqc

Regards:
Kamran
Eyup
Telerik team
 answered on 31 May 2013
5 answers
244 views
Hi All, 
I got this RadSplitter test page which takes 100% of the browser's height.
But this only seems working when there is no content before the splitter. If I have some other content above the div that contains RadSplitter this is not working. I am expecting the RadSplitter to take the remaining height available (leaving 120px on top).
Please help me to achieve this. I have tested this in IE 8 and FF 3.5.

Please note I have added 

<

 

div style="height:120px;">

 

    some other content

 

</div>

 

on top of the div that contains RadSplitter.
<%@ Page Language="C#" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Testled Page</title> 
    <style type="text/css">   
    html, body, form   
    {   
        height: 100%;   
        margin: 0px;   
        padding: 0px;   
    }   
    </style> 
</head> 
<body> 
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <div style="height:120px;">  
           some other content  
        </div> 
        <div style="height:100%;">  
        <telerik:RadSplitter ID="s1" runat="server" Orientation="Horizontal" Height="100%" Width="100%">  
            <telerik:RadPane ID="p1" runat="server" Height="150px">  
                NAME:  
                <asp:Label ID="NAMELabel" runat="server" Text="TESTER"></asp:Label> 
                <br /> 
            </telerik:RadPane> 
            <telerik:RadSplitBar ID="b1" runat="server" CollapseMode="Both" /> 
            <telerik:RadPane ID="P2" runat="server">  
                DESCRIPTION:  
                <asp:TextBox ID="DESCRIPTIONTextBox" runat="server" Text="Test Splitter."></asp:TextBox> 
                <br /> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
        </div> 
    </form> 
</body> 
</html> 
 

Thanks.
Vessy
Telerik team
 answered on 31 May 2013
1 answer
64 views
we have a radgrid in a usercontrol created programatically and cusom command template created programatically having different buttons like links , export to excel, export to word , export to PDF and export to CSV.  grid is ajaxified by RadAjaxmanager. Ajax is disabled on export action.
below is the code snipped used to disable ajax on grid export.
   
  <telerik:RadScriptManager ID="RadGridListScriptManager" runat="server" />
   <telerik:RadCodeBlock ID="RadGridListCodeBlock" runat="server">    
  <script type="text/javascript">
  function onRequestStart(sender, args) {
                        if ((args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) || (args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) || (args.get_eventTarget().indexOf("ExportToWordButton") >= 0) || (args.get_eventTarget().indexOf("ExportToPdfButton") >= 0)) {
                            args.set_enableAjax(false);
                        }
                    }

           </script>
           </telerik:RadCodeBlock>  
           <telerik:RadAjaxManager ID="RadGridListAjaxManager" runat="server">
             <ClientEvents OnRequestStart="onRequestStart" />
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGridList">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGridList" LoadingPanelID="RadGridListAjaxLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>               
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadGridListAjaxLoadingPanel" runat="server" Transparency="20"
                CssClass="MyAjaxLoadingPanel" BackColor="#E0E0E0">
                <table style="width: 100%; height: 100%;">
                    <tr style="height: 50%">
                        <td align="center" valign="middle" style="width: 50%">
                            <asp:Image ID="Image1" runat="server" AlternateText="Loading..." class="MyLoadingImage"
                                BorderWidth="0px" ImageUrl="~/images/loading1.gif"></asp:Image>
                        </td>
                    </tr>
                </table>
            </telerik:RadAjaxLoadingPanel>


The issue is when we export and then click on links , the same export action is getting performed and grid doesnot reloads.
I tried to use the below code for registerpostbackcontrols for export buttons but its not working after grid operations like filtering, paging,sorting is performed and exported.

Protected Sub RadGridList_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)
 
  If (TypeOf e.Item Is GridCommandItem) Then
               Dim btncmd As ImageButton = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToExcelButton"), ImageButton)
               RadGridListScriptManager.RegisterPostBackControl(btncmd)
 
               btncmd = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToWordButton"), ImageButton)
               RadGridListScriptManager.RegisterPostBackControl(btncmd)
 
               btncmd = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToCsvButton"), ImageButton)
               RadGridListScriptManager.RegisterPostBackControl(btncmd)
 
               btncmd = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToPdfButton"), ImageButton)
               RadGridListScriptManager.RegisterPostBackControl(btncmd)
           End If
 
End Sub
we need your help on this at earliest.
Kostadin
Telerik team
 answered on 31 May 2013
1 answer
560 views
Greetings,

I have a RagGrid with Export to Excel enabled.  It exports the file, but the loading panel keeps spinning after the export.  Can you tell me what I am missing?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
  <title>Export Test</title>
  <script type="text/javascript">
    function onRequestStart(sender, args) {
      if (args.get_eventTarget().indexOf("ExportTo") >= 0) {
        args.set_enableAjax(false);
      }
    }
  </script>
</head>
<body>
  <form id="form1" runat="server">
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
  </telerik:RadScriptManager>
  <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="GridFormDetailsViews,Buttons,Textbox,CheckBoxes,RadioButtons,Scrollbars,Textarea,Select" />
  <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
  </telerik:RadAjaxLoadingPanel>
  <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <ClientEvents OnRequestStart="onRequestStart"></ClientEvents>
      <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grdItemSearchResults">
          <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="grdItemSearchResults"></telerik:AjaxUpdatedControl>
          </UpdatedControls>
        </telerik:AjaxSetting>
      </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
      <table width="100%">
        <tr>
          <td colspan="2">
            <h3>
              Item Search</h3>
          </td>
        </tr>
        <tr>
          <td width="250" align="right" valign="top">
            Receipt #
          </td>
          <td>
            <asp:TextBox ID="txtItemCartID" MaxLength="100" CssClass="inputWidth" runat="server"></asp:TextBox>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Item #
          </td>
          <td>
            <asp:TextBox ID="txtItemPurchaseID" MaxLength="100" CssClass="inputWidth" runat="server"></asp:TextBox>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            * Start Date
          </td>
          <td>
            <asp:TextBox ID="txtItemStartDate" MaxLength="100" CssClass="inputWidth" runat="server"></asp:TextBox>
            <asp:Label ID="errItemStartDate" runat="server" ForeColor="Red"></asp:Label>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            * End Date
          </td>
          <td>
            <asp:TextBox ID="txtItemEndDate" MaxLength="100" CssClass="inputWidth" runat="server"></asp:TextBox>
            <asp:Label ID="errItemEndDate" runat="server" ForeColor="Red"></asp:Label>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Customer First Name
          </td>
          <td>
            <asp:TextBox ID="txtItemCustomerFirstName" MaxLength="100" CssClass="inputWidth"
              runat="server"></asp:TextBox>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Customer Last Name
          </td>
          <td>
            <asp:TextBox ID="txtItemCustomerLastName" MaxLength="100" CssClass="inputWidth" runat="server"></asp:TextBox>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Purchase Identifier
          </td>
          <td>
            <asp:TextBox ID="txtItemPurchaseIdentifier" MaxLength="100" CssClass="inputWidth"
              runat="server"></asp:TextBox>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Comments
          </td>
          <td>
            <asp:TextBox ID="txtItemComments" MaxLength="1000" CssClass="inputWidth" runat="server"
              Rows="5" TextMode="MultiLine"></asp:TextBox>
          </td>
        </tr>
        <tr>
          <td>
              
          </td>
          <td>
            <asp:LinkButton ID="btnItemSelectAll" runat="server" OnClick="btnItemSelectAll_Click">Select All</asp:LinkButton>
               
            <asp:LinkButton ID="btnItemSelectNone" runat="server" OnClick="btnItemSelectNone_Click">Select None</asp:LinkButton>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Purchase Type
          </td>
          <td>
            <asp:CheckBoxList ID="chkItemPurchaseType" runat="server" DataTextField="PurchaseTypeName"
              DataValueField="PurchaseTypeID" DataSourceID="objPurchaseType" RepeatColumns="3">
            </asp:CheckBoxList>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Cashier
          </td>
          <td>
            <asp:CheckBoxList ID="chkItemUser" runat="server" RepeatColumns="3" DataSourceID="objUser"
              DataTextField="UserFullName" DataValueField="UserID">
            </asp:CheckBoxList>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top">
            Location
          </td>
          <td>
            <asp:CheckBoxList ID="chkItemLocation" runat="server" RepeatColumns="3" DataSourceID="objLocation"
              DataTextField="LocationName" DataValueField="LocationID">
            </asp:CheckBoxList>
          </td>
        </tr>
        <tr>
          <td>
              
          </td>
          <td>
            <telerik:RadButton ID="btnItemSearch" runat="server" Text="Search" Icon-PrimaryIconCssClass="rbSearch"
              ForeColor="White" OnClick="btnItemSearch_Click">
            </telerik:RadButton>
            <telerik:RadButton ID="btnItemReset" runat="server" ForeColor="White" Icon-PrimaryIconCssClass="rbRefresh"
              OnClick="btnItemReset_Click" Text="Reset">
            </telerik:RadButton>
          </td>
        </tr>
        <tr>
          <td colspan="2">
              
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <h3>
              <asp:Label ID="lblItemSearchCount" runat="server"></asp:Label>
              Records Found</h3>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <telerik:RadGrid ID="grdItemSearchResults" runat="server" AllowPaging="True" AllowSorting="True"
              AutoGenerateColumns="False" CellSpacing="0" GridLines="None" OnNeedDataSource="grdItemSearchResults_NeedDataSource"
              OnItemCommand="grdItemSearchResults_ItemCommand" PageSize="20">
              <MasterTableView DataKeyNames="PurchaseID" NoMasterRecordsText="No items were found."
                HeaderStyle-ForeColor="White" CommandItemDisplay="Top">
                <CommandItemSettings ExportToPdfText="Export to PDF" ShowExportToWordButton="true"
                  ShowExportToExcelButton="true" ShowExportToCsvButton="true" ShowExportToPdfButton="true" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                  <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                  <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                  <telerik:GridBoundColumn DataField="CartID" DataType="System.Int32" FilterControlAltText="Filter CartID column"
                    HeaderText="Receipt #" SortExpression="CartID" UniqueName="CartID">
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PurchaseID" DataType="System.Int32" FilterControlAltText="Filter PurchaseID column"
                    HeaderText="Item #" ReadOnly="True" SortExpression="PurchaseID" UniqueName="PurchaseID">
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="CartDate" DataType="System.DateTime" FilterControlAltText="Filter CartDate column"
                    HeaderText="Date" SortExpression="CartDate" UniqueName="CartDate" DataFormatString="{0:d}">
                  </telerik:GridBoundColumn>
                  <telerik:GridTemplateColumn HeaderText="Customer" SortExpression="CustomerFirstName">
                    <ItemTemplate>
                      <asp:Label ID="lblCustomerFullName" runat="server" Text='<%# String.Format("{0} {1}", Eval("CustomerFirstName"), Eval("CustomerLastName")) %>'></asp:Label>
                    </ItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridBoundColumn DataField="PurchaseTypeName" FilterControlAltText="Filter PurchaseTypeName column"
                    HeaderText="Type" SortExpression="PurchaseTypeName" UniqueName="PurchaseTypeName">
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PurchaseIdentifier" FilterControlAltText="Filter PurchaseIdentifier column"
                    HeaderText="Identifier" SortExpression="PurchaseIdentifier" UniqueName="PurchaseIdentifier">
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PurchaseAmount" DataType="System.Decimal" FilterControlAltText="Filter PurchaseAmount column"
                    HeaderText="Amount" SortExpression="PurchaseAmount" UniqueName="PurchaseAmount"
                    DataFormatString="{0:C}">
                  </telerik:GridBoundColumn>
                  <telerik:GridTemplateColumn HeaderText="Cashier" SortExpression="UserFirstName">
                    <ItemTemplate>
                      <asp:Label ID="lblUserFullName" runat="server" Text='<%# String.Format("{0} {1}", Eval("UserFirstName"), Eval("UserLastName")) %>'></asp:Label>
                    </ItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridBoundColumn DataField="LocationName" FilterControlAltText="Filter LocationName column"
                    HeaderText="Location" SortExpression="LocationName" UniqueName="LocationName">
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PurchaseStatusName" FilterControlAltText="Filter PurchaseStatusName column"
                    HeaderText="Status" SortExpression="PurchaseStatusName" UniqueName="PurchaseStatusName">
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="ChangeLogMessage" FilterControlAltText="Filter ChangeLogMessage column"
                    HeaderText="Comment" ReadOnly="True" SortExpression="ChangeLogMessage" UniqueName="ChangeLogMessage">
                  </telerik:GridBoundColumn>
                  <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                      <telerik:RadButton ID="btnItemDetails" runat="server" ForeColor="White" Icon-PrimaryIconCssClass="rbOpen"
                        Text="Details" CommandArgument='<%# Bind("CartID") %>' OnCommand="btnItemDetails_Command">
                      </telerik:RadButton>
                    </ItemTemplate>
                  </telerik:GridTemplateColumn>
                </Columns>
                <EditFormSettings>
                  <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                  </EditColumn>
                </EditFormSettings>
                <PagerStyle PageSizeControlType="RadComboBox" />
              </MasterTableView>
              <PagerStyle PageSizeControlType="RadComboBox" />
              <FilterMenu EnableImageSprites="False">
              </FilterMenu>
            </telerik:RadGrid>
          </td>
        </tr>
      </table>
    </div>
    <asp:ObjectDataSource ID="objPurchaseType" runat="server" OldValuesParameterFormatString="original_{0}"
      SelectMethod="GetData" TypeName="dsKCSOCashierTableAdapters.PurchaseTypeSearchDLLTableAdapter">
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="objUser" runat="server" OldValuesParameterFormatString="original_{0}"
      SelectMethod="GetData" TypeName="dsKCSOCashierTableAdapters.UserSearchDLLTableAdapter">
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="objLocation" runat="server" OldValuesParameterFormatString="original_{0}"
      SelectMethod="GetData" TypeName="dsKCSOCashierTableAdapters.LocationSearchDLLTableAdapter">
    </asp:ObjectDataSource>
  </telerik:RadAjaxPanel>
  </form>
</body>
</html>

using System;
using System.Web.UI.WebControls;
using dsKCSOCashierTableAdapters;
 
public partial class Test : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!IsPostBack)
    {
      ResetValidation();
      ResetItemSearch();
    }
  }
  private void SearchItems()
  {
    grdItemSearchResults.Rebind();
  }
  private void ResetValidation()
  {
    errItemStartDate.Text = "";
    errItemEndDate.Text = "";
  }
  private bool ValidateItemSearch()
  {
    bool valid = true;
 
    DateTime startDate = DateTime.Now.AddDays(1);
    DateTime endDate = DateTime.Now;
 
    if (txtItemEndDate.Text.Trim() == string.Empty)
    {
      errItemEndDate.Text = "Required";
      txtItemEndDate.Focus();
      valid = false;
    }
    else if (!DateTime.TryParse(txtItemEndDate.Text.Trim(), out endDate))
    {
      errItemEndDate.Text = "Invalid (MM/DD/YYYY)";
      txtItemEndDate.Focus();
      valid = false;
    }
 
    if (txtItemStartDate.Text.Trim() == string.Empty)
    {
      errItemStartDate.Text = "Required";
      txtItemStartDate.Focus();
      valid = false;
    }
    else if (!DateTime.TryParse(txtItemStartDate.Text.Trim(), out startDate))
    {
      errItemStartDate.Text = "Invalid (MM/DD/YYYY)";
      txtItemStartDate.Focus();
      valid = false;
    }
 
    if (valid)
    {
      if (startDate > endDate)
      {
        errItemStartDate.Text = "Can not be after end date";
        errItemEndDate.Text = "Can not be before start date";
        txtItemStartDate.Focus();
        valid = false;
      }
    }
 
    return valid;
  }
  protected void btnItemSelectAll_Click(object sender, EventArgs e)
  {
    SelectItemCheckBoxes(true);
  }
  protected void btnItemSelectNone_Click(object sender, EventArgs e)
  {
    SelectItemCheckBoxes(false);
  }
  private void SelectItemCheckBoxes(bool checkAll)
  {
    chkItemPurchaseType.Items.Clear();
    chkItemPurchaseType.DataBind();
    foreach (ListItem item in chkItemPurchaseType.Items)
    {
      item.Selected = checkAll;
    }
    chkItemUser.Items.Clear();
    chkItemUser.DataBind();
    KCSOCashierSecurity clsSec = new KCSOCashierSecurity(Context.User.Identity.Name.Substring(7));
    if (clsSec.GetIsAdmin())
    {
      foreach (ListItem item in chkItemUser.Items)
      {
        item.Enabled = true;
        item.Selected = checkAll;
      }
    }
    else
    {
      string userID = clsSec.GetUserID().ToString();
      foreach (ListItem item in chkItemUser.Items)
      {
 
        if (item.Value == userID)
        {
          item.Enabled = true;
          item.Selected = checkAll;
        }
        else
        {
          item.Selected = false;
          item.Enabled = false;
        }
 
      }
    }
    chkItemLocation.Items.Clear();
    chkItemLocation.DataBind();
    foreach (ListItem item in chkItemLocation.Items)
    {
      item.Selected = checkAll;
    }
  }
  protected void btnItemSearch_Click(object sender, EventArgs e)
  {
    SearchItems();
  }
  protected void btnItemReset_Click(object sender, EventArgs e)
  {
    ResetValidation();
    ResetItemSearch();
    SearchItems();
  }
  private void ResetItemSearch()
  {
    txtItemCartID.Text = "";
    txtItemPurchaseID.Text = "";
    txtItemStartDate.Text = DateTime.Now.ToShortDateString();
    txtItemEndDate.Text = DateTime.Now.ToShortDateString();
    txtItemCustomerFirstName.Text = "";
    txtItemCustomerLastName.Text = "";
    txtItemPurchaseIdentifier.Text = "";
    txtItemComments.Text = "";
    SelectItemCheckBoxes(true);
  }
  protected void btnItemDetails_Command(object sender, CommandEventArgs e)
  {
 
    string cartID = e.CommandArgument.ToString();
    Response.Redirect("Details.aspx?cartid=" + cartID, true);
  }
  protected void grdItemSearchResults_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
  {
    ResetValidation();
    if (ValidateItemSearch())
    {
      string purchaseTypeIDList = "";
      foreach (ListItem cb in chkItemPurchaseType.Items)
      {
        if (cb.Selected)
        {
          purchaseTypeIDList += cb.Value + ",";
        }
      }
      string userIDList = "";
      foreach (ListItem cb in chkItemUser.Items)
      {
        if (cb.Selected)
        {
          userIDList += cb.Value + ",";
        }
      }
      string locationIDList = "";
      foreach (ListItem cb in chkItemLocation.Items)
      {
        if (cb.Selected)
        {
          locationIDList += cb.Value + ",";
        }
      }
      Purchase_ItemSearch_WithComments_spTableAdapter taItem = new Purchase_ItemSearch_WithComments_spTableAdapter();
      dsKCSOCashier.Purchase_ItemSearch_WithComments_spDataTable dtItem = taItem.GetData("%" + txtItemCartID.Text.Trim() + "%",
                                                                                         "%" + txtItemPurchaseID.Text.Trim() + "%",
                                                                                         Convert.ToDateTime(txtItemStartDate.Text.Trim() + " 00:00:00"),
                                                                                         Convert.ToDateTime(txtItemEndDate.Text.Trim() + " 23:59:59"),
                                                                                         "%" + txtItemCustomerFirstName.Text.Trim() + "%",
                                                                                         "%" + txtItemCustomerLastName.Text.Trim() + "%",
                                                                                         "%" + txtItemPurchaseIdentifier.Text.Trim() + "%",
                                                                                         purchaseTypeIDList,
                                                                                         userIDList,
                                                                                         locationIDList,
                                                                                         "%" + txtItemComments.Text.Trim() + "%");
      grdItemSearchResults.DataSource = dtItem;
    }
    else
    {
      grdItemSearchResults.DataSource = null;
    }
  }
  protected void grdItemSearchResults_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
  {
    if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||
                e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||
                e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName ||
                e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName)
    {
      ConfigureExport();
    }
  }
  public void ConfigureExport()
  {
    grdItemSearchResults.ExportSettings.ExportOnlyData = true;
    grdItemSearchResults.ExportSettings.IgnorePaging = true;
    grdItemSearchResults.ExportSettings.OpenInNewWindow = true;
    grdItemSearchResults.ExportSettings.UseItemStyles = true;
  }
}


Thank you!

Matt
Andrey
Telerik team
 answered on 31 May 2013
1 answer
132 views
we have a telerik radgrid in a usercontrol created programatically with default group by expression added programatically.
Issue we are facing is grid feature like paging, sorting, drag and drop on grouping panel doesnot work only on IE browser if default groupbyexpression added is for date field. Date field is stored in database as Datetime and we are retrieving as it is from database and formatting the column using radgrid's gridDatetimeColumn DataFormatString = "{0:MM/dd/yyyy}". 
Below is the code snipped used 

    For Each dc As DataColumn In RadGridList.DataSource.Columns
                Dim objcolentity As New BoundColsEntity()
                objcolentity = LstBoundColsEntity(LstColCount(dc.ColumnName))
                If objcolentity.visiblity = True Then
                    Select Case objcolentity.ColumnFilterType
                        Case "DateSelction"
                            Dim datecolumn As New GridDateTimeColumn
                            datecolumn.DataField = dc.ColumnName
                            datecolumn.UniqueName = dc.ColumnName
                            datecolumn.HeaderText = objlistCmnFncs.OrgtermReplace(objcolentity.columnDisplayName.ToString)
                            datecolumn.FilterControlWidth = Unit.Pixel(120)
                            datecolumn.ItemStyle.Height = Unit.Pixel(40)
                            datecolumn.HeaderStyle.Width = Unit.Pixel(170)
                            datecolumn.Visible = True
                            datecolumn.SortExpression = dc.ColumnName
                            datecolumn.PickerType = GridDateTimeColumnPickerType.DatePicker
                            datecolumn.EnableTimeIndependentFiltering = True
                            datecolumn.DataFormatString = "{0:MM/dd/yyyy}"
                            datecolumn.FilterListOptions = GridFilterListOptions.VaryByDataType
                            datecolumn.Groupable = enableGrouping
                            RadGridList.MasterTableView.Columns.Add(datecolumn)
                        Case "DBvalues"
                            Dim ComboFilterColumn As New DBFilter(dc.ColumnName, RadGridList.DataSource)
                            ComboFilterColumn.DataField = dc.ColumnName
                            ComboFilterColumn.UniqueName = dc.ColumnName
                            ComboFilterColumn.HeaderText = objlistCmnFncs.OrgtermReplace(objcolentity.columnDisplayName.ToString)
                            ComboFilterColumn.Visible = objcolentity.visiblity
                            ComboFilterColumn.ItemStyle.Height = Unit.Pixel(40)
                            ComboFilterColumn.HeaderStyle.Width = Unit.Pixel(objcolentity.width)
                            ComboFilterColumn.Resizable = objcolentity.Resizable
                            ComboFilterColumn.Reorderable = objcolentity.Reorderable
                            ComboFilterColumn.AllowSorting = objcolentity.enableSorting
                            ComboFilterColumn.Groupable = objcolentity.enableGrouping
                            ComboFilterColumn.FilterListOptions = GridFilterListOptions.VaryByDataType
                            ComboFilterColumn.AllowFiltering = True
                            ComboFilterColumn.ShowFilterIcon = False
                            RadGridList.MasterTableView.Columns.Add(ComboFilterColumn)
                        Case Else
                            Dim boundcolumn As New GridBoundColumn()
                            boundcolumn.DataField = dc.ColumnName
                            boundcolumn.UniqueName = dc.ColumnName
                            boundcolumn.HeaderText = objlistCmnFncs.OrgtermReplace(objcolentity.columnDisplayName.ToString)
                            boundcolumn.Visible = objcolentity.visiblity
                            boundcolumn.ItemStyle.Height = Unit.Pixel(40)
                            boundcolumn.HeaderStyle.Width = Unit.Pixel(objcolentity.width)
                            boundcolumn.Resizable = objcolentity.Resizable
                            boundcolumn.Reorderable = objcolentity.Reorderable
                            boundcolumn.AllowSorting = objcolentity.enableSorting
                            boundcolumn.Groupable = objcolentity.enableGrouping
                            boundcolumn.FilterListOptions = GridFilterListOptions.VaryByDataType
                            boundcolumn.HtmlEncode = True
                            Select Case objcolentity.ColumnFilterType
                                Case "StringContains"
                                    boundcolumn.AllowFiltering = True
                                    boundcolumn.ShowFilterIcon = False
                                    boundcolumn.FilterControlToolTip = "Hit enter to search"
                                    boundcolumn.AutoPostBackOnFilter = True
                                Case "NoFilter"
                                    boundcolumn.AllowFiltering = False
                                    If Not String.IsNullOrEmpty(objcolentity.headerType) Then
                                        boundcolumn.HeaderImageUrl = objcolentity.path
                                    End If
                                Case Else
                                    boundcolumn.ShowFilterIcon = True
                            End Select
                            RadGridList.MasterTableView.Columns.Add(boundcolumn)
                    End Select
                    If objcolentity.DefaultGrpByExp Then
                        Dim gridGrpByExp As New GridGroupByExpression()
                        Dim gridGroupByField As New GridGroupByField()
                        gridGroupByField = New GridGroupByField
                        gridGroupByField.FieldName = dc.ColumnName
                        gridGroupByField.HeaderText = objlistCmnFncs.OrgtermReplace(objcolentity.columnDisplayName.ToString)
                        gridGrpByExp.SelectFields.Add(gridGroupByField)
                        gridGroupByField = New GridGroupByField
                        gridGroupByField.FieldName = dc.ColumnName
                        gridGrpByExp.GroupByFields.Add(gridGroupByField)
                        RadGridList.MasterTableView.GroupByExpressions.Add(gridGrpByExp)
                    End If
                End If
            Next
Eyup
Telerik team
 answered on 31 May 2013
1 answer
111 views
Hi,

Not really a Telerik product specific question but you guys make some awesome controls and seems to have a deep insight into .net custom controls.

In .net 4.5 the ItemType property was introduced which when specified provides intellisense/strongly typed access to the type which a data control is bound to. 

Repeater - which interits from Control has this property, 

I've tried to figure out how this mechanism works but all the tutorials and articles on this property only describe how to use it, not how to implement it in custom controls. 

Maybe you guys could shed some light on this? 
Slav
Telerik team
 answered on 31 May 2013
3 answers
110 views
When using radgrid filter like below, if the bound column is float, the filter has "0.00" as defaut value, is there anyway can have blank in the filter instead of "0.00"?

http://demos.telerik.com/aspnet-ajax/filter/examples/overview/defaultcs.aspx

Thanks
Eyup
Telerik team
 answered on 31 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?