Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
59 views
Hi

Question1: I was under impression that Grid control by default used Ajax features, and any action on grid will produce ajax like behaviour as seen in demos.  but I observe that it does postbacks.   what i am missing.

Question2: I am using following code in Page_Load Event to bind datasouce to grid,
if (!Page.IsPostBack)
          {
              MembershipUserCollection uc = Membership.GetAllUsers();
              RadGrid1.DataSource = uc;
              RadGrid1.DataBind();
               
          }

Then while running code, when I select filter the grid goes blank.  I understnad that on postback DataSource is lost, so
1. Is there a filter event where i can assing DataSource back to grid.
2. I would prefer, if there is a way to do filter at client-side itself.

Regards

Princy
Top achievements
Rank 2
 answered on 18 Aug 2011
1 answer
437 views
Hi, I have a RadTab, and a Multipage that are generated Dinamically. When I call the function, GeneraInfoGeneral for the firs time works fine, but when another control sets the RadTab to visible=false; and the RadMultipage to visible=false, it only persists the pageView (visible), if I dont change between tabs.

When I first click on btnInfoGral it works fine, but after I click btnServidorPublico and I clear tabs and clear pageViews, the pageview does not load until I click another tab. Im trying to set RadTab visible and invisible as its Multipage and pagesviews too.


<telerik:RadTabStrip ID="RadTabInfoGral" runat="server"
                                       MultiPageID="RadMultiPage1" OnTabClick="RadTabInfoGral_TabClick"
                                       Orientation="HorizontalBottom" Skin="Default"
                                       Visible="False" OnClientTabSelecting="onTabSelecting" SelectedIndex="0" OnClientTabUnSelected="OnClientTabUnSelected"
                                          Align="Right">
                                   </telerik:RadTabStrip>
                               
                            
                           <%--<telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0"
                                    Width="100%" OnTabClick="RadTabStrip1_TabClick" >
                               <tabs>
                                   <telerik:RadTab runat="server" Selected="True" Text="Root RadTab1">
                                   </telerik:RadTab>
                                   <telerik:RadTab runat="server" Text="Root RadTab2">
                                   </telerik:RadTab>
                               </tabs>
                           </telerik:RadTabStrip>--%>
                           <telerik:RadMultiPage
                           ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated"
                                    Width="100%" ScrollBars="Vertical" Height="430px" Visible="False" >
          </telerik:RadMultiPage>


private void AddTab(string tabName)
  {
      RadTab tab = new RadTab();
      tab.Text = tabName;
      tab.SelectedImageUrl = "~/App_Themes/img/Informacion.gif";
      RadTabInfoGral.Tabs.Add(tab);
  }
 
  private void AddPageView(RadTab tab)
  {
 
 
      //BARRO cada lista de controles, y cuando coincide el nombre de la pestaña con el de la lista
      //me salgo del foreach, y le asigno al pageView.ID, el nombre que en la base de datos coincide con fcFileControlId,
      //se cargó previamente en la inicialización de controles.
      foreach (string[] list in (List<string[]>)ViewState["listControlesID"])
      {
          if (list[0].Equals(tab.Text))
          {
              RadPageView pageView = new RadPageView();
              pageView.ID = list[1];
              RadMultiPage1.PageViews.Add(pageView);
              tab.PageViewID = pageView.ID;
              break;
          }
      }
 
  }
 
  protected void RadTabInfoGral_TabClick(object sender, RadTabStripEventArgs e)
  {
      AddPageView(e.Tab);
      e.Tab.PageView.Selected = true;
   }
 
  protected  void GeneraInfoGeneral()
  {
      //SI LE DAN CLICK EN EL BOTON DE INFORGRAL POR SEGUNDA VEZ MIENSTRAS ESTÉ MOSTRANDO
      if (!RadTabInfoGral.Visible)
      {
          RadTabInfoGral.Visible = true;
          //RadTabInfoGral.SelectedIndex = -1;
          PanelServidor.Visible = false;
 
          foreach (string[] StringArray in (List<string[]>)ViewState["listNombresPestañas"])
          {
              AddTab(StringArray[2]);
          }
 
          RadMultiPage1.Visible = true;
          AddPageView(RadTabInfoGral.Tabs[0]);
 
 
      }
      
  }
 
 
 
  protected void anyImageButton_Click(object sender, ImageClickEventArgs e)
  {
      switch (((ImageButton)sender).ID)
      {
          case "btnServidorPublico":
              PanelServidor.Visible = true;
              RadTabInfoGral.Visible = false;
              RadMultiPage1.Visible = false;
              RadTabInfoGral.Tabs.Clear();
              RadMultiPage1.PageViews.Clear();
               
              
              break;
 
          case "btnInfoGral":
              GeneraInfoGeneral();
               
               
              
 
              break;
 
          default:
              break;
      }
 
  }
 

protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e)
   {
       string userControlName = "~/Controles/InformacionGeneral/" + e.PageView.ID + "CS.ascx";
       string URL = string.Empty;
       string jScript = " function Muestra_div(x) {" +
                        " if (document.getElementById(x).style.display == 'none')" +
                               " { document.getElementById(x).style.display = 'block';  window.location.hash='#Link'+x;}" +
                        " else " +
                               " document.getElementById(x).style.display = 'none';}" +
 
                        "function Oculta_Divs(ar){" +
                               "for (i=0;i<ar.length;i++){" +
                                 " document.getElementById(ar[i]).style.display = 'none';}" +
                                 "}";
                        
 
       //string sUrlImagenFondo = string.Empty;
       Control userControl = Page.LoadControl(userControlName);
       userControl.ID = e.PageView.ID + "_userControl";
       cDevuelveDatos devuelveDatos = new cDevuelveDatos();
       devuelveDatos.UrlHTML((List<string[]>)ViewState["listArraytotal"], (List<string[]>)ViewState["listSubRubros"], e.PageView.ID);
 
       Literal literal1 = new Literal();
       literal1.ID = "Literal1";
       literal1.Text = devuelveDatos.sCadenaInformacion(Request.Url.Scheme + "://" + Request.Url.Host + Request.ApplicationPath,
                                                           Server.HtmlEncode(Request.PhysicalApplicationPath),e.PageView.ID);
 
       ScriptManager.RegisterStartupScript(userControl.Page, userControl.Page.GetType(),"Key", jScript, true);
       //literal1.Text += "<a href=\"#\" onclick=\"Muestra_div('"+e.PageView.ID+"DivPrincipal')\">dd</a>";
       userControl.Controls.Add(literal1);
       //((Literal)userControl.FindControl("literal01")).Text = literal1.Text;
       e.PageView.Controls.Add(userControl);
   }
RICARDO
Top achievements
Rank 1
 answered on 18 Aug 2011
3 answers
66 views
Whenever we change the display resolution and refresh the screen the grid seemlessly fits the entire screen. But if the resolution is changed to 1680 x 1050 it is not happening!

Any workaround possible?!

Thank you

Regards
Raj
Daniel
Telerik team
 answered on 17 Aug 2011
0 answers
55 views
I removed the dock icon with the EnableDock property set to false.

1. How can I disable the close icon?
2. how can I set the height of the slider that expands to be exactly large enough to fit the content that is there.   The content is dynamic so it won't be the same each time so I can't set a fixed height.
S
Top achievements
Rank 1
 asked on 17 Aug 2011
2 answers
148 views
Masters and Experts,
I would like to implement a workflow form using the PanelBar control. I wanted to check here and see if it's possible before I put the development effort into it. What I would like to accomplish is creating a user control that would display in a RadWindow that will function as follows;
Panel1:
  User Selected Search Criteria
  Search / Move Next button (if results were found, If not message user)
Panel2
  RadGrid containing the results from the Search from Panel1. User would select the record they need for primer data for their new entry on Panel3
  Move Next Button
Panel3
  ReadOnly data items from Panel2s selection and editable user entry data fields
  Save Button

If it's possible for the control to handle that type of data manipulation would you know of any samples I could review as reference.

Thanks,
Tim
Tim
Top achievements
Rank 2
 answered on 17 Aug 2011
3 answers
112 views
Hi, I have three ComboBox in my webform which are used to for country, district and area for a user when they register in my site. 2nd ComboBox is populated when first one is selected and 3rd one when 2nd is selected. I have successfully databind these 3 from database. but after registering, if a user want to edit their data I want to pre-select all three ComboBoxes with the value which they select when registering at page load. I cannot find any idea how to do this... Can anyone please help me??
Ratul
Top achievements
Rank 1
 answered on 17 Aug 2011
