Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
147 views
I've been developing a web app that uses RadGrid FormTemplate popups for editing.  I have a grid with header and detail forms.  On each of those is a validation summary, perhaps the first control I put on it. 

I recently noticed that when the summary fired, it displayed with the bullets on the left hanging outside the template itself.  I just don't remember a ValidationSummary ever doing this before, anywhere.  I can't recall doing anything to the grid or the controls that would affect alignment in such a manner.  

The fix was to put it inside a div.   <div  style="width:90%;margin-left:auto;margin-right:auto"></div>

This works fine but I'd like to know where the problem came from in the first place.

Angel Petrov
Telerik team
 answered on 30 Jan 2013
2 answers
276 views
Hi all,

I have a problem with IIS7 and the web.config of an "Admin" subdirectory, since it does not appear radupload and I can not write in radeditor. The rest of my app it's works fine...

This is my web.config in the root of my application:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appSettings>
    <add key="rutaImagenes" value="\Admin\Images\" />
  </appSettings>
  <connectionStrings>
    <add name="MyAppConnectionString" connectionString="My connectionstring thats works fine..." />
  </connectionStrings>
  <system.web>
     
    <compilation debug="true" strict="false" explicit="true">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
     
    <roleManager enabled="true">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider" connectionStringName="MyAppConnectionString" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      </providers>
    </roleManager>
    <membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider" />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider,       System.Web, Version=2.0.0.0, Culture=neutral,       PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="MyAppConnectionString" applicationName="/" requiresUniqueEmail="false" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" requiresQuestionAndAnswer="false" />
      </providers>
    </membership>
    <profile enabled="false" />
    <authentication mode="Forms">
      <forms name="MyApp.ASPXAUTH" loginUrl="Admin/Login.aspx" protection="All" path="/" />
    </authentication>
     
    <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
      <error statusCode="403" redirect="NoAccess.htm" />
      <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <namespaces>
        <clear />
        <add namespace="System" />
        <add namespace="System.Collections" />
        <add namespace="System.Collections.Generic" />
        <add namespace="System.Collections.Specialized" />
        <add namespace="System.Configuration" />
        <add namespace="System.Text" />
        <add namespace="System.Text.RegularExpressions" />
        <add namespace="System.Linq" />
        <add namespace="System.Xml.Linq" />
        <add namespace="System.Web" />
        <add namespace="System.Web.Caching" />
        <add namespace="System.Web.SessionState" />
        <add namespace="System.Web.Security" />
        <add namespace="System.Web.Profile" />
        <add namespace="System.Web.UI" />
        <add namespace="System.Web.UI.WebControls" />
        <add namespace="System.Web.UI.WebControls.WebParts" />
        <add namespace="System.Web.UI.HtmlControls" />
      </namespaces>
      <controls>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
      </controls>
    </pages>
     
    <httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
    </httpHandlers>
    <httpModules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
    </httpModules>
    <identity impersonate="false" />
  </system.web>
  <location path="Admin">
    <system.web>
      <authorization>
        <allow roles="Administrators" />
        <deny users="*" />
      </authorization>
      <!--<trust level="Full" />-->
    </system.web>
  </location>
  <location path="Admin/services">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
   
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="RadUploadModule" />
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,                    System.Web.Routing, Version=3.5.0.0,                    Culture=neutral,                    PublicKeyToken=31BF3856AD364E35" />
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode,runtimeVersionv2.0" />
    </modules>
  </system.webServer>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyApp.MyAppDataServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="MyApp.MyAppDataServiceBehavior" name="MyApp.MyAppDataService">
        <endpoint address="" binding="basicHttpBinding" contract="MyApp.IMyAppDataService">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  </system.serviceModel>
</configuration>

And this is the web.config in "Admin" subdirectory:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <defaultDocument>
      <files>
        <add value="AdminDef.aspx" />
      </files>
    </defaultDocument>
    <handlers>
      <add name="Telerik.Web.UI.WebResource.axd*" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" />
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" />
      <add name="Telerik.RadUploadProgressHandler.ashx_*" path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler" />
    </handlers>
  </system.webServer>
</configuration>

Anyone can help me?

Thank you!
Isteci
Top achievements
Rank 1
 answered on 30 Jan 2013
