Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
99 views
hi I have a tree view that is generated at runtime. I can populate it, and save the state using the GetXML() method fine (to session). after reloading the page I use the loadxmlstring() method to re-assign the state. My issue is that after assigning the state, the parent nodes should have a negitive sign "-", instead they have a positive sign "+" so I have to click it three times to collpse the parent node.
I have tried using an arraylist and saving all the IDs of all the expanded nodes, then looping through the nodes after they are bound and using the node.expanded = true property to expand them. Doing it this way produces the same result, having to click the parent node three times to collapse it.
Also after re-assigning the state, the absolute child node isnt expanded. even though the parent is expanded.
Growls
Top achievements
Rank 1
 answered on 09 Jul 2009
4 answers
111 views
This is driving me crazy.  Just for an example, go to:  

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/webmail/defaultcs.aspx

using IE8.  Take note of the width of the column headers.  Now switch to compatibilty mode. 

See what I'm talking about?  I tested out IE7 on a different machine and it still makes them wider. 

FF3.5 and IE8 seem to display them the same. I haven't tested out older FF versions or Safari.  But I will.

This is a royal pain -- I have some very limited real estate and I'm trying not to have to horizontal scroll -- so I have each column headerstyle and itemstyle explicitly set to widths that I know will fit.  And it works great.  UNTIL I have to use IE7.   I'd love to just tell folks they have to use IE8 or FF, but tons and tons of people are still using older browsers.


Please don't make me go back to the days of developing for NetScape and IE. 

Any help would be appreciated.

Troy
Troy
Top achievements
Rank 1
 answered on 08 Jul 2009
0 answers
135 views
Hi
 I have a radtreeview with checkboxes. Also i have 3 radio buttons - All, Selected, Unselected. Basically, when i click on All radio button, it should show all the nodes. When i click Selected, it should show only checked nodes, and when i click unselected it should only show unchecked ones. The problem is when i make them invisible programatically, they loose their check state, so when i make them visible again, the checkboxes are gone. What's the most efficient way to implement this? Thanks in advance.
Samir
Top achievements
Rank 1
 asked on 08 Jul 2009
1 answer
164 views
Hi,
I want the user to be enable to type only numeric values, when "0005" is valid. The Textbox of the colmun in the grid automatically converts "0005" to "5". how can I avoid it?

thanks,
Hk
Daniel
Telerik team
 answered on 08 Jul 2009
1 answer
157 views
Hi all, I am having a problem with the RadGrid disappearing when loaded into a RadMultiPage. I dynamically load a control with a RadGrid into the RadMultiPage using the code below:  (Followed the Sample Code)

 

Invoices uc = (Invoices)Page.LoadControl(userControlName);

 

uc.OrgId = CurOrgId;

uc.ID = e.PageView.ID +

"_userControl";

 

e.PageView.Controls.Clear();

//Not sure if this does anything but I added it anyway.

 

e.PageView.Controls.Add(uc);

uc.DataBind();



The RadGrid is bound using the following:

protected

 

void dgInvoice_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

    string strSP = "GetInvoices";

 

    System.Data.SqlClient.

SqlParameter[] spParams = new System.Data.SqlClient.SqlParameter[1];

 

    spParams[0] =

new System.Data.SqlClient.SqlParameter("isActive", "1");

 

    this.dgInvoice.DataSource = Database.getDataSet(strSP, spParams);

 

}

 

 

 

    

The control with the RadGrid functions perfectly when housed alone in an aspx page.  But when we load the control dynamically into the RadMultiPage, the page displays fine...but clicking on anything that would fire a partial postback causes the entire RadGrid to disappear.

Any ideas?

Thanks in advance.

Vincent

 

 

vincent
Top achievements
Rank 1
 answered on 08 Jul 2009
2 answers
113 views
Hi,

I have a Radpanelbar ,

How do i do a .focus on the item after i click on the expand button

As currently , i have a webpart with the Radpanelbar control but upon expand it alway navigate to the top of the webpart .

Kindly advise .
Noob2008 Noob2008
Top achievements
Rank 1
 answered on 08 Jul 2009
5 answers
335 views

Hello,

I have a problem with the paging of the RadGrid  that I have not been able to resolve . I define the grid in the page_load when the page is loaded for the first time as you can see in the next code:


