Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
159 views
hi
i have grid in batch mode.i add row addNewRecord in java script now after added i want select this by java script code but inserteditem is null
how can select this row by java script code?
Konstantin Dikov
Telerik team
 answered on 17 Apr 2014
14 answers
283 views
Want to sort my group by week number based on the date field.
Trying to convert my old grid (attached old_grid.gif) to Telerik: RadGrid (attached telrik_grid.gif) but the grouping gets sorted recipe from 1-52. I want to get the grouping based on the date field, in this case, week 8 (see attached old_grid.gif)

Attached old_grid.gif is correct grouped........

The asp:SqlDataSource:
SelectCommand="select * from dogtraining where fidnr = @fidnr Order By datum DESC"

The GroupByExpressions:​
<GroupByExpressions>
    <telerik:GridGroupByExpression>
        <SelectFields>
            <telerik:GridGroupByField FieldName="weeknumber" FieldAlias="Vecka" />
        </SelectFields>
        <GroupByFields>
            <telerik:GridGroupByField FieldName="weeknumber" />
        </GroupByFields>
    </telerik:GridGroupByExpression>
</GroupByExpressions>
Radoslav
Telerik team
 answered on 17 Apr 2014
3 answers
227 views
Why is it that when I use a RadGrid that my bound column formatting is inconsistent with the GridColumnEditor columns?

Regards
Princy
Top achievements
Rank 2
 answered on 17 Apr 2014
3 answers
162 views
Hi,

I am trying to figure out how to rebind and update only:
RadListView, which exists in a RadGrid nestedviewtemplate, which is again in another RadGrid's nestedviewtemplate

Steps:

I am calling a RadWindow when user clicks on a button, which exists in RadListView itemtemplate
After adding a record, radwindow should close and rebind and update only that RadListView, which called the RadWindow.

Simple example format with out columns and datasources:

<telerik:RadGrid ID="RadGrid1" runat="server">
            <MasterTableView>
                <NestedViewTemplate>
                    <telerik:RadGrid ID="RadGrid2" runat="server">
                        <MasterTableView>
                            <NestedViewTemplate>
                                <telerik:RadListView ID="RadListView1" runat="server">
                                    <ItemTemplate>
                                        <asp:Button ID="Button1" runat="server" Text="Button" />
                                    </ItemTemplate>
                                </telerik:RadListView>
                            </NestedViewTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </NestedViewTemplate>
            </MasterTableView>
        </telerik:RadGrid>


I will be really thankful if anyone can help.
Shinu
Top achievements
Rank 2
 answered on 17 Apr 2014
5 answers
313 views
I am having trouble horizontally centering the text under the barcode. See the attached image. Thanks!
Mariah
Top achievements
Rank 1
 answered on 17 Apr 2014
5 answers
239 views
Hi,

Normally you can't select a listboxitem that is set Enabled="false". But when selectmode="Multiple" and using shift keybord key, you can still select a disabled item.:
<telerik:RadListBox ID="rlb" runat="server" SelectionMode="Multiple">
            <Items>
                <telerik:RadListBoxItem Text="aaa" />
                <telerik:RadListBoxItem Text="bbb" Enabled="false" />
                <telerik:RadListBoxItem Text="ccc" />
            </Items>
        </telerik:RadListBox>
To select item "bbb":
Select the first item. Hold down shift key. Select the last item.
"bbb" gets selected. This should not be possible, right?

Regards
Caesar

Shinu
Top achievements
Rank 2
 answered on 17 Apr 2014
3 answers
205 views
Hi All,

I try to make unlimited hierarchical radgrid with SelfHierarchySettings. But when i try to expand a node i can not see the child level inside "No child records to display."  I don't want to use  HierarchyLoadMode ="Client"  so can any body check and inform me what's the problem with my code

Regards ..

<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="sm" runat="server" /> 
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" OnColumnCreated="RadGrid1_ColumnCreated" 
        OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound" 
        OnDetailTableDataBind="RadGrid1_DetailTableDataBind">  
        <MasterTableView AllowSorting="true" DataKeyNames="FullPath,ParentPath,IsFolder" 
            Width="100%" > 
            <SelfHierarchySettings ParentKeyName="FullPath" KeyName="ParentPath" /> 
        </MasterTableView> 
        <ClientSettings AllowExpandCollapse="true" /> 
    </telerik:RadGrid> 
    </form> 
</body> 

 