4 answers
122 views
I realize it's more of a general asp.net challenge, however...

In a GridTemplateColumn I have a placeholder to which I add one or several imagebuttons. So far so good. My trouble is how to add click handlers to each of these dynamically created imagebuttons? Preferably, I'd would like to handle the click event as I do with imagebuttons added declaratively (in the grid ItemCommand handler)

Any Ideas?
Alain
Top achievements
Rank 1
 answered on 30 Jan 2013
1 answer
66 views
Hey,

I'm currently using RadGrid and I am very happy about it.
There's one thing I can't achieve, though.

I have a two-level hierarchy, with - say - Categories and SubCategories.
I have a GridButtonColumn which serves as a Delete button on the Categories level.

This button must be hidden if a Category has at least one SubCategory. On the initial load of the page, I successfully hide the Delete button, hooking in the ItemDataBound event.
Now let's say I remove all the SubCategories of a Category, the Delete button won't appear. I have to refresh (i.e. Rebind) the grid to make it appear again.

Do you know a way of doing it?
Thanks in advance,
Mickaël
Mickaël
Top achievements
Rank 1
 answered on 30 Jan 2013
3 answers
188 views



I'm testing RADRadialGauge for ASP NET AJAX. It shows up corrcetly on I.E 8 and I.E. 9 but not on I.E. 7. Please check the attached files.
Any sugesstions on how to get it fixed on I.E 7.

Thanks,
Ambreen
Danail Vasilev
Telerik team
 answered on 30 Jan 2013
3 answers
231 views

This was working and somehow I broke it without knowing it.  I populate a grid from the database.  In the code behind I select some of the  Items in the grid (I have a checkbox in the grid item).  Should be easy.

However when I try to loop through the items in the table the count on the MasterTableView.Items is 0.  But when the page displayed the grid has items.

Here's the code (I removed some non-essential pieces):





Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    If Not IsPostBack Then      
        BindScans(Session("ClientID"))
        Dim ScanGroupID As String = Request("ScanGroupID") & ""
 
        If ScanGroupID <> "" Then LoadScanGroup(ScanGroupID)
    End If
 
End Sub
 
Sub BindScans(ByVal ClientID As String)
 
    Dim sqlConn As SqlConnection = New SqlConnection(Session("SCAN_CONN"))
    Dim SQL As String = "Select *  From nxp_sites SITES  WHERE ....."
    Dim adapter As SqlDataAdapter = New SqlDataAdapter(SQL, sqlConn)
    Dim dt As DataTable = New DataTable
 
    adapter.Fill(dt)
    rgScans.DataSource = dt
 
End Sub
 
Sub LoadScanGroup(ByVal ScanGroupID As String)
 
    Dim oScanGroup As clsScanGroup = New clsScanGroup(ScanGroupID)
    If Not oScanGroup.HasError Then
 
        Dim dt As DataTable = oScanGroup.GetScans()
        SelectScanGroupItems(dt)
 
    End If
 
End Sub
 
Sub SelectScanGroupItems(ByVal dt As DataTable)
 
    If dt.Rows.Count > 0 Then
        For Each dr As DataRow In dt.Rows
 
            'At this point rgscan.MasterTableView.Items count is 0, why?
            For Each gdi As GridDataItem In rgScans.MasterTableView.Items
                If gdi("scan_id").Text = dr("ScanID") And gdi("site_id").Text = dr("SiteID") Then
                    Dim chk As CheckBox = DirectCast(gdi("CheckboxSelectColumn").Controls(0), CheckBox)                    
                    gdi.Selected = True
                End If
            Next
        Next
    End If
 
End Sub
And the ASPX:

