Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
191 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
132 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
250 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
210 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
180 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
637 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
100 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
102 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
3 answers
140 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
1 answer
65 views
Hi,
    Currently I am facing an issue with longtouch event for Grid. I attached a contextmenu for the grid.

<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" ScrollHeight="250px" />
when I press longtouch
. When there is scrollheight and then the grid has many records and it has scroll bar, then the ContextMenu appears and disappear in IPAD.
. When there are few records and no scroll bar then the Contextmenu stay when it open.

I have attached a gif file showing the problem.

Thanking you
Lakpa Sherpa
Galin
Telerik team
 answered on 16 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?