Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
118 views
Hi Telerik,

I'm facing an undesired duplicate recording problem with RadGrid when the user accidentally hit the insert link more than once.

The radgrid will execute the insertion twice, I've tried some solution such as Response.Redirect to the same page in the OnItemInserted event, but it will not help due to the fact that the insert command is already sent twice.

I came across a post in the forum mentioning the same issue here, but the admin seems to have misunderstood the question, much appreciated if this time someone can give a better instruction on the problem.

If one double-click can't mimic the problem, click on the insert link nonstop with certain frequency until the page is refreshed, you'll see multiple same record are inserted into the radgrid.

Hope I'm clear here.

Best regards.
Princy
Top achievements
Rank 2
 answered on 21 Jun 2014
0 answers
180 views
I am having an issue in the Kendo HTML 5 Scheduler.  I am setting the Scheduler to Etc/UTC, which as I understand it, should display the event at the time it comes in.  However, it appears to be adjusting the event to the browser timezone.

I edited the demo site to recreate this problem.  Here is the code: http://trykendoui.telerik.com/URux/3

If you run this, the event shows up at your local time, even though it's set to epoch 1403229600000 which is 2:00am UTC.  I'm in Mountain Time, so it shows up at 8:00pm the previous day (-6 hours UTC) in the schedule.

Now look at http://trykendoui.telerik.com/URux

The following lines have changed:
      StartTimezone: null, to StartTimezone: "Etc/UTC",
and
      EndTimezone: null, to EndTimezone: "Etc/UTC",

The event shows up correctly, however, now try and drag it to a new date.  It saves to the local browser time again.

Am I doing something wrong here?
Scott
Top achievements
Rank 1
 asked on 20 Jun 2014
4 answers
270 views
I used a previous example of how to use CSS to format the RadMenu and it has worked for the most part.  I am having trouble with two different items. The first is it appears that I have a separator and I can't figure out how to get rid of it - I tried in the css to make border 0 and width 0 but that did not seem to help.  The bigger issue is how to get the background down to the second level.  The css works great for the root and 1st level but I cannot figure out how to get the second level menu to have the same background.  Finally, is there a way to get the right arrows that show a sub menu to be a different color (or change the image)?

The image of what I'm getting is an attachment.

Here is the css I'm using:

 

div.RadMenu_Default ul.rmRootGroup

 

{

 

background:#344A7C url(App_Themes/Default/images/menu_bg.jpg) top left repeat-x;

 

 

border: 0;

 

}

 

div.RadMenu_Default .rmHorizontal .rmSeparator

 

{

 

width:0px;

 

 

border:0px;

 

}

 

div.RadMenu_Default .rmRootGroup .rmLink

 

{

 

font-weight: bold;

 

 

line-height:30px;

 

 

font-size: 12pt;

 

 

color: #fff;

 

}

 

div.RadMenu_Default .rmItem .rmLink:hover,

 

 

div.RadMenu_Default .rmItem .rmFocused,

 

 

div.RadMenu_Default .rmItem .rmSelected,

 

 

div.RadMenu_Default .rmItem .rmExpanded {

 

 

background:#344A7C url(App_Themes/Default/images/menu_bg.jpg) top left repeat-x;

 

 

border: 0;

 

 

color: yellow;

 

}

 

/*for subitems */

 

 

div.RadMenu_Default ul.rmGroup

 

{

 

background:#344A7C url(App_Themes/Default/images/menu_hover.jpg) top left repeat-x;

 

}

 

div.RadMenu_Default .rmGroup .rmLink

 

{

 

font-weight:normal;

 

 

line-height:24px;

 

 

font-size: 10pt;

 

 

color: red;

 

}

 

div.RadMenu_Default .rmGroup .rmItem .rmLink:hover,

 

 

div.RadMenu_Default .rmGroup .rmItem .rmFocused,

 

 

div.RadMenu_Default .rmGroup .rmItem .rmSelected,

 

 

div.RadMenu_Default .rmGroup .rmItem .rmExpanded {

 

 

background:#344A7C url(App_Themes/Default/images/menu_bg.jpg) top left repeat-x;

 

 

border: 0;

 

 

color: yellow;

 

}



any help you can provide will be greatly appreciated.

Thanks,

Steve
Boyan Dimitrov
Telerik team
 answered on 20 Jun 2014
2 answers
116 views
Hello,

