Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
I am working on a pure Telerik site based on the Webmail demo (http://demos.telerik.com/aspnet-ajax/webmail/).  I have however noticed that almost none of the page content is rendered on the page if JavaScript is disabled in the browser.

Referring to the Webmail demo code, what is needed to make some content visible even if it is only possible to render a "noscript" element with a message to the user?

Thanks,
Ray
Sebastian
Telerik team
 answered on 09 Mar 2011
4 answers
216 views
I've created a nesting grid and filtering works at the top level but if I allow filtering by column on the detailed table I get the enclosed GridTableView control " does not have a naming container. I have no code behind, just all in the aspx
I guess I'm missing something? Any help much appreciated. Many thanks. Steve
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
  
<%@ 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 runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:EnterpriseDevConnectionString2 %>" 
        SelectCommand="SELECT [Ref], [LineNum], [SKU], [Qty], [ActualQty], [ExportedQty], [Exported] FROM [InboundGoodsLines] WHERE ([Ref] = @Ref)">
        <SelectParameters>
            <asp:ControlParameter ControlID="RadGrid2" DefaultValue="Ref" Name="Ref" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:EnterpriseDevConnectionString2 %>" 
        SelectCommand="SELECT [Ref], [Vendor], [SupplyingSite], [ActualDate], [AuthorisedBy] FROM [InboundGoods]">
    </asp:SqlDataSource>
<telerik:RadGrid ID="RadGrid2" runat="server"   DataSourceID="SqlDataSource2" AllowFilteringByColumn="true"  >
 <MasterTableView
     DataKeyNames="Ref" AllowFilteringByColumn="true"
     DataSourceID="SqlDataSource2"
     TableLayout="Auto"
     PageSize="1">
   <DetailTables>
     <telerik:GridTableView
         runat="server"
         DataKeyNames="Ref"
         DataSourceID="SqlDataSource1"  >
       <ParentTableRelation>
         <telerik:GridRelationFields
           DetailKeyField="Ref"
           MasterKeyField="Ref" />
       </ParentTableRelation>
     </telerik:GridTableView>
   </DetailTables>
 </MasterTableView>
</telerik:RadGrid> 
  
  
    </form>
</body>
</html>
Martin
Telerik team
 answered on 09 Mar 2011
1 answer
87 views
Hello ,

I am working in a web application .. I am using RadTabStrip and RadMultiPage .. I added my controls to the RadMultiPage and added  all controls to RadAjaxManager like this

uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadTabCompany);        uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadCompPages);

 Inside one of  the pageviews I put an asp FileUpload control

<tr>
                
                <td valign="top" align="left" class="smallnormal">
                Person Photo
                </td>
                <td valign="top" align="left" class="smallnormal">
                
                
                <asp:FileUpload ID="uxFileUpload" runat="server" onclick="CheckThat_Click" CssClass="smallnormal"/>
 
                <asp:Button ID="buttonUpload" runat="server" Text="Upload" CssClass="homebtn"   
                style="width:70px;" onclick="CheckThat_Click" />
                
                
                <asp:TextBox ID="uxTxtPicName" runat="server" Width="200px"></asp:TextBox>
                </td>
                
                </tr>

in cs file

protected void CheckThat_Click(object sender, EventArgs e)
    {
         
        string mstr = uxFileUpload.FileName;
    }

The problem is uxFileUpload.FileName is always nothing  if controls are added to the radajaxmanager

I traced the problem
When I comment lines that adding all controls to the RadAjaxManager like
//uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadTabCompany);        //uxRadAjaxManager.AjaxSettings.AddAjaxSetting(uxBtnSearchFor, uxRadCompPages);

of course it does full postback and I can read the filename of the fileupload control without any problem
when I re add the controls to the RadAjaxManager I always find the FileName is nothing

I need to read the filename of the fileupload to insert it into the database in special field (person photo) then I can upload it to the server to be displayed correctly when someone choose this person

I do not know what the problem
I have to add the fileupload to the radajaxmanager ??


what you advise me to do to solve the problem in this scenario ??
Maria Ilieva
Telerik team
 answered on 09 Mar 2011
1 answer
50 views
Hi,

I'm using some cascading combo boxes and normally they work just fine using the standard mechanism of using onclientselectedindexchanging and onitemsrequested.  On a couple of pages however I am finding that whilst they again work fine normally if I change a parent value - causing the children to reset to their initial unset states - then on postback the children have their SelectedValues set as empty.  The parent combo shows the selectedvalue as the new value.  Also the children all show the Text as the newly selected item.  

Also if I do some client js before the post back I can see the value is set correctly (using get_value() on the combo box).

I've stripped the code right down to the bare minimum and it just doesn't make any sense why one page works fine but another one doesn't.  Any pointers as to why this might be happening?

Regards,

Jon
Dimitar Terziev
Telerik team
 answered on 09 Mar 2011
1 answer
82 views
Hi all,

I am wanting to utilise the export to excel functionality of the rad grid, without actually displaying a grid.
Can this all be done in memory, without actually physically having a control on a page? The reason being,
the data i am displaying (summarised) and the data i want to export are very different.

There are some basic ways of exporting to excel for sure, but i figure leveraging the rad grid implementation will be more robust than something i can cobble together in a couple of hours.

Is what i am thinking even possible?

I would welcome any insight?

As a starting point, i was kind of thinking along the line of the code below.

