Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
337 views
Hi,
My requirement is Bind the grid dynamic , and add the controls like Text Box And rad Como box at run time by Item value.
so far have done the control adding and now my grid is ready to take values from user , 
but when user selected value from rad combo box (dynamic added control in grid), and click the save button i cannot find the Rad Combo box 
pls suggest me the way how to get the values for dynamically added controls in Rad-grid on button click.
below are the steps i followed
1. Added Grid in Aspx. with Autogenerated Column = true
2. On Item created event added dynamic controls in Grid. 
3. bind the data to ad combo box (dynamic added control in grid) 
4. on save Button i have to save the selected values from rad combo box (dynamic added control in grid), to data base
in above step 1 to 3 are done , but step 4 making me trouble .

below is code for button click.
protected void btnSaveAll_Click(object sender, EventArgs e)
{
    Questionnaire MyQue = Questionnaire.getQuestionnaire(mQuestionnaireid); 
    ArrayList ColumnLst = GetColumnList();
                Dictionary<string,string> RowSplitValue = new Dictionary<string,string>();
                foreach (GridEditableItem Item in rgPivotQuestionnaireResult.MasterTableView.Items)
                {
                    foreach (GridColumn Column in rgPivotQuestionnaireResult.MasterTableView.RenderColumns)
                    {
                        if (ColumnLst.Contains(Column.UniqueName))
                        {
                            //RowSplitValue = new Dictionary<string, string>(Item.SavedOldValues[Column.UniqueName]);
                            if (Item[Column].Controls.Count > 0)
                            {
                                Control ItemControle= new Control();
                                ItemControle = Item[Column].Controls[0];
                                if (ItemControle is TextBox)
                                {
                                    TextBox TxtBx = (TextBox)Item[Column].Controls[0];
                                }
                                if (Item[Column].Controls.Count > 1)
                                {
                                    ItemControle = Item[Column].Controls[1];
                                    if (ItemControle is RadComboBox)
                                    {
                                        RadComboBox RCB = (RadComboBox)Item[Column].Controls[1];
                                          MyQue .Answervalue = RCB.SelectedValue;
                                    }
                                }
                            }
                        }
                    }
                }
   MyQue .Save();
}
Viktor Tachev
Telerik team
 answered on 24 Aug 2015
3 answers
156 views

How can I do this programatically?

 

http://docs.telerik.com/devtools/wpf/controls/radmenu/features/checkable-items​

Aneliya Petkova
Telerik team
 answered on 24 Aug 2015
4 answers
248 views

Hi

I have used DatePicker with bootstrap theme  for UI for ASP.NET AJAX Q1 2015.
But when I am opening month pop up the in place of OK and Cancal button true and false text is coming.
And in place of today's date blank text is coming.
I am using I.E to test it.
can you please help me with this issue.

Thanks and Regards,

Ritesh

Maria Ilieva
Telerik team
 answered on 24 Aug 2015
1 answer
139 views

I created a new skin based off the default skin, changing just the font.  Some images are not loaded when the new skin is loaded.  An example is in the screenshot.  I had to load up a grid with the Default skin, download the images, and place them in the folder containing the page. Surely there's a better way as this means I will have to have copies of these image files in every folder containing pages where a grid is used.

 

Maria Ilieva
Telerik team
 answered on 24 Aug 2015
1 answer
239 views

I am using a RadTreeList with an UpdateCommand, which updates one BIT field on SQL Server via a stored procedure. After the update, I force the RadTreeList to rebind its data source, but ​it OCCASIONALLY will not reflect the updated data (which I know for certain is getting set on SQL Server). Sometimes it shows the new value, sometimes not.

 What I have tried in the UpdateCommand:

protected void rtlRoster_UpdateCommand(object sender, TreeListCommandEventArgs e)
{

     //some code eliminated for brevity

     //Perform the update via SQL stored procedure
     SQL.Update​StoredProc(params...);

     //I have tried sleeping before reloading the data source, which is not preferred
     Thread.Sleep(1500);

     //I have tried forcing the data source to clear out explicitly and then resetting it to the proper data source afterwards
     rtlRoster.DataSource = new ArrayList();
     rtlRoster.DataBind();

     //I have tried ​forcing it to reload the data source explicitly
     rtlRoster_NeedDataSource(sender, new TreeListNeedDataSourceEventArgs(TreeListRebindReason.ExplicitRebind));

 

    //I have tried using this code from an online Telerik example (http://docs.telerik.com/devtools/aspnet-ajax/controls/treelist/data-editing/updating-records/using-inplace-and-editforms-modes)
     rtlRoster.EditIndexes.Clear();
     rtlRoster.Rebind();

 

    //And I have tried the brute force way of reloading the page           

    Response.Redirect(Request.RawUrl);

 }

 