I have noticed the following behaviour with UI for ASP.NET AJAX controls.
If you put a RadGrid on the default page and surf to the url: http://localhost:1234/ the events like sorting do not get fired. Well, you see a postback, but the sorting is not done. If you surf to the page explicitly (http://localhost:1234/default.aspx) it functions as expected. 
Same goes for i.e. RadMenu OnItemClick event. This does not get fired, unless you specifically go to the page. 

Is this a known issue and can one by-pass this, other than surfing to that specific page?
Frank Witte
Top achievements
Rank 1
 answered on 20 Jun 2014
2 answers
246 views
I have a RadComboBox (cbSCAT) that is designed with multiple columns that resides inside of a RadGrid.  It looks like this:
<telerik:RadGrid ID="rgChartOfAccts" runat="server" Skin="Metro" CellSpacing="-1" GridLines="Both" Width="98%" AllowPaging="True">
<ClientSettings>
    <Scrolling AllowScroll="True" SaveScrollPosition="True" UseStaticHeaders="True"></Scrolling>
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" DataKeyNames="COA_ID,COA_GL_ACCOUNT" CommandItemDisplay="Top"
    InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="PopUp" Name="ChartOfAccts">
    <CommandItemSettings ShowExportToExcelButton="true" ShowRefreshButton="False" AddNewRecordText="Add new Account" />
    <RowIndicatorColumn Visible="False">
    </RowIndicatorColumn>
    <ExpandCollapseColumn Created="True">
    </ExpandCollapseColumn>
    <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton" Exportable="False" HeaderStyle-Width="30px" ColumnGroupName="grpCOA" />
    <telerik:GridTemplateColumn HeaderText="Account" UniqueName="COA_GL_ACCOUNT" ColumnGroupName="grpCOA">
        <EditItemTemplate>
        <telerik:RadTextBox ID="txtCOA_Acct" runat="server" Text='<%# Bind("COA_GL_ACCOUNT")%>' Width="490px" MaxLength="150"></telerik:RadTextBox>
        <asp:RequiredFieldValidator ID="rfvCOA_Acct" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtCOA_Acct" Text="*" Font-Size="Small" SetFocusOnError="True"></asp:RequiredFieldValidator>
        </EditItemTemplate>
        <ItemTemplate>
        <asp:Label ID="lblCOA_Acct" runat="server" Text='<%# Eval("COA_GL_ACCOUNT")%>'></asp:Label>
        </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn HeaderText="Description" UniqueName="COA_DESCRIPTION" ColumnGroupName="grpCOA">
        <EditItemTemplate>
        <telerik:RadTextBox ID="txtCOA_Desc" runat="server" Text='<%# Bind("COA_DESCRIPTION")%>' Width="490px" MaxLength="150"></telerik:RadTextBox>
        </EditItemTemplate>
        <ItemTemplate>
        <asp:Label ID="lblCOA_Desc" runat="server" Text='<%# Eval("COA_DESCRIPTION")%>'></asp:Label>
        </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn HeaderText="Category" UniqueName="COA_CATEGORY" ColumnGroupName="grpCOA">
        <EditItemTemplate>
        <telerik:RadTextBox ID="txtCOA_Cat" runat="server" Text='<%# Bind("COA_CATEGORY")%>' Width="490px" MaxLength="150"></telerik:RadTextBox>
        </EditItemTemplate>
        <ItemTemplate>
        <asp:Label ID="lblCOA_Cat" runat="server" Text='<%# Eval("COA_CATEGORY")%>'></asp:Label>
        </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn HeaderText="Contra Account" UniqueName="COA_CONTRA_ACCOUNT" ColumnGroupName="grpCOA">
        <EditItemTemplate>
        <telerik:RadTextBox ID="txtCOA_Contra" runat="server" Text='<%# Bind("COA_CONTRA_ACCOUNT")%>' Width="490px" MaxLength="150"></telerik:RadTextBox>
        <asp:RequiredFieldValidator ID="rfvCOA_Contra" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtCOA_Contra" Text="*" Font-Size="Small" SetFocusOnError="True"></asp:RequiredFieldValidator>
        </EditItemTemplate>
        <ItemTemplate>
        <asp:Label ID="lblCOA_Contra" runat="server" Text='<%# Eval("COA_CONTRA_ACCOUNT")%>'></asp:Label>
        </ItemTemplate>
    </telerik:GridTemplateColumn>
    <telerik:GridButtonColumn ConfirmText="Delete this Account?" ConfirmDialogType="RadWindow" ColumnGroupName="grpCOA"
        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Exportable="False" HeaderStyle-Width="30px" />
    </Columns>
    <DetailTables>
    <telerik:GridTableView Name="RateTypeAss" CommandItemDisplay="Top" DataSourceID="" EditMode="PopUp"
        DataKeyNames="RTA_ID" runat="server" Width="100%" BackColor="#FFCC66" AlternatingItemStyle-BackColor="#FFCC66"
        HeaderStyle-BackColor="#FFCC66" ClientDataKeyNames="RTA_ID,COA_GL_ACCOUNT" AutoGenerateColumns="False" ShowHeadersWhenNoRecords="True"
        EnableNoRecordsTemplate="True" NoDetailRecordsText="No Associated records to display.">
        <CommandItemSettings ShowAddNewRecordButton="True" ShowRefreshButton="False" ShowExportToExcelButton="True" AddNewRecordText="Add new Association" />
        <ParentTableRelation>
        <telerik:GridRelationFields DetailKeyField="COA_GL_ACCOUNT" MasterKeyField="COA_GL_ACCOUNT" />
        </ParentTableRelation>
        <NoRecordsTemplate>No records to display.</NoRecordsTemplate>
        <RowIndicatorColumn Visible="False">
        </RowIndicatorColumn>
        <EditFormSettings PopUpSettings-Width="600px" InsertCaption="New Association" PopUpSettings-Modal="True">
        <EditColumn ButtonType="ImageButton" />
        </EditFormSettings>                                   
        <Columns>
        <telerik:GridEditCommandColumn ButtonType="ImageButton" Exportable="False" HeaderStyle-Width="30px" />
        <telerik:GridTemplateColumn HeaderText="Account" UniqueName="COA_GL_ACCOUNT">
            <EditItemTemplate>
              <asp:Label ID="lblAcctA" runat="server" Text='<%# Bind("COA_GL_ACCOUNT")%>'></asp:Label>
            </EditItemTemplate>
            <ItemTemplate>
              <asp:Label ID="lblAcctB" runat="server" Text='<%# Eval("COA_GL_ACCOUNT")%>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
 
        <telerik:GridTemplateColumn HeaderText="List Code" UniqueName="RATE_TYPE_LIST_CODE">
            <EditItemTemplate>
            <telerik:RadComboBox ID="cbRTL" runat="server" DataSourceID="linqDS_RTL" DataTextField="RATE_TYPE_LIST_CD" DataValueField="RATE_TYPE_LIST_CD"  OnItemDataBound="cbRTL_ItemDataBound" OnSelectedIndexChanged="cbRTL_SelectedIndexChanged"
                Skin="Metro" SelectedValue='<%#Bind("RATE_TYPE_LIST_CODE")%>' DropDownWidth="520px" Width="100px" HighlightTemplatedItems="True"
                AutoPostBack="True" BorderStyle="Solid" BorderWidth="1px" BorderColor="Gray" Height="200px" AppendDataBoundItems="True">
                <HeaderTemplate>
                <table cellpadding="1" cellspacing="0" class="Main" width="485px">
                    <tr>
                    <td class="ComboHeader2" width="85px" style="text-align: left; visibility: visible;">Code</td>
                    <td class="ComboHeader2" width="350px" style="text-align: left; visibility: visible;">Description</td>
                    <td class="ComboHeader2" width="50px" style="text-align: left; visibility: visible;">Type</td>
                    </tr>
                </table>
                </HeaderTemplate>
                <ItemTemplate>
                <table cellpadding="1" cellspacing="0" class="Main" width="485px">
                    <tr>
                    <td width="85px" style="text-align: left; visibility: visible;">
                        <%#DataBinder.Eval(Container.DataItem, "RATE_TYPE_LIST_CD")%>
                    </td>
                    <td width="350px" style="text-align: left; visibility: visible;">
                        <%#DataBinder.Eval(Container.DataItem, "RATE_TYPE_LIST_DESC")%>
                    </td>
                    <td width="50px" style="text-align: left; visibility: visible;">
                        <%#DataBinder.Eval(Container.DataItem, "RATE_TYPE_LIST_TYPE")%>
                    </td>
                    </tr>
                </table>
                </ItemTemplate>
                <Items>
                <telerik:RadComboBoxItem ID="RadComboBoxItem2" runat="server" />
                </Items>
            </telerik:RadComboBox>
          </EditItemTemplate>
          <ItemTemplate>
              <asp:Label ID="lblRTL_Code" runat="server" Text='<%# Eval("RATE_TYPE_LIST_CODE")%>'></asp:Label>
          </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn HeaderText="List Description" UniqueName="RATE_TYPE_LIST_DESC">
            <EditItemTemplate>
            <telerik:RadTextBox ID="txtRTL_Desc" runat="server" Text='<%# Bind("RATE_TYPE_LIST_DESC")%>' Width="490px" MaxLength="150"></telerik:RadTextBox>
            </EditItemTemplate>
            <ItemTemplate>
              <asp:Label ID="lblRTL_Desc" runat="server" Text='<%# Eval("RATE_TYPE_LIST_DESC")%>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn HeaderText="Service Category" UniqueName="SCAT_CODE" HeaderStyle-Width="105px">
            <EditItemTemplate>   
            <telerik:RadComboBox ID="cbSCAT" runat="server" DataSourceID="linqDS_SCAT" DataTextField="SCAT_TYPE" DataValueField="SCAT_TYPE"
                Skin="Metro" SelectedValue='<%#Bind("SCAT_CODE")%>' DropDownWidth="520px" Width="100px" HighlightTemplatedItems="True"
                BorderStyle="Solid" BorderWidth="1px" BorderColor="Gray" Height="200px" AppendDataBoundItems="True" OnDataBound="cbSCAT_DataBound">
                <HeaderTemplate>
                <table cellpadding="1" cellspacing="0" class="Main" width="485px">
                    <tr>
                    <td class="ComboHeader2" width="85px" style="text-align: left; visibility: visible;">Code</td>
                    <td class="ComboHeader2" width="350px" style="text-align: left; visibility: visible;">Description</td>
                    </tr>
                </table>
                </HeaderTemplate>
                <ItemTemplate>
                <table cellpadding="1" cellspacing="0" class="Main" width="485px">
                    <tr>
                    <td width="85px" style="text-align: left; visibility: visible;">
                        <%# If(Container.DataItem IsNot Nothing, DataBinder.Eval(Container.DataItem, "SCAT_TYPE"), DataBinder.Eval(Container, "Value"))%>
                    </td>
                    <td width="350px" style="text-align: left; visibility: visible;">
                        <%# If(Container.DataItem IsNot Nothing, DataBinder.Eval(Container.DataItem, "SCAT_DESC"), DataBinder.Eval(Container, "Text"))%>
                    </td>
                    </tr>
                </table>
                </ItemTemplate>
            </telerik:RadComboBox>
          </EditItemTemplate>
          <ItemTemplate>
              <asp:Label ID="lblSCAT" runat="server" Text='<%# Eval("SCAT_CODE")%>'></asp:Label>
          </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn HeaderText="Jurisdiction" UniqueName="JURISDICTION" HeaderStyle-Width="105px">
            <EditItemTemplate>
            <telerik:RadComboBox ID="cbJuris" runat="server" Skin="Metro" SelectedValue='<%#Bind("JURISDICTION")%>' DropDownWidth="50px"
                Width="50px" HighlightTemplatedItems="True" BorderStyle="Solid" BorderWidth="1px" BorderColor="Gray">
                <Items>
                <telerik:RadComboBoxItem Value="" Text="" Selected="true" />
                <telerik:RadComboBoxItem Value="B" Text="B" />
                <telerik:RadComboBoxItem Value="L" Text="L" />
                <telerik:RadComboBoxItem Value="N" Text="N" />
                </Items>
            </telerik:RadComboBox>
            </EditItemTemplate>
            <ItemTemplate>
              <asp:Label ID="lblRTL_Juris" runat="server" Text='<%# Eval("JURISDICTION")%>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn HeaderText="List Type" UniqueName="RATE_TYPE_LIST_TYPE" HeaderStyle-Width="105px">
            <EditItemTemplate>
            <telerik:RadComboBox ID="cbRTL_Type" runat="server" Skin="Metro" SelectedValue='<%#Bind("RATE_TYPE_LIST_TYPE")%>' DropDownWidth="50px"
                Width="50px" HighlightTemplatedItems="True" BorderStyle="Solid" BorderWidth="1px" BorderColor="Gray">
                <Items>
                <telerik:RadComboBoxItem Value="" Text="" Selected="true" />
                <telerik:RadComboBoxItem Value="D" Text="D" />
                <telerik:RadComboBoxItem Value="N" Text="N" />
                <telerik:RadComboBoxItem Value="R" Text="R" />
                <telerik:RadComboBoxItem Value="S" Text="S" />
                <telerik:RadComboBoxItem Value="T" Text="T" />
                <telerik:RadComboBoxItem Value="X" Text="X" />
                </Items>
            </telerik:RadComboBox>
            </EditItemTemplate>
            <ItemTemplate>
              <asp:Label ID="lblRTL_Type" runat="server" Text='<%# Eval("RATE_TYPE_LIST_TYPE")%>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn Visible="False" EditFormHeaderTextFormat="">
            <EditItemTemplate>
              <asp:Label ID="lblErr" runat="server" Text= Font-Bold="True" ForeColor="Red"></asp:Label>
            </EditItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Delete this Association?" ConfirmTitle="Delete" Exportable="False" HeaderStyle-Width="30px" />
        </Columns>
        <AlternatingItemStyle BackColor="#FFCC66" />
        <HeaderStyle BackColor="#FFCC66" />
    </telerik:GridTableView>
    </DetailTables>
    <EditFormSettings PopUpSettings-Width="600px" PopUpSettings-Modal="True" InsertCaption="New Account" PopUpSettings-ShowCaptionInEditForm="False">
    <EditColumn ButtonType="ImageButton" />
    </EditFormSettings>
