Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
214 views
How can I deselect rows selected in a RadGrid (ID's are being stored in a session variable) on click of a Clear/Reset button?
Princy
Top achievements
Rank 2
 answered on 18 Sep 2013
1 answer
82 views
I have the following code for a radgrid. When i click on Add a little form comes up and when i fill it out and click insert, i am trying to loop through the form values but i don't know what exactly i should loop or how. Because its not really a form collection. Any help is very much appreciated.


protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["GridData"] == null)
            {
                DataTable table = GetTable();
                Session.Add("GridData", table);
            }
            DefineGridStructure();
        }
     
     
        private void DefineGridStructure()
        {
            RadGrid grid = new RadGrid();
            grid.ID = "RadGrid1";
            grid.NeedDataSource += new GridNeedDataSourceEventHandler(grid_NeedDataSource);
            grid.AutoGenerateEditColumn = true;
            grid.AutoGenerateDeleteColumn = true;
            grid.AllowAutomaticInserts = true;
            grid.Width = Unit.Percentage(100);
            grid.PageSize = 15;
            grid.AllowPaging = true;
            grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
            grid.AutoGenerateColumns = false;
            grid.MasterTableView.Width = Unit.Percentage(100);
            grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom;
            grid.AllowAutomaticDeletes = true;
            grid.AllowAutomaticUpdates = true;
            grid.InsertCommand +=grid_InsertCommand;
            grid.MasterTableView.DataKeyNames = new string[] { "RowNumber" };
            GridBoundColumn boundColumn = new GridBoundColumn();
            boundColumn.DataField = "RowNumber";
            boundColumn.HeaderText = "RowNumber";
            boundColumn.ReadOnly = true;
            grid.MasterTableView.Columns.Add(boundColumn);
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "Size";
            boundColumn.HeaderText = "Size";
            grid.MasterTableView.Columns.Add(boundColumn);
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "Description";
            boundColumn.HeaderText = "Description";
            grid.MasterTableView.Columns.Add(boundColumn);
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "Quantity";
            boundColumn.HeaderText = "Quantity";
            grid.MasterTableView.Columns.Add(boundColumn);
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "Duration";
            boundColumn.HeaderText = "Duration";
            grid.MasterTableView.Columns.Add(boundColumn);
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "DurationType";
            boundColumn.HeaderText = "DurationType";
            grid.MasterTableView.Columns.Add(boundColumn);
            boundColumn = new GridBoundColumn();
            boundColumn.DataField = "Amount";
            boundColumn.HeaderText = "Amount";
            grid.MasterTableView.Columns.Add(boundColumn);
            PlaceHolder1.Controls.Add(grid);
        }
     
        private void grid_InsertCommand(object sender, GridCommandEventArgs e)
        {
            // Looking to loop through the form so i can insert the values into the datatable
        }
     
         
     
     
     
        void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            DataTable current = (DataTable)Session["GridData"];
            RadGrid grid = (RadGrid)sender;
            grid.DataSource = current;
     
        }
     
     
     
        static DataTable GetTable()
        {
            //
            // Here we create a DataTable with a few columns.
            //
            // Create Datatable to store all colums
            DataTable dt = new DataTable();
            DataRow dr = null;
            dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));
            dt.Columns.Add(new DataColumn("Size", typeof(string)));
            dt.Columns.Add(new DataColumn("Description", typeof(string)));
            dt.Columns.Add(new DataColumn("Quantity", typeof(string)));
            dt.Columns.Add(new DataColumn("Unit", typeof(string)));
            dt.Columns.Add(new DataColumn("Duration", typeof(string)));
            dt.Columns.Add(new DataColumn("DurationType", typeof(string)));
            dt.Columns.Add(new DataColumn("Amount", typeof(string)));
            dr = dt.NewRow();
            dr["RowNumber"] = 1;
            dr["Size"] = string.Empty;
            dr["Description"] = string.Empty;
            dr["Quantity"] = string.Empty;
            dr["Unit"] = string.Empty;
            dr["Duration"] = string.Empty;
            dr["DurationType"] = string.Empty;
            dr["Amount"] = string.Empty;
            dt.Rows.Add(dr);
            return dt;
        }
Princy
Top achievements
Rank 2
 answered on 18 Sep 2013
3 answers
300 views
I wonder is it possible to create an image rotator for 4-6 images with the quick link buttons to each image similar to http://nivo.dev7studios.com/?

Btw, what control did you use on http://www.telerik.com/ ?
Elvin
Top achievements
Rank 1
 answered on 18 Sep 2013
1 answer
87 views
Dear Supporting Team,

Warm Greetings!!!

I am NAGARAJAN. I have 4 years experience in dot net technology. 