private void DefineGridStructureGruposDisp() 
    { 
        RDG_GruposDisp.PagerStyle.ShowPagerText = true; 
        RDG_GruposDisp.AllowPaging = true; 
        RDG_GruposDisp.AllowCustomPaging = false; 
        //RDG_GruposDisp.VirtualItemCount = 100; 
        RDG_GruposDisp.AutoGenerateColumns = false; 
        RDG_GruposDisp.GridLines = GridLines.None; 
        RDG_GruposDisp.ClientSettings.Selecting.AllowRowSelect = false; 
 
        //Set options to enable Group-by 
        //RDG_GruposDisp.GroupingEnabled = true; 
        RDG_GruposDisp.ShowGroupPanel = false; 
        RDG_GruposDisp.ClientSettings.AllowDragToGroup = false; 
        RDG_GruposDisp.ClientSettings.AllowColumnsReorder = true; 
        //RDG_GruposDisp.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand; 
 
        RDG_GruposDisp.MasterTableView.NoDetailRecordsText = "No hay Grupos "; 
        RDG_GruposDisp.MasterTableView.NoMasterRecordsText = "No hay Grupos "; 
        RDG_GruposDisp.MasterTableView.EditMode = GridEditMode.EditForms; 
 
        RDG_GruposDisp.MasterTableView.AllowSorting = true; 
        RDG_GruposDisp.AllowMultiRowSelection = true; 
        //RDG_GruposDisp.ShowFooter = true; 
        RDG_GruposDisp.Width = Unit.Percentage(100); 
 
        // Configurar paginación 
        RDG_GruposDisp.MasterTableView.PageSize = 40; 
        RDG_GruposDisp.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; 
 
        //Add columns 
 
        GridBoundColumn boundColumn = new GridBoundColumn(); 
        RDG_GruposDisp.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.DataField = "idGrupos"; 
        boundColumn.HeaderText = "idGrupos"; 
        boundColumn.UniqueName = "idGrupos"; 
        //boundColumn.DataFormatString = "{0:##,##}"; 
        //boundColumn.Resizable = false; 
        boundColumn.ReadOnly = true; 
        boundColumn.ItemStyle.VerticalAlign = VerticalAlign.Middle; 
        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; 
        //boundColumn.FooterText = "Id Evento"; 
        boundColumn.Visible = false; 
 
        boundColumn = new GridBoundColumn(); 
        RDG_GruposDisp.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.DataField = "Grupos"; 
        boundColumn.HeaderText = "Grupos"; 
        boundColumn.UniqueName = "Grupos"; 
        //boundColumn.DataFormatString = "{0:##,##}"; 
        //boundColumn.Resizable = false; 
        boundColumn.ReadOnly = true; 
        boundColumn.ItemStyle.VerticalAlign = VerticalAlign.Middle; 
        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; 
        //boundColumn.FooterText = "Grupo"; 
        boundColumn.Visible = true; 
    } 
 

I use needdatasource to pass data where i call the funtion through Rebind():

protected void RDG_GruposDisp_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
        String Rebind = e.RebindReason.ToString(); 
 
        if (Rebind == "ExplicitRebind" || Rebind == "DetailTableBinding, PostBackEvent") 
        {             
                RDG_GruposDisp.DataSource = eventos.GetGruposD_P(DDLProvincias.SelectedValue) ; 
        } 
    } 
 

The problem is that i can´t reset the paging of the grid, I mean if I first do a query where I select a value in the combobox that retrieves 1000 data after that I change that value in the combobox  now selecting 500 data and the paging is still  retrieving me  1000 data, the same number of pages when indeed it should just have 500 a half of pages . However in the grid are the data correctly but the client can be confused by thinking that there are more data that shows the paging. 

I hope that you understand what I wrote, sorry for my poor English.

 

Julio