</MasterTableView>
<ClientSettings>
    <ClientEvents OnPopUpShowing="PopUpShowing2" />
</ClientSettings>
</telerik:RadGrid>

I add a extra row to cbSCAT using the following code:
Protected Sub cbSCAT_DataBound(sender As Object, e As EventArgs)
    Dim combo As RadComboBox = DirectCast(sender, RadComboBox)
    Dim item As RadComboBoxItem = New RadComboBoxItem("ALL", "XX")
    combo.Items.Insert(0, item)
    item.DataBind()
End Sub

It's adding to the Combobox ok except when I chose to edit a grid row with the "extra row", ie the "XX" row, the edit window doesn't even popup.  If I chose Add new record it shows up in the combobox ok like it should.  If I chose to edit a row with a value from the datasource the popup edit window comes up just fine.  

What am I missing?
Boyan Dimitrov
Telerik team
 answered on 20 Jun 2014
3 answers
223 views
Hello

I have a candlestick chart with daily data. When I use the mouse to zoom in, the chart expands showing HH:mm format in the x-axis. I need to restrict zoom-in to  the daily level, without showing hours/minutes, even if that means displaying only 1 bar on the chart. How do i implement such a restriction? Thanks.

JB
Danail Vasilev
Telerik team
 answered on 20 Jun 2014