Currently I am using Telerik radgrid (Run-time Version v2.0.50727) (Version 2010.3.1215.35) in my entire project. I am using the radgrid control in asp.net popup window. This page contains around 20 text box and all are mandatory field. I am using required field validator for each controls. There is no issue when I save the page without receive any required field error.

Suppose If I receive any required field issue, the pop up radgrid lost its style. 

Also, Herewith I have attached the screen shorts for your reference.

Kindly let me know the reason for this issue ASAP.

Thank you.



 

Konstantin Dikov
Telerik team
 answered on 17 Sep 2013
1 answer
215 views
Hi,

I have a very simple dynamically-created filter.  The expression value is always empty for a standard DropDownList expression, but works fine with the TextBox; I'm sure it's my own ignorance but I can't find syntax to get the input value and/or set the expression value, which is apparently done in the OnExpressionEvaluated event.  The textbox works without any intervention.

I'm new to Telerik so apologies if there is some blatant issue with the code.  There is a comment where I believe I'm going wrong.

Thanks,
JD

public class filterSimpleCtrl : WebControl
    {
        private RadFilter _rf = new RadFilter();
        private Label _label = new Label();
        private RadScriptManager sm = new RadScriptManager();
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Page.Form.Controls.Add(sm);
 
            this._label.ID = "_label";
 
            this._rf.ID = "_rf";
            this._rf.FilterContainerID = "RadGrid1";
            this._rf.ExpressionPreviewPosition = RadFilterExpressionPreviewPosition.Bottom;
            this._rf.ApplyExpressions += _rf_ApplyExpressions;
            this._rf.ExpressionItemCreated += _rf_ExpressionItemCreated;
 
            RadFilterTextFieldEditor rfe2 = new RadFilterTextFieldEditor();
            rfe2.FieldName = "City";
            rfe2.DisplayName = "City";
            rfe2.DefaultFilterFunction = RadFilterFunction.Contains;
            _rf.FieldEditors.Add(rfe2);
             
            RadFilterDropDownEditor rfe = new RadFilterDropDownEditor();
            rfe.FieldName = "CountryCode";
            rfe.DisplayName = "Country Code";
            rfe.DataTextField = "CountryCode";
            rfe.DefaultFilterFunction = RadFilterFunction.EqualTo;
            _rf.FieldEditors.Add(rfe);
 
 
            this.Page.Form.Controls.Add(_rf);
            this.Page.Form.Controls.Add(new LiteralControl("<br />"));
            this.Page.Form.Controls.Add(_label);
        }
 
        protected void _rf_ExpressionItemCreated(object sender, RadFilterExpressionItemCreatedEventArgs e)
        {
 
            // Populate the RadDropDownList control for every ShipCountry field editor
            RadFilterSingleExpressionItem singleItem = e.Item as RadFilterSingleExpressionItem;
            if (singleItem != null && singleItem.FieldName == "CountryCode" && singleItem.IsSingleValue)
            {
                RadDropDownList dropDownList = singleItem.InputControl as RadDropDownList;
                dropDownList.DataSource = GetListData("country");
                dropDownList.DataBind();
            }
 
            // Removes the AddGroupExpressionButton for group expression other than the root group
            RadFilterGroupExpressionItem groupItem = e.Item as RadFilterGroupExpressionItem;
            if (groupItem != null)
            {
                if (groupItem.IsRootGroup) groupItem.RemoveButton.Visible = false;
                else groupItem.AddGroupExpressionButton.Visible = false;
            }
        }
 
        void _rf_ApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e)
        {
            RadFilterSqlQueryProvider queryProvider = new RadFilterSqlQueryProvider();
            queryProvider.OnExpressionEvaluated = this.ExpressionEvaluated;
            queryProvider.ProcessGroup(e.ExpressionRoot);
            this._label.Text = queryProvider.Result;
        }
 
        private void ExpressionEvaluated(RadFilterEvaluationData evaluationData)
        {
            RadFilterFunction filterFunction = evaluationData.Expression.FilterFunction;
            if (evaluationData.Expression.FieldName == "CountryCode" &&
                filterFunction == RadFilterFunction.EqualTo ||
                filterFunction == RadFilterFunction.NotEqualTo)
            {
                //NONE OF THESE WORK
                //string value = (evaluationData.Expression as RadFilterContainsFilterExpression).Value;
                //string value = (((IRadFilterValueExpression)evaluationData.Expression).Values[0] as RadFilterDropDownEditor).ExtractValues()[0].ToString();
                //string value = (((IRadFilterValueExpression)evaluationData.Expression).Values[0] as RadDropDownList).SelectedValue;
 
                RadFilterNonGroupExpression expression = null;
                RadFilterSqlExpressionEvaluator evaluator = RadFilterSqlExpressionEvaluator.GetEvaluator(evaluationData.Expression.FilterFunction);
                expression = new RadFilterEqualToFilterExpression<string>("CountryCode") { Value = value };
                evaluator.GetEvaluationData(expression).CopyTo(evaluationData);
            }
        }
 
        private DataTable GetListData(string list)
        {
            string query = "";
            switch (list)
            {
                case "country":
                    query = "SELECT CountryCode FROM Country";
                    break;
                default:
                    break;
            }
            string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
            SqlCommand cmd = new SqlCommand(query);
            using (SqlConnection con = new SqlConnection(conString))
            {
                using (SqlDataAdapter sda = new SqlDataAdapter())
                {
                    cmd.Connection = con;
 
                    sda.SelectCommand = cmd;
                    using (DataTable dt = new DataTable())
                    {
                        sda.Fill(dt);
                        return dt;
                    }
                }
            }
        }
    }