public partial class test2 : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
            GridBoundColumn col = new GridBoundColumn();  
            col.HeaderText = "FullPath";  
            col.DataField = "FullPath";  
            RadGrid1.Columns.Add(col);  
 
            col = new GridBoundColumn();  
            col.HeaderText = "ParentPath";  
            col.DataField = "ParentPath";  
            RadGrid1.Columns.Add(col);  
            RadGrid1.DataSource = GetData("/");  
 
        }  
    }  
 
    private DataTable GetData(string ParentPath)  
    {  
        DataTable dt = new DataTable();  
        dt.Columns.Add(new DataColumn("FullPath"));  
        dt.Columns.Add(new DataColumn("ParentPath"));  
        dt.Columns.Add(new DataColumn("IsFolder"typeof(bool)));  
        DataRow dr;  
        for (int i = 0; i < 3; i++)  
        {  
            dr = dt.NewRow();  
            dr[0] = ParentPath + "Folder" + i;  
            dr[1] = ParentPath;  
            dr[2] = true;  
            dt.Rows.Add(dr);  
        }  
 
        for (int i = 0; i < 2; i++)  
        {  
            dr = dt.NewRow();  
            dr[0] = ParentPath + "File" + i.ToString() + ".txt";  
            dr[1] = ParentPath;  
            dr[2] = false;  
            dt.Rows.Add(dr);  
        }  
 
        return dt;  
    }  
 
    protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)  
    {  
        if (e.Column is GridExpandColumn)  
        {  
            e.Column.Visible = false;  
        }  
        else if (e.Column is GridBoundColumn)  
        {  
            e.Column.HeaderStyle.Width = Unit.Pixel(100);  
        }  
    }  
 
    public void Page_PreRenderComplete(object sender, EventArgs e)  
    {  
        HideExpandColumnRecursive(RadGrid1.MasterTableView);  
    }  
 
    public void HideExpandColumnRecursive(GridTableView tableView)  
    {  
        GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);  
        foreach (GridNestedViewItem nestedViewItem in nestedViewItems)  
        {  
            foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)  
            {  
                nestedView.Style["border"] = "0";  
 
                Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton");  
                if (nestedView.ParentItem.GetDataKeyValue("IsFolder").ToString() == "False")  
                {  
                    if (MyExpandCollapseButton != null)  
                    {  
                        MyExpandCollapseButton.Style["visibility"] = "hidden";  
                    }  
                    nestedViewItem.Visible = false;  
                }  
                else 
                {  
                    if (MyExpandCollapseButton != null)  
                    {  
                        MyExpandCollapseButton.Style.Remove("visibility");  
                    }  
                }  
 
                if (nestedView.HasDetailTables)  
                {  
                    HideExpandColumnRecursive(nestedView);  
                }  
            }  
        }  
    }  
 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
    {  
        CreateExpandCollapseButton(e.Item, "FullPath");  
 
        if (e.Item is GridHeaderItem && e.Item.OwnerTableView != RadGrid1.MasterTableView)  
        {  
            e.Item.Style["display"] = "none";  
        }  
 
        if (e.Item is GridNestedViewItem)  
        {  
            e.Item.Cells[0].Visible = false;  
        }  
    }  
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        CreateExpandCollapseButton(e.Item, "FullPath");  
    }  
 
    public void CreateExpandCollapseButton(GridItem item, string columnUniqueName)  
    {  
        if (item is GridDataItem)  
        {  
            if (item.FindControl("MyExpandCollapseButton") == null)  
            {  
                Button button = new Button();  
                button.Click += new EventHandler(button_Click);  
                button.CommandName = "ExpandCollapse";  
                button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand";  
                button.ID = "MyExpandCollapseButton";  
 
                if (item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client)  
                {  
                    string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID);  
 
                    button.OnClientClick = script;  
                }  
 
                int level = item.ItemIndexHierarchical.Split(':').Length;  
 
                if (level > 1)  
                    button.Style["margin-left"] = level + 10 + "px";  
 
 
                TableCell cell = ((GridDataItem)item)[columnUniqueName];  
                cell.Controls.Add(button);  
                cell.Controls.Add(new LiteralControl("&nbsp;"));  
                cell.Controls.Add(new LiteralControl(((GridDataItem)item).GetDataKeyValue(columnUniqueName).ToString()));  
            }  
        }  
    }  
 
    void button_Click(object sender, EventArgs e)  
    {  
        ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand";  
    }  
 
    protected void RadGrid1_DetailTableDataBind(Object source, GridDetailTableDataBindEventArgs e)  
    {  
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;  
        if (dataItem.GetDataKeyValue("IsFolder").ToString() == "True")  
        {  
            e.DetailTableView.DataSource = GetData(dataItem.GetDataKeyValue("FullPath").ToString());  
        }  
    }  
}  
 
Pavlina
Telerik team
 answered on 16 Apr 2014
2 answers
672 views
Hi,
I am using raddropdowntree. If i select any item in rad drop down tree, event is not firing. when i click on dropdowntree item and out side of the page then "ddtModule_EntryAdded" this event is firing. Is there any another event for dropdowntree when user select an item. Please suggest me a best way ASAP.

Regards,
Ranga.prasad
John
Top achievements
Rank 1
 answered on 16 Apr 2014
3 answers
121 views
I have an RadAutoCompleteBox in the EditForm. What I need to do is to populate another textbox in the Editform based on the value selected in the RadAutoCompleteBox once the value has been selected. I cannot find the right approach to do this. 
Any help / advice is greatly appreciated.

Fim
Top achievements
Rank 1
 answered on 16 Apr 2014
1 answer
131 views
I have an OrgChart  with 2 rendered fields. Am trying to remove the rendered fields for the Root node. i tried to access the node's rendered fields  in the nodeDataBound event, but its not working:

example:

  if (e.Node.ID == "Parent")
            {
                for (int i = e.Node.GroupItems[0].RenderedFields.Count - 1; i >= 0; i--)
                {
                    e.Node.GroupItems[0].RenderedFields[i] = new OrgChartRenderedField();
                }
            }

Thanks
Mira
Boyan Dimitrov
Telerik team
 answered on 16 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?