I was hoping there would be some obvious setting that I could control, such as RadGrid's <ClientSettings>​<DataBinding EnableCache="false">, but I see no such property on the RadTreeList.

 

Any ideas why this would be happening intermittently and how to fix it?

 

ASP.NET version: 4.0.30319.34209 (though the .NET Framework is 4.5) 
OS: Windows 8.1 Pro 
exact browser version: IE11, Chrome 44.0.2403.155 m, and FF 39.0 
exact version of the Telerik product:  Telerik.Web.UI.dll 2013.2.717.45
preferred programming language (VB.NET or C#): C#

 

Thanks,

Brent Wood

Angel Petrov
Telerik team
 answered on 24 Aug 2015
1 answer
220 views

Here I have very nasty scenario. I have a grid that populate by using dynamic table.

In that grid i added the edit and delete functionality.

I also have validation requirement for all the columns in the grid.

here is a example...
Think the table have 2 columns(next time it can be 3 columns).

This table's data shows in grid. "ColumnA" (String) and "ColumnB" (float).

In a another table have validation rules for ColumnA and ColumnB.

ColumnA is a email and ColumnB have min and max values.

What I want is, make a custom dynamic popup for update data and bind these attributes to the html tags according to there validations.

How I achieve this ?? Thanks in advance.

Alexander Popov
Telerik team
 answered on 24 Aug 2015
1 answer
183 views
I have a 2-level hierarchical grid. MasterTableView doesnt have paging.  The detail grids do.  If I change page size in one detail grid, I want that new page size to be applied to the rest of the detail grids.  HierarchyLoadMode is "ServerBind" with DetailTableDataBind method.  I tried to call MyGrid.Rebind() in PageSizeChanged event but DetailTableDataBind is only fired once for the grid that I switch the page size manually.  How do I apply the new page size to all detail grids?
Konstantin Dikov
Telerik team
 answered on 24 Aug 2015
1 answer
296 views

Hi there,

The OnItemCommand, OnSortCommand got triggered unexpectly when pressing enter key in a textbox. Here is my scenario:

1 Click in ​a textbox below a RadGrid.

2 Press Enter key, OnItemCommand, OnSortCommand wil be triggered.

However,  as soon as I remove the HeaderImageUrl property in telerik:GridTemplateColumn, everything works perfectly.

Please see the demo code below:

TestEnterKey.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestEnterKey.aspx.cs" Inherits="TestEnterKey" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div style="margin-bottom:20px;">
            <asp:scriptmanager id="ScriptManager1" runat="server">
            </asp:scriptmanager>
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0" AllowSorting="True" OnItemCommand="grid_RowCommand"  OnSortCommand="grid_SortCommand"
                GridLines="None" Width="800px" AllowFilteringByColumn="true" EnableLinqExpressions="false" AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource" ShowFooter="True">
                <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="true"
                ShowFooter="True" TableLayout="Auto">
                    <Columns>
                        <telerik:GridTemplateColumn DataField="Freight"  HeaderText="Freight" SortExpression="Freight" HeaderImageUrl="~/images/datePickerPopup.png" AutoPostBackOnFilter="true" CurrentFilterFunction="GreaterThanOrEqualTo"
                            ShowFilterIcon="false">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbl_freight" runat="server" Text='<%#Eval("Freight")%>' Visible="true"/>
                                </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="ShipName" HeaderText="Ship Name" SortExpression="ShipName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                        ShowFilterIcon="false">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbl_name" runat="server" Text='<%#Eval("ShipName")%>' Visible="true"/>
                            </ItemTemplate>
                       </telerik:GridTemplateColumn>
                 </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
        <asp:TextBox ID="tb_componentname" TextMode="SingleLine" MaxLength="250" runat="server" CssClass="STD"></asp:TextBox>
    </form>
</body>
</html>

 

TestEnterKey.aspx.cs:

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using System.Configuration;
using System.Collections.Generic;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Telerik.Web.UI;
 
 
public partial class TestEnterKey : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    public class MyOrder
    {
        public int OrderID { get; set; }
        public DateTime OrderDate { get; set; }
        public double Freight { get; set; }
        public string ShipName { get; set; }
        public string ShipCountry { get; set; }
    }
 
    protected void grid_RowCommand(object sender, GridCommandEventArgs e) 
    {
    }
 
    protected void grid_SortCommand(object source, GridSortCommandEventArgs e)
    {
    }
 
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        LoadData();
    }
 
    private void LoadData()
    {
        MyOrder _order1 = new MyOrder();
        _order1.OrderID = 1;
        _order1.OrderDate = new DateTime(2014, 1, 18);
        _order1.Freight = 15.61;
        _order1.ShipCountry = "Canada";
        _order1.ShipName = "David";
 
        MyOrder _order2 = new MyOrder();
        _order2.OrderID = 2;
        _order2.OrderDate = new DateTime(2015, 9, 12);
        _order2.Freight = 12.39;
        _order2.ShipCountry = "US";
        _order2.ShipName = "Jack";
 
        MyOrder _order3 = new MyOrder();
        _order3.OrderID = 3;
        _order3.OrderDate = new DateTime(2015, 6, 2);
        _order3.Freight = 6.81;
        _order3.ShipCountry = "Mexico";
        _order3.ShipName = "Howard";
 
        MyOrder _order4 = new MyOrder();
        _order4.OrderID = 4;
        _order4.OrderDate = new DateTime(2014, 3, 26);
        _order4.Freight = 19.92;
        _order4.ShipCountry = "Canada";
        _order4.ShipName = "William";
 
        MyOrder _order5 = new MyOrder();
        _order5.OrderID = 5;
        _order5.OrderDate = new DateTime(2015, 5, 15);
        _order5.Freight = 9.96;
        _order5.ShipCountry = "US";
        _order5.ShipName = "Don";
 
        List<MyOrder> _myList = new List<MyOrder>();
        _myList.Add(_order1);
        _myList.Add(_order2);
        _myList.Add(_order3);
        _myList.Add(_order4);
        _myList.Add(_order5);
 
        RadGrid1.DataSource = _myList;
    }
}