JD
Top achievements
Rank 1
 answered on 17 Sep 2013
1 answer
95 views
I am developing a parent and sub reports. The parent report uses RadGrid to display the results. What I need is when items are selected from the the Parent Grid, I want to display all the selected items in the Child (Sub) Report  which uses Telerik Reports The 
Ebenezer
Top achievements
Rank 1
 answered on 17 Sep 2013
1 answer
212 views
Hello,

I have a radgrid with batch edit mode, that has AllowFilteringByColumn enabled. One of the grid column's is populated from a RadDropdownlist using a lookup table (via a foreign key). The filter in this case, only works on the foreign key value.

I am loading Dropdownlist in "PreRender". How can i configure filter for RadDropdownlist ?

ASPX Code:
<%--Product Names--%>
                <telerik:GridTemplateColumn DataField="Product_Names" GroupByExpression="Product_Names Group by Product_Names"
                    UniqueName="Product_Names" InitializeTemplatesFirst="false" HeaderStyle-Width="10%"
                    HeaderText="Product Names" HeaderStyle-Font-Size="12px">
                    <HeaderTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:LinkButton ID="lnkSortProduct_Names" runat="server" CommandArgument="Product_Names" CommandName="Sort"
                                        Text="Product Names"></asp:LinkButton>
                                </td>
                                <td>
                                    <img src="Images/Context_new_menu.jpg" style="margin-top: 5px; margin-left: 5px;
                                        cursor: pointer" onclick='ShowColumnHeaderMenu(event,"Product_Names")' alt="Show context menu" />
                                </td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                    
                    <ItemTemplate>
                        <asp:Label ID="lblProduct_Names" runat="server" Text='<%#Eval("Product_Names")%>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                    
                    <EditItemTemplate>
                        <telerik:RadDropDownList ID="ddlProductNames" runat="server" Width="65px" ToolTip="Choose Product Name" DropDownHeight="150px" DropDownWidth="100px">
                        </telerik:RadDropDownList>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

C# Code:

protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();
        try
        {
            // Filling Product Names data in Dropdowns
            RadDropDownList ddlProductNames = RadGrid1.FindControl(RadGrid1.MasterTableView.ClientID + "_Product_Names").FindControl("ddlProductNames") as RadDropDownList;

            ds = objFilingAssignments.GetAllddlProductNames();
            if (ds.Tables[0].Rows.Count > 0)
            {
                ddlPreparer.Items.Clear();
                ddlPreparer.DataSource = ds;
                ddlPreparer.DataValueField = "User_Initials";
                ddlPreparer.DataTextField = "User_Initials";
                ddlPreparer.DataBind();
                
            }
            ddlProductNames.DataSource = null;
            ddlProductNames.Dispose();

            
        }
        catch (SqlException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
How can i configure filter for RadDropdownlist ?

Thanks,
Sanath Rohilla.
Konstantin Dikov
Telerik team
 answered on 17 Sep 2013
20 answers
892 views
Hi,
I have a page where i want to set the Radpageview height to grow automatically depending on the page i'm loading.I have tried setting the height to 100% but that did not work.I dont want to set the height to pixel cause there are items inside the page which makes the page height grows.Is there a way to set this up dynamically.I have attached the code.If you check the page i have currently set the height as 600px but i dont want to do that.Instead the Radpageview height will automatically grow depending on the page i'm loading.Please have a look.Thanks.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InstrumentSetupContainer.aspx.cs" Inherits="BusinessSettingsSetup_InstrumentSetupContainer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../Styles/Form.css" rel="stylesheet" type="text/css" />
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" ></asp:ScriptManager>
         <asp:UpdatePanel ID="UpdatePanel2" runat="server" >
            <ContentTemplate>
                <fieldset>
                    <asp:UpdateProgress ID="progress1" runat="server">
                        <ProgressTemplate>        
                            <img alt="" src="../Images/loader.gif" />
                            Please Wait...        
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                    <div>
                        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Black"
                            MultiPageID="RadMultiPage1" SelectedIndex="0" >
                            <Tabs>
                                <telerik:RadTab Text="Instrument"></telerik:RadTab>
                                <telerik:RadTab Text="Instrument Catagories"></telerik:RadTab>
                                <telerik:RadTab Text="Instrument Exchange Listing"></telerik:RadTab>
                                <telerik:RadTab Text="Instrument Margin"></telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
                            <telerik:RadPageView ID="RadPageView1" runat="server" Height="600px"  ContentUrl="InstrumentSetup.aspx">
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView2" runat="server" Height="600px" ContentUrl="InstrumentCategoryDatewiseSetup.aspx">
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView3" runat="server" Height="600px" ContentUrl="InstrumentExchangeListingSetup.aspx">
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView4" runat="server" Height="600px" ContentUrl="InstrumentMarginDatewiseSetup.aspx">
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>                       
                    </div>
                                       
                </fieldset>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

John
Top achievements
Rank 1
 answered on 17 Sep 2013
1 answer
72 views
Hi everyone,

I've tried differents possible solutions for this error but i couldn't resolving it.

The problem is that the last RadTab of the RadTabStrip appears in a second line when it should be in the same line of the of the others RadTab. I've tried to change the width the all RadTabs, but it didn't works.

In Firefox and Chrome  everything appears fine.

I'm using the version 2013.1.319.35 of the Telerik.Web.UI.Skins.dll, Telerik.Web.UI and Telerik.Web.Design.

The CSS :

.pestanapanel.RadTabStrip .pestanapaneltexto span.rtsOut span.rtsIn span.rtsTxt:hover
{
    color:#008AC8;
    text-decoration:underline;
}
.pestanapanel.RadTabStrip .rtsLink
{
    padding-left:0px;
}
.pestanapanel.RadTabStrip li.rtsLI
{
    background-color: #d5d5d5;
    text-align:center;
    vertical-align: middle;
    padding-top:0px;
    padding-bottom:0px;
    padding-left:0px;
    padding-right:0px;
    width:175px;
    float:left;
    height:60px; /*33px;*/
    border-right: #999 1px solid;
    -webkit-border-radius:4px 4px 0px 0px;
    -moz-border-radius: 4px 4px 0px 0px;
    border-radius: 4px 4px 0px 0px;
    white-space:normal;
}

The control :

                <telerik:RadTabStrip ID="RadTabCarteras" runat="server" MultiPageID="RadMultiPageCarteras"
                    OnTabClick="RadTabStrip1_TabClick" SelectedIndex="0" Width="943px" Skin="Vista"
                    ScrollChildren="true" ScrollButtonsPosition="Middle" PerTabScrolling="true" 
                    CssClass="pestanapanel">
                    <Tabs>
                        <telerik:RadTab TabIndex="0" Text="<%$ Resources:Common, k000610 %>" CssClass="pestanapaneltexto">
                        </telerik:RadTab>
                        <telerik:RadTab TabIndex="1" Text="<%$ Resources:Common, k002037 %>" CssClass="pestanapaneltexto">
                        </telerik:RadTab>
                        <telerik:RadTab TabIndex="2" Text="<%$ Resources:Common, k002082 %>" CssClass="pestanapaneltexto">
                        </telerik:RadTab>
                        <telerik:RadTab TabIndex="3" Text="<%$ Resources:Common, k002061 %>" CssClass="pestanapaneltexto">
                        </telerik:RadTab>
                        <telerik:RadTab TabIndex="4" Text="<%$ Resources:Common, k001293 %>" CssClass="pestanapaneltexto">
                        </telerik:RadTab>
                        <telerik:RadTab TabIndex="5" Text="<%$ Resources:Common, k000667 %>" CssClass="pestanapaneltexto">
                        </telerik:RadTab>
                        <telerik:RadTab TabIndex="6" Text="<%$ Resources:Common, k001748 %>" CssClass="pestanapaneltexto">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>


Thanks for your time and for your help.





Nencho
Telerik team
 answered on 17 Sep 2013
3 answers
210 views

Hi Team,

       
              As i have updated Telerik dll's but after updating i am getting below Errors and i am not using any types of triggers and asp update panels so please tell me asap and i am also attaching screen shot of below error(image_xi) and Telerik Ajax settings screen shot.

Could not find an event named 'OnSelectedIndexChanged' on associated control 'ctl00$ContentPlaceHolder1$RadComboBox_Materialreceived' for the trigger in UpdatePanel 'ctl00$ContentPlaceHolder1$material_gridPanel'.



Thanks & Regards
Malkiat Singh
Hristo Valyavicharski
Telerik team
 answered on 17 Sep 2013
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
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
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?