<telerik:RadGrid ID="rgScans" runat="server" ShowGroupPanel="False" AllowPaging="true"
    Width="700" AllowMultiRowSelection="true" PageSize="25"
    Skin="Office2010Silver" AllowSorting="true"
    AutoGenerateColumns="false" OnNeedDataSource="rgScans_NeedDataSource" >
 
    <MasterTableView AutoGenerateColumns="false" DataKeyNames="site_id"           
                             InsertItemPageIndexAction="ShowItemOnCurrentPage">
        <Columns>
            <telerik:GridClientSelectColumn UniqueName="CheckboxSelectColumn" HeaderStyle-HorizontalAlign="Center"
                ItemStyle-HorizontalAlign="Center" FooterText="CheckBoxSelect footer" ItemStyle-Width="40px"
                HeaderStyle-Width="40px">
            </telerik:GridClientSelectColumn>
            <telerik:GridTemplateColumn HeaderText="Current" ItemStyle-HorizontalAlign="Center"
                ItemStyle-Width="40px" HeaderStyle-Width="40px">
                <ItemTemplate>
                    <asp:image imageurl='<%# GetCurrentScan(Eval("site_id"))%>' runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="site_name" ItemStyle-Width="250px" HeaderStyle-Width="250px"
                FilterControlAltText="Filter ScanGroupName column" HeaderText="Scan Name" AllowFiltering="false"
                SortExpression="ScanGroupName" UniqueName="ScanGroupName" AllowSorting="true" />
            <telerik:GridBoundColumn DataField="start_time" HeaderText="Scan Date/Time"
                DataFormatString="{0:MM/dd/yyyy}"
                FilterControlAltText="Filter start_time column" AllowFiltering="false" SortExpression="start_time"
                UniqueName="start_time" AllowSorting="true" />
            <telerik:GridBoundColumn DataField="live_hosts" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                FilterControlAltText="Filter ScanGroupName column" HeaderText="Live Hosts" AllowFiltering="false"
                SortExpression="live_hosts" UniqueName="live_hosts" AllowSorting="true" />
            <telerik:GridBoundColumn DataField="site_id" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                FilterControlAltText="Filter ScanGroupName column" HeaderText="Site ID" Visible="false"
                AllowFiltering="false" SortExpression="site_id" UniqueName="site_id" AllowSorting="true" />
            <telerik:GridBoundColumn DataField="scan_id" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                FilterControlAltText="Filter scan_id column" HeaderText="Scan ID" Visible="false"
                AllowFiltering="false" SortExpression="scan_id" UniqueName="scan_id" AllowSorting="true" />
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true"></Selecting>
    </ClientSettings>
</telerik:RadGrid>

Thank you in advance on this.
Hunter
Top achievements
Rank 1
 answered on 30 Jan 2013
3 answers
162 views
We're going to be using the RadEditor in our project.  We're going to need to parse the HTML content when the page is submitted in order to :

(1)Retrieve any images used in the HTML and store them in our database
(2)Retrieve custom tag-holders and replace with server-side criteria

Does anyone have any recommendations on the best way to do this?

Thanks
Rumen
Telerik team
 answered on 30 Jan 2013
1 answer
92 views
Hi everyone,

I would like to know why the grid takes at least 3 times longer to load in IE compared to Chrome and Firefox.

Is there an explanation to that?

Thanks a lot,

Max
Jayesh Goyani
Top achievements
Rank 2
 answered on 30 Jan 2013
1 answer
101 views
I'm having an issue where the grid is not displaying the Ship sub total (see attachment).

How can I get the Ship Total to display the total for the Ship instead of the "{0:C}" literal?

How can I also get rid of the SORT bar (see attachement).
I don't have any code behind to handle this and I don't need to.

Here is some pertinent code that I have the way the grid is set up....
<telerik:RadGrid ID="RadGrid1" runat="server"
                        PageSize="20" AllowSorting="True" AllowPaging="True" ShowGroupPanel="True"
                        OnColumnCreated="RadGrid1_ColumnCreated">
                        <PagerStyle Mode="NumericPages"></PagerStyle>
                        <MasterTableView Width="100%">
                        </MasterTableView>
                        <ClientSettings>
                            <Resizing AllowColumnResize="True"></Resizing>
                        </ClientSettings>
                    </telerik:RadGrid>

protected void Button1_Click(object sender, EventArgs e)
{
    string groupBY = "CruiseLine [CruiseLine], Sum(Sales) GroupTotal [CruiseLine Total] Group By CruiseLine";
    group(groupBY);
}
 
protected void Button2_Click(object sender, EventArgs e)
{
    string groupBY = "Ship [Ship], Sum(Sales) GroupTotal [Ship Total] Group By Ship";
    group(groupBY);
}
 