private void DefineGridStructureGruposDisp() 
    { 
        RDG_GruposDisp.PagerStyle.ShowPagerText = true; 
        RDG_GruposDisp.AllowPaging = true; 
        RDG_GruposDisp.AllowCustomPaging = false; 
        //RDG_GruposDisp.VirtualItemCount = 100; 
        RDG_GruposDisp.AutoGenerateColumns = false; 
        RDG_GruposDisp.GridLines = GridLines.None; 
        RDG_GruposDisp.ClientSettings.Selecting.AllowRowSelect = false; 
 
        //Set options to enable Group-by 
        //RDG_GruposDisp.GroupingEnabled = true; 
        RDG_GruposDisp.ShowGroupPanel = false; 
        RDG_GruposDisp.ClientSettings.AllowDragToGroup = false; 
        RDG_GruposDisp.ClientSettings.AllowColumnsReorder = true; 
        //RDG_GruposDisp.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand; 
 
        RDG_GruposDisp.MasterTableView.NoDetailRecordsText = "No hay idGrupos "; 
        RDG_GruposDisp.MasterTableView.NoMasterRecordsText = "No hay idGrupos "; 
        RDG_GruposDisp.MasterTableView.EditMode = GridEditMode.EditForms; 
 
        RDG_GruposDisp.MasterTableView.AllowSorting = true; 
        //RDG_GruposDisp.MasterTableView.DataKeyNames = new string[] { "idEvento" }; 
        RDG_GruposDisp.AllowMultiRowSelection = true; 
        //RDG_GruposDisp.ShowFooter = true; 
        RDG_GruposDisp.Width = Unit.Percentage(100); 
 
        // Configurar paginación 
        RDG_GruposDisp.MasterTableView.PageSize = 40; 
        RDG_GruposDisp.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; 
 
        //Add columns 
 
        GridBoundColumn boundColumn = new GridBoundColumn(); 
        RDG_GruposDisp.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.DataField = "idGrupos"; 
        boundColumn.HeaderText = "idGrupos"; 
        boundColumn.UniqueName = "idGrupos"; 
        //boundColumn.DataFormatString = "{0:##,##}"; 
        //boundColumn.Resizable = false; 
        boundColumn.ReadOnly = true; 
        boundColumn.ItemStyle.VerticalAlign = VerticalAlign.Middle; 
        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; 
        //boundColumn.FooterText = "Id Evento"; 
        boundColumn.Visible = false; 
 
        boundColumn = new GridBoundColumn(); 
        RDG_GruposDisp.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.DataField = "Grupos"; 
        boundColumn.HeaderText = "Grupos"; 
        boundColumn.UniqueName = "Grupos"; 
        //boundColumn.DataFormatString = "{0:##,##}"; 
        //boundColumn.Resizable = false; 
        boundColumn.ReadOnly = true; 
        boundColumn.ItemStyle.VerticalAlign = VerticalAlign.Middle; 
        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; 
        //boundColumn.FooterText = "Grupo"; 
        boundColumn.Visible = true; 
    } 
 




Julio Lopes
Top achievements
Rank 1
 answered on 08 Jul 2009
1 answer
158 views

How I can Bind SessionDataSource SelectCommand, UpdateCommand,DeleteCommand using LINQ so I can perform insert /update/delete automatic  operation with grid using LINQ.

Nikolay Rusev
Telerik team
 answered on 08 Jul 2009
0 answers
136 views

Hi!

I've been trying to construct a page with several RadTabStrips and corresponding PageViews with the invisible status enabled (visible = false). Unfortunately, when I have an postbacks (With or without RadAjaxManager) the RadPageViews lose the false state of the enable and visible properties to their original value: true. The RadTabs maintain the false value for both enable and visible properties. I have enableViewState set to true in both controls.

Is this an problem in my application, an telerik problem or something that I'm not gething it?

Here is the log of my Page Load (!Postback) with 4 RadTabs and 4 PageViews:
Tab: i0; enable: True; visible:True hash: 1041383
Tab: i1; enable: True; visible:True hash: 21869055
Tab: i2; enable: True; visible:True hash: 56596981
Tab: i3; enable: False; visible:False hash: 47685916
RadPageView: wuc1; enable: True; visible:True hash: 61880160
RadPageView: wuc2; enable: True; visible:True hash: 24414944
RadPageView: wuc3; enable: True; visible:True hash: 42951790
RadPageView: wuc4; enable: False; visible:False hash: 29572360