Any help is much appreciated!

Eyup
Telerik team
 answered on 24 Aug 2015
1 answer
101 views

When I try to set a default filter on combobox filter the grid filters correctly but checkboxes in the filter do not display correctly. The filter says "All Items" instead of the two selected items.

 

01.protected void gridviewRequests_PreRender(object sender, EventArgs e)
02.{
03.     gridviewRequests.MasterTableView.FilterExpression = "(ErrorStatus = 'Critical Errors' OR ErrorStatus ='Non-critical Errors')";
04. 
05.     GridFilteringItem filterItem = gridviewRequests.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
06.     RadComboBox combo = (RadComboBox)filterItem.FindControl("ErrorStatusFilter");
07.                    combo.Items.FindItemByValue("No Errors").Checked = false;
08. 
09.     gridviewRequests.MasterTableView.Rebind();
10.}

Eyup
Telerik team
 answered on 24 Aug 2015
1 answer
99 views

Is RadPageLayout compatible with SharePoint 2010/2013 master-page and layouts?

I used below code in SharePoint project , it's working in desktop browsers but in mobile devices i got same desktop view not mobile view.

 

<telerik:RadPageLayout ID="RadPageLayout1" runat="server" HtmlTag="None" GridType="Fluid"

        CssClass="t-rwd-tr t-rwd-overview">
        <telerik:LayoutRow WrapperCssClass="t-rwd-white-row" WrapperHtmlTag="Div" RowType="Container">
            <Rows>
                <telerik:LayoutRow CssClass="t-rwd-row-pad" RowType="Generic">
                    <Content>
                        <h1>
                            Responsive Web Design new</h1>
                    </Content>
                </telerik:LayoutRow>
                <telerik:LayoutRow CssClass="t-rwd-row-pad">
                    <Columns>
                        <telerik:LayoutColumn Span="6" SpanSm="12" SpanXs="12">
                            <p>
                                In times when the sales of tablets and smartphones exceed the sales of desktop PCs,
                                when people use all kinds of mobile devices to browse the web and are allowed to
                                bring their own device to work, ASP.NET developers face the challenge of building
                                web applications targeting all screen resolutions.
                            </p>
                            <p>
                                No surprise “responsive web design” has become such a buzzword—it’s what enables
                                developers to build one website or app and deliver good user experience across all
                                browsers and devices.</p>
                        </telerik:LayoutColumn>
                        <telerik:LayoutColumn Span="6" HiddenSm="true" HiddenXs="true" CssClass="t-rwd-right">                       
                                <h5>Percentage of People Accessing the Web From Mobile Devices   </h5>
                                     <img style="max-width: 100%" src="https://commons.wikimedia.org/wiki/File:Dell_Logo.png"
                                alt="Percentage of People Accessing the Web From Mobile Devices" />                
                        </telerik:LayoutColumn>
                    </Columns>
                </telerik:LayoutRow>
            </Rows>
        </telerik:LayoutRow>
    </telerik:RadPageLayout>

 

Best Regards 

Ali

Dimitar
Telerik team
 answered on 24 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?