//definately incomplete!!!
public void btnExport(object sender, eventargs e)
{

     RadGrid grid = new RadGrid();

     grid.AutoGenerateColumns = true;

     grid.ExportSettings.ExportOnlyData = true;
     grid.ExportSettings.IgnorePaging = true;

    grid.ExportSettings.OpenInNewWindow = true;
    grid.DataSource = myCollection;

     grid.DataBind();

     grid.MasterTableView.ExportToExcel();
}


Or am i just over complicating this?!

Thanks.

  

Daniel
Telerik team
 answered on 09 Mar 2011
3 answers
151 views
Hi,

    I'm using GridImageColumn in to display a icon if the value in the table is false.

Please find the aspx code below.

<

 

Telerik:RadGrid ID="TelerikThread" Width="97%" AllowSorting="True" PageSize="15"

 

 

 

OnItemDataBound="TelerikThread_ItemDataBound" AllowPaging="True"

 

 

 

AllowMultiRowSelection="True" runat="server" Gridlines="None">

 

 

<MasterTableView Width="100%" Summary="RadGrid table" AutoGenerateColumns="false" >

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

<Columns>

 

 

<Telerik:GridImageColumn UniqueName="GridImageColumn" SortExpression="HasRead"

 

 

 

HeaderText="Unread" DataImageUrlFields="HasRead">

 

 

</Telerik:GridImageColumn>

 


Please find the aspx.cs code below

 

protected void TelerikThread_ItemDataBound(object sender, GridItemEventArgs e)

 

 

{

 

 

if (e.Item is GridDataItem)

 

 

{

 

 

GridDataItem item = (GridDataItem)e.Item.DataItem;

 

 

 

TableCell flag = (TableCell)item["HasRead"];

 

 

 

if (flag.Text == "false")

 

 

{

 

System.Web.UI.WebControls.

Image img = (System.Web.UI.WebControls.Image)item["GridImageColumn"].Controls[0];

 

 

img.ImageUrl =

"./web/Themes/default/imges/post_status_new_ln.gif";//set image url

 

}

 

else

 

{

 

TableCell cell = (TableCell)item["GridImageColumn"];

 

 

cell.Text =

" ";//clears image column

 

}

}

}


Exception is thrown in this line

 

 

GridDataItem

 

item = (GridDataItem)e.Item.DataItem;

 

 

 


Help me with the solution

 

 

 

Tsvetina
Telerik team
 answered on 09 Mar 2011
2 answers
80 views
Hello,

I need to create my own custom appointment classes that derive from the AppointmentBase class.
What should be the using intruction to use AppointmentBase ? (using Telerik.Web.UI doesn't work)

Thanks,

Steph
Stephane
Top achievements
Rank 1
 answered on 09 Mar 2011
7 answers
213 views
Hi Telerik,

Currently I have this:

protected void RadDock_Command(object sender, DockCommandEventArgs e)
{
    switch (e.Command.Name)
    {
        case "Settings":
            RadAjaxManager1.ResponseScripts.Add("openRadWindow(\"RadDockSettings.aspx\", \"400\", \"400\")");
            break;
    }
  }
<script type="text/javascript">
    function openRadWindow(args, width, height) {
        var oWnd = radopen(args, "RadWindow1");
        oWnd.setSize(width, height);
        oWnd.center();
        oWnd.add_close(OnClientClose);
    }
 
    function OnClientClose(oWnd) {
        window.location.reload();
    }
 
    function GetRadWindow() {
        var oWindow = null;
 
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
        return oWindow;
    }
 
    function returnToParent() {
        var oWnd = GetRadWindow();
        oWnd.close();
    }
 
</script>

This code is causing me a couple of issues:

1) The RadWindow reopens every time the page reloads -- I need to remove the ResponseScript somewhere, but where?
2) Flickering - The entire page reloads when the RadWindow is closed. I would like to just pass some information back to the page without the entire page reloading.

What's best practice for these? I've seen examples on how to open RadWindow client-side, but not through a CustomCommand click.

Thanks
Pero
Telerik team
 answered on 09 Mar 2011
1 answer
244 views
Hi

I am using the following code to select checkbox of a radgrid, but it's not working:

foreach (GridDataItem grdItem in grv_Person.Items)
            {
                if (grdItem.Cells[person_id_Column].Text == person_id)
                {
                    ((CheckBox)grdItem.Cells[2].Controls[0]).Checked = true;
                    grdItem.Selected = true;
                }
            }

I can confirm this is the last thing I do in prerender event. The grid check box just doesn't get selected

Thanks
Princy
Top achievements
Rank 2
 answered on 09 Mar 2011
1 answer
103 views
Hi,

Grouping is a great feature with rad grid! thank you!
But alignment and customizing is not very versatile.Atleast I'm finding it little round about,probly I am still a little new here.
OK,
I've used group expressions for groping data in rad grid and achieved styling and alignment to my satisfaction using itemdatabound and prerender event handler where I set the visibility of groupheader datacell to false and add the cells with required data for each column aligning the column and group header data.

So far so good,ut my problem is when I hit expand/collapse the group header datacell is blown off and my custon cell are not rendered,so I hav a blank row with expand and collapse,so I need to rebind the grid to get back the group header.

Now my thinking is if I know what event is fired when the expand/collapse is hit then I can render the group header(unfortunately when I tried the prerender event handler,I think I missed something or its the wrong event-please advise) .Please can you through some light,it feels like I'm close yet not that close-kind of stuck need this done soon-client pressure.

Thank you.
Princy
Top achievements
Rank 2
 answered on 09 Mar 2011
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?