Here is my second log in the page_load event in my first a postback with an added RadTab and PageView:
Tab: i0; enable: True; visible:True hash: 2919477
Tab: i1; enable: True; visible:True hash: 61309027
Tab: i2; enable: True; visible:True hash: 12421168
Tab: i3; enable: False; visible:False hash: 59517951   ------> OK
RadPageView: wuc1; enable: True; visible:True hash: 41917428
RadPageView: wuc2; enable: True; visible:True hash: 7850760
RadPageView: wuc3; enable: True; visible:True hash: 30648237
RadPageView: wuc4; enable: True; visible:True hash: 39633220    ------> Expected FAlse in both properties


ASPX code:
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"> 
</telerik:RadTabStrip> 
 
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" OnPageViewCreated="RadMultiPage1_PageViewCreated"> 
</telerik:RadMultiPage> 


My C# code:
  
    protected void Page_Load(object sender, EventArgs e) 
    { 
        Ajax.Utility.RegisterTypeForAjax(typeof(RTS)); 
 
        if (!Page.IsPostBack) 
        { 
            Session.Add("wucNum", 1); 
            AddTab("wuc", true); 
            AddTab("wuc", true); 
            AddTab("wuc", true); 
            AddTab("wuc", false); 
         } 
   } 
 
 private void AddTab(string tabName, bool isEnabled) 
    { 
        int wucNum = (int)Session["wucNum"]; 
 
        RadTab tab = new RadTab(); 
        tab.Text = tabName + (int)Session["wucNum"] + " " + isEnabled; 
        tab.Enabled = isEnabled; 
        tab.Visible = isEnabled; 
        RadTabStrip1.Tabs.Add(tab); 
        RadTabStrip1.Tabs[RadTabStrip1.Tabs.Count - 1].Selected = true; 
 
        RadPageView pageView = new RadPageView(); 
        pageView.Enabled = isEnabled; 
        pageView.Visible = isEnabled; 
        pageView.ID = tabName + (int)Session["wucNum"] + " " + isEnabled; 
        RadMultiPage1.PageViews.Add(pageView); 
    } 
 
    protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e) 
    { 
            string userControlName = e.PageView.ID.Substring(0, 3) + ".ascx"; 
 
            Control userControl = Page.LoadControl(userControlName); 
            userControl.ID = e.PageView.ID + "_userControl"; 
            e.PageView.Controls.Add(userControl); 
     } 






Rodrigo Selada
Top achievements
Rank 1
 asked on 08 Jul 2009