4 answers
67 views
Dear Support Team

Hello To All

I how Question regarding special characters like ( Û ,  ê  ,...)   when the chart element contain these characters the chart show something like the attachment  1

i include two snapshot one with these characters (1.png)  and one without (2.png) , i can solve my problem by remove any characters like these before creating

chart (it will recrudesce speed and performance) also iam not happay with outputs , so anysugesstion...

 
Danail Vasilev
Telerik team
 answered on 20 Jun 2014
4 answers
214 views

Hi,
i want to apply client side filtering in rad grid . i am following the below link to achive it.

http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx

till now what i have done 
 i have written the java script  through webmethod iam calling the servr event

   var pageSize; var sortExpressions; var filterExpressions;var currentPageIndex;
            function RadGrid3_OnCommand(sender, args)
             {
              
                args.set_cancel(true);
               pageSize = sender.get_masterTableView().get_pageSize();

                sortExpressions = sender.get_masterTableView().get_sortExpressions();
                 filterExpressions = sender.get_masterTableView().get_filterExpressions();

                 currentPageIndex = sender.get_masterTableView().get_currentPageIndex();
                 if (args.get_commandName() === "Filter") {
                     currentPageIndex = 0;
                      var sortExpressionsAsSQL = sortExpressions.toString();
                  }

                  var tableView = $find("<%= RadGrid3.ClientID %>").get_masterTableView();
                  pageSize = tableView.get_pageSize();

                  sortExpressions = tableView.get_sortExpressions();
                  filterExpressions = tableView.get_filterExpressions();

                  currentPageIndex = tableView.get_currentPageIndex();
                  var startIndex = pageSize * currentPageIndex;
                  PageMethods.GetData(startIndex, pageSize, ahi_event, ahi_state, ahi_userid,filterExpressions.toList(), updateGrid);
}