5 answers
117 views
I have the following in the CommandItemTemplate tag:

 

<

 

CommandItemTemplate>

 

 

    <table width="100%">

 

 

        <tr>

 

 

            <td align="left">Third Party Mismatches</td>

 

 

            <td align="right">

 

 

                <asp:LinkButton ID="showFilter" runat="server" CommandName="DisplayFilter"

 

 

                    Text="Filter">

 

 

                </asp:LinkButton>

 

 

            </td>

 

 

        </tr>

 

 

    </table>

 

</

 

CommandItemTemplate>

 

 

 

 

 

 

 

 

 

What i want to do is when the user clicks on the showFilter link it will display or hide the folter depending on if it is shown already or not. I have that part working. What I can't get is to change the text to "Show Filter" if the filter is hidden and "Hide Filter" if it is shown.
I have the followinfg code but it isn't working.
Protected Sub GrdThirdParty_ItemCommand(ByVal source As Object, _  
                         ByVal e As GridCommandEventArgs) _  
                         Handles GrdThirdParty.ItemCommand  
 
        If e.CommandName = "DisplayFilter" Then 
            Dim lnkButton As LinkButton = CType(e.Item.FindControl("showFilter"), LinkButton)  
            If GrdThirdParty.AllowFilteringByColumn = False Then 
                GrdThirdParty.AllowFilteringByColumn = True 
                lnkButton.Text = "Hide Filter"  
            Else 
                GrdThirdParty.AllowFilteringByColumn = False 
                lnkButton.Text = "Show Filter" 
            End If 
            GrdThirdParty.MasterTableView.Rebind()  
        End If 
 
    End Sub 
Any ideas?
Thanks for the help.

Matt DiPietro
Top achievements
Rank 1
 answered on 17 Aug 2011
4 answers
447 views
Hi:
I have masterpage with a RadScriptManager and a asp:panel (panel used for messages).  In my one of my content pages, I have a RadAjaxPanel.  In my code behind, I am updating the panel pnlErrors.  Sometime the changes to pnlErrors does not display.  Any suggestions?

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="masterPageRadScriptManager" runat="server" AsyncPostBackTimeout="180" >
        <Scripts>
            <asp:ScriptReference Path="Scripts/jquery-1.4.1.js" />
        </Scripts>
    </telerik:RadScriptManager>
    ...
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" />
    <telerik:RadMenu ID="RadMenu1" Runat="server" DataSourceID="SiteMapDataSource1" Width="100%" style="z-index:2900">
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </telerik:RadMenu>
    ...
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
 
    </asp:ContentPlaceHolder>
    <asp:Panel ID="pnlErrors" runat="server" EnableViewState="false">
    </asp:Panel>
    </form>
    ...
</body>
</html>

Phil
Phil
Top achievements
Rank 2
 answered on 17 Aug 2011
3 answers
317 views
Hi,

Here is our scenario. We have a screen where users need to add their comment in a text editor. What we would like to achieve is that the color is fixed based on the user role.
We have tried the following code but without any luck:

RadEditor tbOpmerkingen = editedItem.FindControl("tbOpmerkingen") as RadEditor;
            tbOpmerkingen.ForeColor = System.Drawing.Color.Blue;

and 

tbOpmerkingen.ContentAreaCssFile = "~/App_Themes/easecc/Test.css";

css looks like
.RadEContent
{
color: Blue !important;
}

and 

Literal styleSheet = (Literal)this.Master.FindControl("styleSheet");
 styleSheet.Text = ".RadEContent{color: Blue !important;}";

with in the masterpage header section

    <style>
       <asp:Literal id="styleSheet" runat="server"></asp:Literal>
   </style>

Any help on this issue is appreciated.
Ron
Gimmik
Top achievements
Rank 1
 answered on 17 Aug 2011
3 answers
75 views
I am working on several pages that have Rad controls.  When I run these pages in the Visual Studio debugger and my server-side code throws an exception, it always shows up as if it is a Javascript exception.  (See the attached screenshot).  I believe this happens whenever I have a RadAjaxPanel on the page.

This means it takes me a very long time to track down the source of the exception.  Since I don't get to see the standard ASP.Net exception message, I don't get to see the file name and line number of where the exception was thrown.

Is there any way to disable this behavior, and show the standard ASP.Net exception message instead?
Jayd
Top achievements
Rank 1
 answered on 17 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?