Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
75 views

Is there anybody can help me to do like this on attachment? I have one text box and one telerik grid and one button. What I want to do is when user enter room no in text box and click GO button then I want to point out text box value on grid because grid have many records.I would like to show attached screen shot.

 

Thanks

Myo
Top achievements
Rank 1
 answered on 23 Apr 2015
6 answers
280 views

Hello,

 

I have a problem with RadListBox in a Control Page (.ASCX). Everything seems to work fine when transferring from one RadListBox to a second one from client-side.

The problem is after post back. Changes are not being read. These are my JS and ASPX codes.

I would appreciate any help. Thank you.

 

var listBox;
var listBox2;
  
function transferItem(item, lbSource, lbTarget) {
    var itemsTarget = lbTarget.get_items();
    lbTarget.trackChanges();
    itemsTarget.insert(0, item);
    lbTarget.commitChanges();
}
  
function pageLoad() {
    var $ = $telerik.$;
    listBox = $find("<%= AllLanguages.ClientID %>");
    listBox2 = listBox.get_transferTo();
}
  
function transferRight() {
    var items = listBox.get_selectedItems();
    for (var i = 0; i < items.length; i++) {
        var item = items[i];
        if (item.get_text() != "Select" || item.get_value() != "") {
            transferItem(item, listBox, listBox2);
        }
    }
    listBox.clearSelection();
    listBox2.clearSelection();
    return false;
}
  
function transferLeft() {
    var items = listBox2.get_selectedItems();
    for (var i = 0; i < items.length; i++) {
        var item = items[i];
        if (item.get_text() != "Select" || item.get_value() != "") {
            transferItem(item, listBox2, listBox);
        }
    }
    listBox.clearSelection();
    listBox2.clearSelection();
    return false;
}
  
function removeAll() {
    var items = listBox2.get_items();
    for (var i = items.get_count() - 1 ; i > -1 ; --i) {
        transferItem(items.getItem(i), listBox2, listBox);
    }
}

 

<table border="0" style="width: 760px; border-collapse: collapse; border-spacing: 0px">
    <tr>
        <td>Available:</td>
        <td></td>
        <td>Selected:</td>
    </tr>
    <tr>
        <td>
            <telerik:RadListBox ID="AllLanguages" runat="server" Height="500px" Width="300px" SelectionMode="Multiple" TransferToID="SelectedLanguages"></telerik:RadListBox>
        </td>
        <td>
            <telerik:RadButton ID="btnAdd" runat="server" Text="Add >" Width="100px" OnClick="btnAdd_Click" OnClientClicked="transferRight" AutoPostBack="False" UseSubmitBehavior="False"></telerik:RadButton>
            <br />
            <telerik:RadButton ID="btnRemove" runat="server" Text="< Remove" Width="100px" OnClientClicked="transferLeft" AutoPostBack="False" UseSubmitBehavior="False"></telerik:RadButton>
            <br />
            <telerik:RadButton ID="btnRemoveAll" runat="server" Text="Remove All" Width="100px" OnClientClicked="removeAll" AutoPostBack="False" UseSubmitBehavior="False"></telerik:RadButton>
            <br />
        </td>
        <td>
            <telerik:RadListBox ID="SelectedLanguages" runat="server" Height="500px" Width="300px" OnClientLoad="pageLoad"></telerik:RadListBox>
        </td>
    </tr>
</table>

Ivan Danchev
Telerik team
 answered on 23 Apr 2015
2 answers
426 views

I have a hierarchical radgrid that is displaying "No child records to display" even when records exist. See attached photo. Below is my RadGrid definition:

 

<telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="true" AutoGenerateColumns="False"
                    AllowSorting="True"
                    OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource"
                    OnPreRender="RadGrid1_PreRender" GroupPanelPosition="Top" OnBatchEditCommand="RadGrid1_BatchEditCommand" Skin="Office2010Black"
                    AllowFilteringByColumn="True" CellSpacing="-1" GridLines="Both" Visible="false">
 
                    <MasterTableView DataKeyNames="wbs_id" RetainExpandStateOnRebind="True" AllowMultiColumnSorting="True" CommandItemDisplay="Top">
                        <DetailTables>
                            <telerik:GridTableView runat="server" Width="100%" DataKeyNames="task_id" RetainExpandStateOnRebind="True" Name="Steps">
                                <CommandItemSettings ShowAddNewRecordButton="False"></CommandItemSettings>
                            </telerik:GridTableView>
                            <telerik:GridTableView runat="server" Width="100%" DataKeyNames="task_id" RetainExpandStateOnRebind="True" Name="Steps">
                                <DetailTables>
                                    <telerik:GridTableView runat="server" Width="100%" DataKeyNames="task_id" RetainExpandStateOnRebind="True" EditMode="Batch" Name="StepDetails" CommandItemDisplay="Top">
                                    </telerik:GridTableView>
                                </DetailTables>
                            </telerik:GridTableView>
                        </DetailTables>
 
                        <CommandItemSettings ShowAddNewRecordButton="False"></CommandItemSettings>
                    </MasterTableView>
 
                    <PagerStyle Mode="NumericPages"></PagerStyle>
 
                    <MasterTableView DataKeyNames="wbs_id" AllowMultiColumnSorting="True" CommandItemDisplay="Top" RetainExpandStateOnRebind="true">
                        <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="true"></CommandItemSettings>
 
                        <DetailTables>
 
                            <telerik:GridTableView DataKeyNames="task_id" Name="Steps" Width="100%" RetainExpandStateOnRebind="true">
 
                                <DetailTables>
 
                                    <telerik:GridTableView DataKeyNames="task_id" Name="StepDetails" Width="100%" EditMode="Batch" CommandItemDisplay="Top" RetainExpandStateOnRebind="true">
 
                                        <CommandItemSettings ShowSaveChangesButton="true" ShowCancelChangesButton="true" ShowAddNewRecordButton="false" />
 
                                        <Columns>
 
                                            <telerik:GridBoundColumn SortExpression="proc_id" HeaderText="proc id" HeaderButtonType="TextButton"
                                                DataField="proc_id" Display="false">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridBoundColumn SortExpression="proc_name" HeaderText="Step Name" HeaderButtonType="TextButton"
                                                DataField="proc_name" ReadOnly="true">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridBoundColumn SortExpression="proc_wt" HeaderText="Step Weight" HeaderButtonType="TextButton"
                                                DataField="proc_wt" ReadOnly="true" AllowFiltering="false">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridBoundColumn SortExpression="complete_pct" HeaderText="Percent Complete" HeaderButtonType="TextButton"
                                                DataField="complete_pct" ReadOnly="true" AllowFiltering="false">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridTemplateColumn UniqueName="CompleteFlag" DataField="complete_flag" HeaderText="Complete" ReadOnly="true"
                                                AllowFiltering="false">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#DataBinder.Eval (Container.DataItem,"complete_flag").ToString()!="N"? true:false %>' />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
 
                                            <telerik:GridDateTimeColumn MinDate="2013-01-01" DataField="act_start" HeaderText="Actual Start" SortExpression="act_start"
                                                UniqueName="act_start" DataType="System.DateTime" FilterControlAltText="Filter act_start column" DataFormatString="{0:yyyy/MM/dd}"
                                                ItemStyle-BackColor="#c6f3ff" AllowFiltering="false">
                                            </telerik:GridDateTimeColumn>
 
                                            <telerik:GridDateTimeColumn MinDate="2013-01-01" DataField="est_act_finish" HeaderText="Est/Actual Finish" SortExpression="est_act_finish"
                                                UniqueName="est_act_finish" DataType="System.DateTime" FilterControlAltText="Filter est_act_finish column" DataFormatString="{0:yyyy/MM/dd}"
                                                ItemStyle-BackColor="#c6f3ff" AllowFiltering="false">
                                            </telerik:GridDateTimeColumn>
 
 
                                            <telerik:GridBoundColumn SortExpression="complete_pct_upd" HeaderText="Updated Percent Complete" HeaderButtonType="TextButton"
                                                DataField="complete_pct_upd" DataType="System.Decimal" ItemStyle-BackColor="#c6f3ff" AllowFiltering="false">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridBoundColumn SortExpression="last_updated" HeaderText="Last Updated" HeaderButtonType="TextButton"
                                                DataField="last_updated" ReadOnly="true" DataType="System.DateTime" DataFormatString="{0:yyyy/MM/dd}"
                                                AllowFiltering="false">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridBoundColumn SortExpression="updated_by" HeaderText="Updated By" HeaderButtonType="TextButton"
                                                DataField="updated_by" ReadOnly="true" AllowFiltering="false">
                                            </telerik:GridBoundColumn>
 
                                            <telerik:GridBoundColumn SortExpression="comments" HeaderText="Comments" HeaderButtonType="TextButton"
                                                DataField="comments" ReadOnly="false" DataType="System.String" AllowFiltering="false" ItemStyle-BackColor="#c6f3ff">
                                            </telerik:GridBoundColumn>
 
                                        </Columns>
 
                                    </telerik:GridTableView>
 
                                </DetailTables>
 
                                <Columns>
 
                                    <telerik:GridBoundColumn SortExpression="task_id" HeaderText="task_id" HeaderButtonType="TextButton"
                                        DataField="task_id" Display="false" ReadOnly="true">
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn SortExpression="task_code" HeaderText="Activity ID" HeaderButtonType="TextButton"
                                        DataField="task_code" UniqueName="task_code" ReadOnly="true">
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn SortExpression="task_name" HeaderText="Activity Name" HeaderButtonType="TextButton"
                                        DataField="task_name" UniqueName="task_name" ReadOnly="true">
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn SortExpression="start" HeaderText="Start" HeaderButtonType="TextButton"
                                        DataField="start" UniqueName="start" DataType="System.DateTime" ReadOnly="true" DataFormatString="{0:yyyy/MM/dd}"
                                        AllowFiltering="false">
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn SortExpression="finish" HeaderText="Finish" HeaderButtonType="TextButton"
                                        DataField="finish" UniqueName="finish" DataType="System.DateTime" ReadOnly="true" DataFormatString="{0:yyyy/MM/dd}"
                                        AllowFiltering="false">
                                    </telerik:GridBoundColumn>
 
                                    <telerik:GridBoundColumn DataField="remain_work_qty" EmptyDataText="" HeaderText="Remaining Hours"
                                        SortExpression="remain_work_qty" UniqueName="remain_work_qty" DataType="System.Decimal"
                                        ReadOnly="true" AllowFiltering="false" DataFormatString="{0:0}">
                                    </telerik:GridBoundColumn>
 
                                </Columns>
 
                            </telerik:GridTableView>
 
                        </DetailTables>
 
                        <Columns>
 
                            <telerik:GridBoundColumn SortExpression="wbs_id" HeaderText="wbs_id" HeaderButtonType="TextButton"
                                DataField="wbs_id" Display="false">
                            </telerik:GridBoundColumn>
 
                            <telerik:GridBoundColumn SortExpression="wbs_name" HeaderText="Work Package" HeaderButtonType="TextButton"
                                DataField="wbs_name">
                            </telerik:GridBoundColumn>
 
                        </Columns>
 
                    </MasterTableView>
 
                </telerik:RadGrid>

 This is how it is being bound:

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            
                if (RadComboBox1.SelectedIndex != -1 && RadDropDownList1.SelectedIndex != -1)
            {
                
                string projid = RadDropDownList1.SelectedValue;
                string cam = RadComboBox1.SelectedValue;
 
                if (!e.IsFromDetailTable)
                {
 
                    RadGrid1.DataSource = GetDataTable("SELECT * FROM PrimaveraWbs WHERE proj_id = " + projid + " and name = '" + cam + "'");
 
                }
            }          
        }
 
        public DataTable GetDataTable(string query)
        {
 
            String ConnString = ConfigurationManager.ConnectionStrings["PSMSystemConnectionString"].ConnectionString;
 
            SqlConnection conn = new SqlConnection(ConnString);
 
            SqlDataAdapter adapter = new SqlDataAdapter();
 
            adapter.SelectCommand = new SqlCommand(query, conn);
 
 
 
            DataTable myDataTable = new DataTable();
 
 
 
            conn.Open();
 
            try
            {
 
                adapter.Fill(myDataTable);
 
            }
 
            finally
            {
 
                conn.Close();
 
            }
 
 
 
            return myDataTable;
 
        }
 
        protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
 
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
 
            switch (e.DetailTableView.Name)
            {
 
                case "Steps":
                    {
 
                        string wbs_id = dataItem.GetDataKeyValue("wbs_id").ToString();
 
                        e.DetailTableView.DataSource = GetDataTable("SELECT * FROM PrimaveraTask WHERE wbs_id = " + wbs_id + " ORDER BY task_code");
 
                        break;
 
                    }
 
 
 
                case "StepDetails":
                    {
 
                        string task_id = dataItem.GetDataKeyValue("task_id").ToString();
 
                        e.DetailTableView.DataSource = GetDataTable("SELECT * FROM PrimaveraSteps WHERE task_id = " + task_id + "");
 
                        break;
 
                    }
 
            }
 
        }
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            
            string acb = RadDropDownList1.SelectedText;
            
            if (RadComboBox1 != null && RadDropDownList1.SelectedIndex != -1)
            {
                if (!Page.IsPostBack)
                {
 
                    RadGrid1.MasterTableView.Items[0].Expanded = true;
 
                    RadGrid1.MasterTableView.Items[0].ChildItem.NestedTableViews[0].Items[0].Expanded = true;
 
                }
            }
        }