my c# code is
  [WebMethod]
        public static List<sku_list> GetData(int startIndex, int pageSize, string ahi_event, string ahi_state, string ahi_userid, List<GridFilterExpression> filterExpressions)
        {
            List<sku_list> list = new List<sku_list>();
            StringBuilder sqlBuilder = new StringBuilder();
            sqlBuilder.AppendLine("DECLARE @startRow int     ");
            sqlBuilder.AppendLine("SET ROWCOUNT @maximumRows");

            sqlBuilder.AppendLine("WITH OrderedEmployees As");
            sqlBuilder.AppendLine("(");
        
            string sortExpressions = "";
            
           
            //List<DbParameter> parameters = new List<DbParameter>();
            var conString = System.Configuration.ConfigurationManager.ConnectionStrings["Amscan-ProdConnectionString"];

            // string commandString = "SELECT * FROM Artwork_sku where ahi_event_name='" + startIndex + "' and state='" + maximumRows + "'";
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Amscan-ProdConnectionString"].ConnectionString))
            {
                SqlCommand command = new SqlCommand("SP_AHI_SKULIST", connection);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add("@USERID", SqlDbType.VarChar).Value = ahi_userid;
                command.Parameters.Add("@EVENAME", SqlDbType.VarChar).Value = ahi_event;
                command.Parameters.Add("@STATE", SqlDbType.VarChar).Value = ahi_state;
             
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                try
                {
                    while (reader.Read())
                    {
                        sku_list newObject = new sku_list();
                
                            newObject.userid = reader[0].ToString();
                            newObject.Item = reader[1].ToString();
                            Topvalue = newObject.Item;
                            newObject.event_name = reader[2].ToString();
                            newObject.Description = reader[3].ToString();
                            newObject.Is_New = reader[4].ToString();
                            newObject.State = reader[5].ToString();
                   
                        list.Add(newObject);
                    }
                    int counter = 0;
                    List<DbParameter> parameters = new List<DbParameter>();
                   
                    if (filterExpressions.Count > 0)
                        sqlBuilder.Append(" WHERE ");
                    foreach (GridFilterExpression expression in filterExpressions)
                    {
                        counter++;
                        Pair parameter = BuildParameter(expression);
                        parameters.Add((DbParameter)parameter.Second);

                        sqlBuilder.AppendFormat((string)parameter.First);
                        if (counter < filterExpressions.Count)
                        {
                            sqlBuilder.AppendFormat(" And ");
                        }
                    }
                    parameters.ForEach(

                   delegate(DbParameter parameter)
                   {
                       if (parameter != null)
                           command.Parameters.Add(parameter);
                   }
               );
                }
                finally
                {
                    reader.Close();
                }
            }
            return list;
        }