1 answer
165 views
<table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%" text-align="left">    
<tr> 
        <td> 
            <telerik:RadGrid ID="SearchResultsRadGrid" runat="server"   
                DataSourceID="SiteSearchResultsObjectDataSource" SkinID="RadGridHeaderSkin"   
                GridLines="Vertical"  Style="margin: 0px 10px 0px 10px" OnSelectedIndexChanged="SearchResultsRadGrid_SelectedIndexChanged" 
                OnItemDataBound="SearchResultsRadGrid_ItemDataBound"   
                OnNeedDataSource="SearchResultsRadGrid_NeedDataSource"   
                AutoGenerateColumns="False" onprerender="SearchResultsRadGrid_PreRender"   
                Skin="Default">  
                <MasterTableView DataKeyNames="ID" TableLayout = "Fixed"   
                    DataSourceID="SiteSearchResultsObjectDataSource" Frame="Void">  
                    <NoRecordsTemplate> 
                    No records to display !  
                    </NoRecordsTemplate> 
                    <Columns> 
                        <telerik:GridTemplateColumn HeaderText="Status" UniqueName="TemplateColumn">  
                            <ItemTemplate> 
                                <asp:Label ID="StatusImageLabel" runat="server"></asp:Label> 
                            </ItemTemplate> 
                          <HeaderStyle Font-Names="Trebuchet MS" Font-Size="14px" ForeColor="#3496b4" Width="60px"  /> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridBoundColumn DataField="Name" HeaderText="Site Name" SortExpression="Name" 
                            UniqueName="Name">  
                        <HeaderStyle Font-Names="Trebuchet MS" Font-Size="14px" ForeColor="#3496b4" Width="40%"  /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="City" HeaderText="City" SortExpression="City" 
                            UniqueName="City">  
                          <HeaderStyle Font-Names="Trebuchet MS" Font-Size="14px" ForeColor="#3496b4" Width="15%"  /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="StateName" HeaderText="State" SortExpression="StateName" 
                            UniqueName="StateName" ReadOnly="True">  
                          <HeaderStyle Font-Names="Trebuchet MS" Font-Size="14px" ForeColor="#3496b4" Width="15%"   /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="CountryName" HeaderText="Country" SortExpression="CountryName" 
                            UniqueName="CountryName" ReadOnly="True">  
                         <HeaderStyle Font-Names="Trebuchet MS" Font-Size="14px" ForeColor="#3496b4" Height="5px" Width="15%"   /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Zipplus4" HeaderText="Zip" SortExpression="Zipplus4" 
                            UniqueName="Zipplus4">  
                           <HeaderStyle Font-Names="Trebuchet MS" Font-Size="14px" ForeColor="#3496b4" Width="15%"   /> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridTemplateColumn HeaderText="Action" UniqueName="TemplateColumn1">  
                            <ItemTemplate> 
                                <asp:ImageButton ID="EditImageButton" runat="server" CssClass="GridActionColumn" CommandArgument='<%# Eval("ID") %>' 
                                    ImageUrl="~/App_Themes/PANCAN_Theme/Images/edit.gif" ToolTip="Edit" OnClick="EditImageButton_Click" 
                                    CausesValidation="False" /> 
                                  
                                <asp:LinkButton ID="PreviewLinkButton" runat="server" CssClass="GridActionColumn" CausesValidation="False" CommandName="Select" 
                                    EnableViewState="False" Visible="false">Preview</asp:LinkButton> 
                                <asp:HiddenField ID="StatusHiddenField" runat="server" Value='<%# Eval("Active") %>' /> 
                            </ItemTemplate> 
                       <HeaderStyle Font-Names="Trebuchet MS" Font-Size="14px" ForeColor="#3496b4" Width="60px"  /> 
                        </telerik:GridTemplateColumn> 
                    </Columns> 
                  </MasterTableView> 
                 
            </telerik:RadGrid> 
            <asp:ObjectDataSource ID="SiteSearchResultsObjectDataSource" runat="server" SelectMethod="SearchSite" 
                TypeName="ServiceLayer.SiteService">  
                <SelectParameters> 
                    <asp:ControlParameter ControlID="FindSiteHiddenField" Name="SearchString" PropertyName="Value" 
                        Type="String" /> 
                    <asp:ControlParameter ControlID="SiteStatusHiddenField" Name="Status" PropertyName="Value" 
                        Type="String" /> 
                    <asp:ControlParameter ControlID="ActionHiddenField" Name="Action" PropertyName="Value" 
                        Type="String" /> 
                </SelectParameters> 
            </asp:ObjectDataSource> 
        
        </td> 
    </tr> 
Hi Telerik Admin !

Im using the TELERIK RAD GRID with DEAFULT SKIN(Q2 2009). I have folowing problem :-

Whenever I reorder my columns of the GRID the overall alignment of the page gets distubed. I have used the SKIN for the RED GRID(i.e. I have mentioned all the CLIENT SETTTING property for the GRID in SKIN file.) . I have placed my RAD GRID within in row of the Table with TABLE havong the follwing property :
 Cellspacing = 0px
 Cellpadding = 0px
 Border = 0px
width = 100%
height = 100%

Now whenever  , I reoder the columns of the RAD GRID & click on to the colums headers(try to sort), the RAD GRID gets STREACHED for its mean position, as a result of which the other controls on to the other <TD> of the Table gets distorted and overall structure of the webpage gets disturbed.

My providing you with the CODE that Iam using.
This is the SKIN FILE for the RAD GRID.  
---------------------------------------  
 
 
<telerik:RadGrid runat="server" Skinid="RadGridHeaderSkin">  
    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true"  AllowColumnsReorder="true" ReorderColumnsOnClient="true">  
     <Resizing AllowRowResize="True" EnableRealTimeResize="false" ClipCellContentOnResize="false" ResizeGridOnColumnResize="true" AllowColumnResize="True"></Resizing> 
        <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" ScrollHeight="20px" /> 
        <Selecting AllowRowSelect="true" /> 
         
    </ClientSettings> 
</telerik:RadGrid> 

Plase help to sort out this probelm.


 

Georgi Krustev
Telerik team
 answered on 08 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?