How do I ensure that this message is not displayed when records do exist?

Thanks in advance,

Josh

Josh
Top achievements
Rank 1
 answered on 23 Apr 2015
1 answer
153 views
Hi,
I want when user clicks outside of  rad grid modal popup it should close the popup window. I need to make this only from client side
Lubomir
Top achievements
Rank 1
 answered on 23 Apr 2015
8 answers
88 views

Please double check your online demo pages, e.g. http://demos.telerik.com/aspnet-ajax/imageeditor/examples/overview/defaultcs.aspx

Try to open the Crop dialog (in IE11): 

SCRIPT5022: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'HwdlHwoCAh8LaB8MaGRk'.
File: Telerik.Web.UI.WebResource.axd, Line: 15, Column: 16485

Vessy
Telerik team
 answered on 23 Apr 2015
1 answer
128 views

I have a RadDropDownTree.  I populate it with a hierarchy from the database.  I set the "SelectedValue" equal to whatever group an employee belongs to (based on database record).

 So for example:  DropDownTree loads and selects "bakery" based on it's ID in the db.

Store

-->cashier

-->bakery (selected)

-->maintenance

So now I click on "cashier" and hit update.  On the server side, the DropDownTree.SelectedValue is still equal to the ID of the "bakery".  Why is the change not being sent to the server side?