protected void Button3_Click(object sender, EventArgs e)
{
    string groupBY = "Date [Date], Sum(Sales) GroupTotal [Date Total] Group By Date";
    group(groupBY);
}

protected void group(string groupBY)
    {
        try
        {
            GridGroupByExpression expression1 = GridGroupByExpression.Parse(groupBY);
            this.CustomizeExpression(expression1);
            this.RadGrid1.MasterTableView.GroupByExpressions.Add(expression1);
        }
        catch (Exception ex)
        {
            lblError.Text = string.Format("<span style='color:red'>Cannot add group by expression: {0}</span>", ex.Message);
            lblError.Visible = true;
        }
        finally
        {
            BindData();
        }
    }

protected void BindData()
    {
        Hashtable htParams = new Hashtable();
        htParams.Add("@CruiseLine", ViewState["prmCruiseLine"]);
        htParams.Add("@Ship", ViewState["prmShip"]);
        htParams.Add("@FromDate", FromDate.SelectedDate.Value.ToShortDateString());
        htParams.Add("@ToDate", ToDate.SelectedDate.Value.ToShortDateString());
 
        // Call SPROC to populate grid
        DataUtiliities data = new DataUtiliities("PrepaidConnectionString");
        DataSet dsRpt = data.ExecuteDataSet("SelectProductInfoByShipAndDate2", htParams);
 
        // Bind the Grid
        RadGrid1.DataSource = dsRpt.Tables[0].DefaultView;
        RadGrid1.DataBind();
    }

Here is the output of the groups during debugging:
groupBY = "CruiseLine [CruiseLine], Sum(Sales) GroupTotal [CruiseLine Total] Group By CruiseLine"
expression1 = {CruiseLine , sum(Sales) GroupTotal Group By CruiseLine}
 
groupBY = "Ship [Ship], Sum(Sales) GroupTotal [Ship Total] Group By Ship"
expression1 = {Ship , sum(Sales) GroupTotal Group By Ship}
Maria Ilieva
Telerik team
 answered on 30 Jan 2013
2 answers
112 views
Hi everyone,

In this other question of mine, I am facing a different problem than the previous one.

I currently have a grid, inside a radtabstrip inside a grid. In order to makes this easier, here is the name of the items.

Parent grid : grdChauffeurs
Tabstrip : RadTabStrip2
Inner grid : grdOrdre

Here is what I would like to achieve.

When I drop a row in grdDriver, I want the row to be added in the grid grdOrdre.

In my rowdrop event I have the following code :

Protected Sub grdListeCommande_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles grdListeCommande.RowDrop
            Dim RowDragged As GridDataItem
            Dim RowIndexDestin As Integer
            Dim intChfNRI As Integer
            Dim intAtcNRI As Integer
            Dim tabstrip As RadTabStrip
            Dim grille As RadGrid = Nothing
 
            For Each item As GridNestedViewItem In grdChauffeurs.MasterTableView.GetItems(GridItemType.NestedView)
                tabstrip = item.FindControl("RadTabStrip2")
                grille = tabstrip.MultiPage.FindControl("grdOrdre")
            Next
 
            RowDragged = e.DraggedItems.FirstOrDefault()
 
            If (e.DestDataItem IsNot Nothing) Then
                If (e.DestDataItem.OwnerGridID = grdChauffeurs.ClientID) Then
                    Me.RowIndex = e.DestDataItem.ItemIndex
 
                    intAtcNRI = CInt(RowDragged("ATCNRI").Text)
                    intChfNRI = Me.DataTableChauffeur.Rows(Me.RowIndex).Item("NRI")
                End If
 
                Select Case False
                    Case intChfNRI <> Nothing
                    Case intAtcNRI <> Nothing
                    Case pfblnGetRoadSheet(intChfNRI, intAtcNRI)
                    Case Else
                        e.DestDataItem.Expanded = False
                        e.DestDataItem.Expanded = True
                        grille.DataSource = Me.DataTableMouvement
                End Select
                
            End If
        End Sub

I am a new developper and I'm a bit confused with how all the hierarchy works in the radgrid.

Thank you in advance for you most appreciated help

Max
Maxime
Top achievements
Rank 1
 answered on 30 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?