the method for filttering  in c#

 #region filter
        private static Pair BuildParameter(GridFilterExpression expression)
        {
            string fieldName = expression.FieldName.Trim().Split(' ')[0];
            GridKnownFunction filterFunction =
                (GridKnownFunction)Enum.Parse(typeof(GridKnownFunction), expression.FilterFunction);

            SqlParameter sqlParameter = null;

            string filterExpression = string.Empty;
            switch (filterFunction)
            {
                case GridKnownFunction.NoFilter:
                    filterExpression = "1 = 1";
                    break;
                case GridKnownFunction.Contains:
                    filterExpression = string.Format("[{0}] LIKE @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         string.Format("%{0}%", Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName))));
                    break;
                case GridKnownFunction.DoesNotContain:
                    filterExpression = string.Format("[{0}] NOT LIKE @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         string.Format("%{0}%", Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName))));
                    break;
                case GridKnownFunction.StartsWith:
                    filterExpression = string.Format("[{0}] LIKE @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         string.Format("{0}%", Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName))));
                    break;
                case GridKnownFunction.EndsWith:
                    filterExpression = string.Format("[{0}] LIKE @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         string.Format("%{0}", Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName))));
                    break;
                case GridKnownFunction.EqualTo:
                    filterExpression = string.Format("[{0}] = @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.NotEqualTo:
                    filterExpression = string.Format("[{0}] <> @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.GreaterThan:
                    filterExpression = string.Format("[{0}] > @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                        Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.LessThan:
                    filterExpression = string.Format("[{0}] < @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.GreaterThanOrEqualTo:
                    filterExpression = string.Format("[{0}] >= @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                        Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.LessThanOrEqualTo:
                    filterExpression = string.Format("[{0}] <= @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.Between:
                    filterExpression = string.Format(" ([{0}] >= @{0}) AND ([{0}] <= @{0})", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                        Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.NotBetween:
                    filterExpression = string.Format(" ([{0}] < @{0}) OR ([{0}] > @{0})", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                        Convert.ChangeType(expression.FieldValue, Type.GetType(expression.DataTypeName)));
                    break;
                case GridKnownFunction.IsEmpty:
                    filterExpression = string.Format(" [{0}] = @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         string.Empty);
                    break;
                case GridKnownFunction.NotIsEmpty:
                    filterExpression = string.Format(" [{0}] <> @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                          string.Empty);
                    break;
                case GridKnownFunction.IsNull:
                    filterExpression = string.Format(" [{0}] = @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         DBNull.Value);
                    break;
                case GridKnownFunction.NotIsNull:
                    filterExpression = string.Format(" [{0}] <> @{0}", fieldName);
                    sqlParameter =
                        new SqlParameter(string.Format("@{0}", fieldName),
                                         DBNull.Value);
                    break;
            }

            return new Pair(filterExpression,
                            sqlParameter);
        }
        #endregion


now i dont know what to do to make filter working , the example link which i am following is doing lot of thing i am using a view in my sql command so iam confused also .

if any simple client side filtering example is there then plz let me know

Daniel
Telerik team
 answered on 20 Jun 2014
3 answers
235 views
I'm able to create a menu that stretches 100% width, but the RadMenuItems are left aligned.  I want the buttons to be center aligned (already figured out how to center align the text).

  <telerik:RadMenu ID="RadMenu1" runat="server" ResolvedRenderMode="Classic" 
        EnableEmbeddedSkins="False" Skin="Green" width="100%" >
      <Items>
          <telerik:RadMenuItem runat="server" Text="Home">
          </telerik:RadMenuItem>
          <telerik:RadMenuItem runat="server" Text="Button1">
          </telerik:RadMenuItem>
          <telerik:RadMenuItem runat="server" Text="Button2">
          </telerik:RadMenuItem>
          <telerik:RadMenuItem runat="server" Text="Button3">
              <Items>
                  <telerik:RadMenuItem runat="server" Text="Profile">
                  </telerik:RadMenuItem>
                  <telerik:RadMenuItem runat="server" Text="Password">
                  </telerik:RadMenuItem>
              </Items>
          </telerik:RadMenuItem>
          <telerik:RadMenuItem runat="server" Text="Logout">
          </telerik:RadMenuItem>
      </Items>
</telerik:RadMenu>

Thanks!




Shinu
Top achievements
Rank 2
 answered on 20 Jun 2014
3 answers
281 views
I am using RadEditor on a aspx page. All it's dialogs (hyperlink manager, image manager etc.,) were working fine. Now I have introduced Routing to my application, and all dialogs have stopped working. I thought that, this is because of Telerik DialogHandlers. So I have stopped routing for below page types. 

        routes.Add(New Route("{resource}.aspx/{*pathInfo}", New StopRoutingHandler()))
        routes.Add(New Route("{resource}.ajascx/{*pathInfo}", New StopRoutingHandler()))
        routes.Add(New Route("{resource}.axd/{*pathInfo}", New StopRoutingHandler()))

Since Telerik is using DialogHandler.aspx as Dialog handler, I was hoping this will resolve my issue. But it didnot.

Please help me on this


Web.config entries

<httpHandlers>
           <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
           <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
           <add path="Telerik.Web.UI.DialogHandler.aspx" type="CustomHandler.SessionStateDialogHandler, App_Code" verb="*" validate="false"/>
           <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
</httpHandlers>

<handlers>
          <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*"                            preCondition="integratedMode,runtimeVersionv2.0"/>
          <add name="Telerik_Web_UI_DialogHandler_aspx_*" path="Telerik.Web.UI.DialogHandler.aspx" type="CustomHandler.SessionStateDialogHandler,                                    App_Code" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
          <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler"                      verb="*" preCondition="integratedMode,runtimeVersionv2.0"/>
         <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*"                                                      preCondition="integratedMode,runtimeVersionv2.0"/>
</handlers>








Ianko
Telerik team
 answered on 20 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?