Stacy
Top achievements
Rank 1
 answered on 23 Apr 2015
3 answers
136 views
How do I use RadDatePicker inside a Custom Server Control using HttpTextWriter? It seems that the Telerik control hates the invocation of `RenderControl` outside of a UI.Page class. Its a shame as the standard .Net controls honor `RenderControl(writer)` perfectly - yet Telerik controls don't. I assume this has to do with the script manager and registering events.

How can I get the flexibility of custom server controls whilst still being able to place Telerik controls inside them. User controls are not the answer.

Any suggestions or implementations?

Thankyou.
Eirik H
Top achievements
Rank 2
 answered on 23 Apr 2015
26 answers
1.0K+ views
Hello,

I am using a custom data object with a select-method that collects data from different tables, adding data from cached object collections etc. This is done with linq. It's working great with one exception: filtering data. When filtering data I cant get the filtering expression in a linq-syntax.

My radgrid has EnableLinqExpressions set to true, and my ObjectDataSource looks like below:

    <asp:ObjectDataSource ID="ObjectDataSource1" TypeName="MyNameSpace.DataAccessLayer.UserDataObject" 
        SelectMethod="Select" SelectCountMethod="SelectCount" EnablePaging="True" runat="server" 
        MaximumRowsParameterName="maximumRow" OldValuesParameterFormatString="original_{0}" 
        OnSelecting="ObjectDataSource1_Selecting" OnSelected="ObjectDataSource1_Selected"
        <SelectParameters> 
            <asp:Parameter Name="shopID" Type="Int32" /> 
            <asp:Parameter Name="filter" Type="String" /> 
            <asp:Parameter Name="sort" Type="Object" /> 
            <asp:Parameter Name="startRowIndex" Type="Int32" /> 
            <asp:Parameter Name="maximumRow" Type="Int32" /> 
        </SelectParameters> 
    </asp:ObjectDataSource> 


I set the parameters in the selecting-event of the ObjectDataSource:

    protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) 
    { 
        e.InputParameters["shopID"] = thisShop.ShopID; 
        e.InputParameters["filter"] = RadGrid1.MasterTableView.FilterExpression; 
        e.InputParameters["sort"] = RadGrid1.MasterTableView.SortExpressions.GetSortString(); 
        e.InputParameters["startRowIndex"] = RadGrid1.CurrentPageIndex*RadGrid1.PageSize; 
        e.InputParameters["maximumRow"] = RadGrid1.PageSize; 
    } 

How can I get the filterexpression to be in a linq-friendly format so that I can use it in my linq-query?
Angel Petrov
Telerik team
 answered on 23 Apr 2015
7 answers
337 views
If you click on a dropdown in the iphone or ipad you get the keyboard popup, even though it is only a dropdown. There is no way to turn that off.
Dimitar
Telerik team
 answered on 23 Apr 2015
1 answer
74 views

Already I implemented custom sorting and custom paging with objectdatasource and database. Now I need to implement custom filtering in rad grid with objectdatasource and database.

Can you send me any sample solution?

Maria Ilieva
Telerik team
 answered on 23 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?