Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
274 views
Hi..
I have a menu which is 1000px wide... it has 4 menu items..
How can I evenly space them across the menu... so they take up the entire length of the menu... thanks

|           Item 1                  |            Item  2                        |              MenuItem3               |                MenuOption                        
Cori
Top achievements
Rank 2
 answered on 22 Oct 2010
10 answers
262 views
I'm working on modifying the Advanced Template and I need to put some extra buttons in the submit area. One of the buttons is actually a CustomControl based around an asp:Button so I can't use a LinkButton like the Advanced Form does.

In addition, all of my pages are based on a MasterPage that has a FormDecorator on it so I figured I could replace the LinkButtons with regular Buttons and the FormDecorator would make sure that they all look alike. 

Wrong.

I'm just trying to mock up how the page should look and so, I have this as the code in my AdvancedForm,ascx's SubmitArea ...
<asp:Panel runat="server"
           ID="ButtonsPanel"
           CssClass="rsAdvancedSubmitArea">
    <div class="rsAdvButtonWrapper">
        <asp:Button  ID="btnWorkgrouSecurity" runat="server" Text="Workgroup Security"/>
        <asp:Button  ID="UpdateButton" runat="server" Text='Save'/>
        <asp:Button  ID="CancelButton" runat="server" Text='Cancel' CommandName="Cancel" CausesValidation="false" />
    </div>
</asp:Panel>

SS1.jpg will show you the mess that is made of the layout of the buttons. I know that this is largely down to the styles defined as "rsAdvancedSubmitArea" and "rsAdvButtonWrapper". However removing anything in these classes that could, in any way, have an impact on the buttons gets be SS2.jpg. As you can see, the text alignment is shot and if you look at SS3.jpg you'll see that the highlighting of the buttons is wrong too; the right hand side of the button's gone.

Can anyone shed any light on what I'm doing wrong here?

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 22 Oct 2010
2 answers
111 views
I have a page with a RadScheduler on it. The scheduler uses a custom AdvancedForm template.

The AdvancedForm template has a RadMultiPage control on it and a couple of the pages have UserControls on them that, in turn, have RadGrids on them.

If I carry out an operation on one of the grids, via an AjaxRequest, I Rebind it and want to see the changes. I tried adding an AjaxProxyManager on the UserControl and on the AdvancedForm template and either got an error or no update at all. I have finally convinced the page to update my grid but only by including an AjaxSetting to update the entire scheduler on the main page.

So, the question is "Is this what you would expect"?

If it is, it seems an awful lot of updating to do to, in the case of my test, to remove one row from a grid.

The page I have ATM, is just a mock-up with all the data being generated by the page itself rather than there being DB or service calls to confuse the issue and as it is, it's taking about 7 seconds to bring up the AdvancedForm initially and an ajax update is taking only a second or so less.

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 22 Oct 2010
1 answer
163 views
I have looked through the threads for something similar and have not found anything to help me...

I have a listview that contains rows populated manually at runtime from a datatable created in the NeedDataSource event.  The columns in the datatable are bound to certain specific items in the listview.  In general, this is all working fine.

However, one of the columns in the datatable contains a path/file name to an image related to the data record.  This path/file name may contain a valid path or it may be an empty string ("").

If the path/file name contains data (a path/file name), then I want to display that image (photo) in a column in the the related row in the listview.

If the path/file name contains an empty string, then I want to display a "no image available" type of graphic.

This is the first time I have attempted to use the Listview control, so I'm not certain how/when to programmatically access/manipulate it to accomplish this goal.

Do you have a sample or some sample code that does this?

Thanks in advance!

Lynn


Lynn
Top achievements
Rank 2
 answered on 22 Oct 2010
1 answer
195 views
I am under the gun here and having a weird issue with RadGrid.  I am using regular data bind (datasource = , databind()).  The grid has some template columns that contain a textbox and a slider.  Whenever I got to capture the values of the slider or the textbox on a postback...both return empty.  Any ideas on what could be causing this?  One note is that not all the rows are displayed upon loading of the grid and I dynamically show them.  Here is the page:
<%@ Register Src="~/BusinessModules/Report/EarnedValueReportSection.ascx" TagName="EarnedValueReportSection" TagPrefix="uc1" %>
<%@ Control Language="vb" AutoEventWireup="false" Inherits="Digisoft.DS.UI.Web.ProgramEarnedValueControl" CodeFile="ProgramEarnedValueControl.ascx.vb" %>
<script type="text/javascript">
    //variables
    var gridProject;
    var tableProject;
     
    //itit Functions
    function initProjectGrid(sender,args){
        //set gridProject,tableProject
        gridProject = sender;
        tableProject = gridProject.get_masterTableView();
    }
     
    function toggleTreeRows(gridId,rowId,storageId,buttonName) {
        var rows = tableProject.get_dataItems();
        var row;
        var childRow;
        var rowVisible = false;
        var childOpen = false;
        var parentLineage = '';
        var childLineage = '';
        var parentLevel = 0;
        var childLevel = 0;
        var storageList = '';
        var storageCtl = document.getElementById(storageId);
        var openCloseCtl;
         
        for (var i = 0; i < rows.length; i++){
            row = rows[i];
            openCloseCtl = row.findElement(buttonName);
            if (parentLineage != '') {
                childLineage = row.get_element().getAttribute('lineage');
                   
                if (childLineage.indexOf(parentLineage) == 0) {
                    childLevel = childLineage.split('/').length;
                    if (childLevel == (parentLevel + 1)){
                        if (childOpen == 'true'){
                            //hide child
                            row.get_element().setAttribute('open','false');
                            if (openCloseCtl.getAttribute("onclick") != null) {
                                openCloseCtl.setAttribute('src',openCloseCtl.getAttribute('src').replace('minus','plus'));
                            }
                            tableProject.hideItem(i);
                        }
                        else {
                            //show child
                            row.get_element().setAttribute('open','true');
                            if (openCloseCtl.getAttribute("onclick") != null) {
                                openCloseCtl.setAttribute('src',openCloseCtl.getAttribute('src').replace('minus','plus'));
                            }
                            tableProject.showItem(i);
                        }
                    }
                    else {
                        //hide non-first level children
                        row.get_element().setAttribute('open','false');
                        if (openCloseCtl.getAttribute("onclick") != null) {
                            openCloseCtl.setAttribute('src',openCloseCtl.getAttribute('src').replace('plus','minus'));
                        }
                        tableProject.hideItem(i);
                    }
                }
            }
            if (rowId == row.get_element().getAttribute('lineage')){
                parentLineage = row.get_element().getAttribute('lineage');
                parentLevel = parentLineage.split('/').length;
                childOpen = tableProject.get_dataItems()[i + 1].get_element().getAttribute('open');
                if (childOpen == 'true'){
                    openCloseCtl.setAttribute('src',openCloseCtl.getAttribute('src').replace('minus','plus'));
                }
                else {
                    openCloseCtl.setAttribute('src',openCloseCtl.getAttribute('src').replace('plus','minus'));
                }
            }
            if (row.get_element().getAttribute('open') == 'true') {
                storageList += row.get_element().getAttribute('lineage') + ','
            }
        }
        storageCtl.value = storageList;
    }
     
    function onSliderValueChange(sender, args){
        var sliderPercentText;
         
        sliderPercentText = document.getElementById(sender.get_element().getAttribute('sliderPercentTxtId'));
        sliderPercentText.value = sender.get_value();
    }
     
    function onSliderEnd(sender, args){
        var valueArray;
        var sliderPercentText;
        var valueParent;
        var valueChild;
        var weightChild;
        var percentChild;
        var rows;
        var row;
        var rowParent;
        var slider;
        var sliderParent;
        var projectId;
        var projectParentId = '';
        var sliderName;
        var hasChildren;
         
        sliderName = sender.get_element().getAttribute('sliderName');
        rows = tableProject.get_dataItems();
         
        valueArray = new Array(rows.length - 1);
         
        //set the values for projects that do not have children in preparation for rolling up.
        for (var i = 0; i <= rows.length - 1; i++){
            row = rows[i];
            slider = row.findControl(sliderName);
            hasChildren = slider.get_element().getAttribute('sliderHasChildren');
            percentChild = slider.get_value();
            if (hasChildren == 'false'){
                valueArray[i] = (percentChild / 100);
            }
            else {
                valueArray[i] = 0;
            }
        }
         
        //roll up values
        for (var i = rows.length - 1; i >= 0; i--){
            row = rows[i];
            slider = row.findControl(sliderName);
            projectParentId = slider.get_element().getAttribute('sliderProjectParentId');
            percentChild = valueArray[i];
            weightChild = slider.get_element().getAttribute('sliderWeight');
             
            if (i !== 0){
                for (var x = (i - 1); x >= 0; x--){
                    rowParent = rows[x];
                    sliderParent = rowParent.findControl(sliderName);
                    projectId = sliderParent.get_element().getAttribute('sliderProjectId');
                     
                    if (projectId == projectParentId) {
                        valueArray[x] += (valueArray[i] * weightChild);
                        break;
                    }
                }
            }
        }
         
        //set value for projects that have children
        for (var i = 0; i < rows.length - 1; i++){
            row = rows[i];
            slider = row.findControl(sliderName);
            hasChildren = slider.get_element().getAttribute('sliderHasChildren');
            sliderPercentText = document.getElementById(slider.get_element().getAttribute('sliderPercentTxtId'));
            valueArray[i] = (valueArray[i] * 100);
            if (hasChildren == 'true'){
                slider.set_value(valueArray[i].toFixed(0));
                sliderPercentText.value = valueArray[i].toFixed(0);
            }
        }
    }
</script>
<style type="text/css" media="all">
    input.label {
        width: 200px;
        border: none;
        color: #000000;
        background-color: transparent;
        text-align: right;
    }
</style>
<asp:updatepanel id="DisplayPanel" Visible="False" UpdateMode="Always" Runat="server">
    <Triggers>
        <asp:PostBackTrigger ControlID="CloseBtn" />
    </Triggers>
    <ContentTemplate>
        <des:DSUpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="DisplayPanel" runat="server">
            <ProgressTemplate>
                <div class="ProgressPanel">
                      
                </div>
                <div class="InnerProgressPanel">
                    <img src="images/ajax-loader.gif" alt="Loading..." /> Loading...
                </div>
            </ProgressTemplate>
        </des:DSUpdateProgress>
        <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td align="center" class="DisplayPanel">
                    <telerik:RadSplitter ID="MainSplitter" runat="server" Height="540" Width="100%">
                        <telerik:RadPane ID="ProjectsPane" Scrolling="Both" Width="25%" PersistScrollPosition="true" runat="server">
                            <asp:HiddenField ID="ProjectTreeHolder" runat="server" />
                            <telerik:RadGrid ID="ProjectGrid" runat="server">
                                <ClientSettings >
                                    <Selecting AllowRowSelect="true" />
                                    <Scrolling AllowScroll="false" />
                                </ClientSettings>
                                <MasterTableView Width="100%" AutoGenerateColumns="false" ClientDataKeyNames="Level,BaseID,StateMode" DataKeyNames="ID" HeaderStyle-Wrap="false">
                                    <Columns>
                                        <telerik:GridTemplateColumn HeaderText=" " UniqueName="ProjectColumn" ItemStyle-Wrap="false">
                                            <ItemTemplate>
                                                <input type="hidden" id="ID" runat="server" value='<%# DataBinder.Eval(Container,"DataItem.ID")%>' />
                                                <input type="hidden" id="ParentID" runat="server" value='<%# DataBinder.Eval(Container,"DataItem.ParentID")%>' />
                                                <input type="hidden" id="Level" runat="server" value='<%# DataBinder.Eval(Container,"DataItem.Level")%>' />
                                                <input type="hidden" id="Lineage" runat="server" value='<%# DataBinder.Eval(Container,"DataItem.Lineage")%>' />
                                                <input type="hidden" id="HasChildren" runat="server" value='<%# DataBinder.Eval(Container,"DataItem.HasChildren")%>' />
                                                <span style="text-decoration:none;"><%#DataBinder.Eval(Container, "DataItem.Padding")%></span>
                                                <asp:Image ID="ProjectOpenCloseImg" runat="server" />
                                                <des:DisableLinkButton ID="ProjectSelectBtn" OnCommand="ProjectSelectBtn_OnCommand" Text='<%# DataBinder.Eval(Container,"DataItem.NameLong")%>' CommandArgument='<%# DataBinder.Eval(Container,"DataItem.ID")%>' CausesValidation="true" runat="server"></des:DisableLinkButton>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn HeaderText="Manager" DataField="Manager.DisplayName" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="Start Date" DataFormatString="{0:d}" DataField="StartDate" HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="End Date" DataFormatString="{0:d}" DataField="EndDate" HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn HeaderText="Active" ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="center">
                                            <ItemTemplate>
                                                <asp:Image runat="server" Visible='<%# DataBinder.Eval(Container,"DataItem.IsActive")%>' ID="IsActiveImg" ImageUrl="~/images/check.gif" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Child Weight" UniqueName="ChildWeight" ItemStyle-Wrap="false"  HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="ChildWeightLbl" runat="server"></asp:Label>%
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Previous %" UniqueName="PreviousPercent" ItemStyle-Wrap="false"  HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:Label ID="PercentPreviousLbl" runat="server"></asp:Label>%
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="%" UniqueName="Percent" ItemStyle-Wrap="false"  HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:TextBox ID="PercentTxt" CssClass="label" Width="30px" runat="server"></asp:TextBox>%
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText=" " UniqueName="PercentSlider" ItemStyle-Wrap="false" HeaderStyle-Width="5px">
                                            <ItemTemplate>
                                                <telerik:RadSlider ID="PercentSlider" runat="server"></telerik:RadSlider>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn HeaderText="Budget" DataFormatString="{0:c}" DataField="CalculatedBudgetTotalCost" HeaderStyle-HorizontalAlign="Center"  ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </telerik:RadPane>
                        <telerik:RadSplitBar ID="MainSplitBar" CollapseMode="None" EnableResize="True" runat="server" />
                        <telerik:RadPane ID="DetailsPane" Scrolling="Both" Width="75%" PersistScrollPosition="true" runat="server">
                            <uc1:EarnedValueReportSection ID="EarnedValueReportSec" runat="server" />
                        </telerik:RadPane>
                    </telerik:RadSplitter>
                </td>
            </tr>
            <tr>
                <td class="TabDisplayFooter" align="right">
                    <des:disablelinkbutton id="CloseBtn" runat="server" enabledcssclass="CommandButton" disabledcssclass="DisabledCommandButton" Visible="True"></des:disablelinkbutton>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:updatepanel>

I would have preferred to just get the value of the slider instead of having to put the value in the textbox....
Dave Myers
Top achievements
Rank 1
 answered on 22 Oct 2010
3 answers
221 views
Hi,

I have a problem,
i have an asp.net panel with scrolling. That panel control is built in layers, so the RadDockLayout is one of its layers. The RadDocks control which are added dynamicly to this layer must be relative to a specific point (Top and Left properties). If I remove the scrolling property of the panel then it is works fine, BUT, if I keep the scrolling property and scroll up, down, right or left then the raddock will stay in its postion and will refer to another point in the map (Please view the attached images).

aspx page:

<

 

 

td style="width:76%;" >

 

 

 

<asp:Panel ID="Panel2" Width="710px" style="margin-top:-18px;" BorderWidth="0" Height="390px" runat="server" >

 

 

 

<asp:Panel ID="bg" Height="410px" ScrollBars="Auto" runat="server" >

 

 

 

<asp:Image ID="CMapImage" runat="server" />

 

 

 

<asp:Label ID="Label1" runat="server" Visible="false" Text="Label"></asp:Label><br />

 

 

 

<asp:Label ID="Label2" runat="server" Visible="false" Text="Label"></asp:Label>

 

 

 

</asp:Panel>

 

 

 

<asp:Panel ID="LayerPanel1" runat="server">

 

 

 

<telerik:RadDockLayout ID="RadDockLayout1" runat="server">

 

 

 

 

</telerik:RadDockLayout>

 

 

 

</asp:Panel>

 

 

 

<asp:Panel ID="content" runat="server">

 

 

 

<table border="0" cellpadding="0" cellspacing="0" width="100%">

 

 

 

<tr>

 

 

 

<td align="left" valign="middle">

 

 

 

<asp:Panel ID="CityNameOnTheMapPanel" style="margin-left:10px" runat="server">

 

 

 

<asp:Label ID="CityNameLabel" Font-Size="14pt" runat="server" ></asp:Label>&nbsp;

 

 

 

<asp:Label ID="OnTheMapLabel" runat="server" Font-Size="14pt" Font-Bold="true" Text="ON THE MAP"></asp:Label>

 

 

 

</asp:Panel>

 

 

 

</td>

 

 

 

<td align="right">

 

 

 

<asp:Label ID="excuteWindowOpenInFullScreen" runat="server" Visible="false"></asp:Label>

 

 

 

<asp:ImageButton ID="ImageButton1"

 

 

 

ImageUrl="~/Common/Img/Buttons/FullScreen.jpg" runat="server"

 

 

 

OnClientClick="UseRadWindow();return false;" />

 

 

 

<asp:ImageButton ID="ImageButton2" Visible="false" ImageUrl="~/Common/Img/Buttons/Print.jpg"

 

 

 

runat="server" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</asp:Panel>

 

 

 

</asp:Panel>

 

 

 

 

</td>

 



c# code:

private

 

 

RadDock CreateRadDock(string dockNum, string bsnsName, string website, int top, int left, string colr)

 

{

 

 

int docksCount = CurrentDockStates.Count;

 

 

 

RadDock dock = new RadDock();

 

dock.ID =

 

string.Format("RadDock{0}", dockNum);

 

dock.Title =

 

string.Format("Dock {0}", dockNum);

 

dock.Width =

 

Unit.Pixel(180);

 

dock.EnableEmbeddedSkins =

 

false;

 

dock.Left =

 

Unit.Pixel(left);

 

dock.Top =

 

Unit.Pixel(top);

 

dock.BackColor.GetBrightness();

dock.OnClientInitialize =

 

"SetHandleDock";

 

dock.DockMode =

 

DockMode.Docked;

 

dock.DockHandle =

 

DockHandle.Grip;

 

dock.Text =

 

"<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td style='background-color:#" + colr + "; border-bottom-style:solid; border-left-style:solid; border-right-style:solid; border-top-style:solid; border-bottom-width:thin; border-top-width:thin; border-right-width:thin; border-left-width:thin;'><div style='margin:2px;'" + string.Format("<a href='{0}'>{1}</a> ", website, bsnsName) + "</div></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td><img alt='' src='Common/Img/Lines/000000.gif' /></td></tr></table>";

 

dock.UniqueName =

 

Guid.NewGuid().ToString();

 

 

 

return dock;

 

}



protected

 

 

void CommonCheckBox_CheckedChanged(object sender, EventArgs e)

 

{

 

 

string _iDs = string.Empty;

 

 

 

 

DataLstObjctGetData _dataLstObjctGetData = new DataLstObjctGetData();

 

 

 

DataSet _myDataSet = new DataSet();

 

_myDataSet = _dataLstObjctGetData.GetHotSpots(GetCtgryLst(), City, SmallMapPosition);

 

 

DataTable _myDataTable = new DataTable();

 

_myDataTable = _myDataSet.Tables[0];

Session[

 

"HotSpotsDataTable"] = _myDataTable;

 

GridView1.DataSource = _myDataTable;

GridView1.DataBind();

RadDockLayout1.Controls.Clear();

 

 

foreach (DataRow _row in _myDataTable.Rows)

 

{

 

 

RadDock dock = CreateRadDock(_row["HSHotSpotID"].ToString(), _row["BBsnsName"].ToString(), _row["BBsnsWebsite"].ToString(), Convert.ToInt32(_row["HSYCord"]), Convert.ToInt32(_row["HSXCord"]), _row["CCtgryColr"].ToString());

 

RadDockLayout1.Controls.Add(dock);

 

 

if (_iDs.ToString().Equals(string.Empty))

 

{

_iDs += _row[

 

"HSHotSpotID"].ToString();

 

}

 

 

else

 

{

_iDs +=

 

"," + _row["HSHotSpotID"].ToString();

 

}

}

Label1.Text = _iDs.ToString();

}

Please, I need your help to make my raddock refers to the same point even if I scroll.
It is apprecited to send me the modified code.

Regards,
Bader

Pero
Telerik team
 answered on 22 Oct 2010
6 answers
508 views
Hello,

I'm having a problem with the javascript functions set_text() and get_text() functions.
Below is a simple page to demonstrate. When I click the button I get an error saying " Object doesn't support this property or method"
I've already searched the forums but none of the existing topics helped me out.

Thanks in advance for any tips!
Regards,
Jasper

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Tests_Test" MasterPageFile="~/MasterPageEmpty.master" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ MasterType VirtualPath="~/MasterPageEmpty.master" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">   
  <script language="javascript" type="text/javascript">
   function Test() {
     var combo = $find('<%=RadComboBox1.ClientID%>');
     alert(combo.get_Text());
   }
  </script>
</telerik:RadScriptBlock>
  
  <atlas:UpdatePanel ID="UpdatePanel" runat="server">
    <ContentTemplate>
      <telerik:RadComboBox ID="RadComboBox1" runat="server" DataTextField="CompanyName"
        DataValueField="ID" ItemRequestTimeout="500" Height="300px" NoWrap="true" ShowDropDownOnTextboxClick="false"
        EnableLoadOnDemand="True" EnableItemCaching="true" OnItemsRequested="OnSupplierItemsRequested"
        >
      </telerik:RadComboBox>
        
      <button onclick="Test()">Test</button>
        
    </ContentTemplate>
  </atlas:UpdatePanel>
</asp:Content>
Ken Jones
Top achievements
Rank 1
 answered on 22 Oct 2010
5 answers
162 views
Hi,

I'm trying to you the client-side for export radgrid data.
I'm calling this function on the client click of my export button :
function ExportGridCsv()
{
    var grid=$find("MyRadGrid");
    if(grid)
        grid.get_masterTableView().exportToCsv();
    return false;
}
I've also add this function on ClientEvents-OnRequestStart of my RadAjaxPanel :
function BeginHandlerExport(AjaxPanel, args)
{
    //Util pour l'export des datas
    if (args.get_eventTarget().indexOf("btn_export") != -1)
        args.set_enableAjax(false);
}

When i click on my button to export my data, a postback is done, needdatasource is called, but nothing happen next. I'm not able to export my radgrid data.
Have you any idea for solve this problem ?

Thanks a lot
Daniel
Telerik team
 answered on 22 Oct 2010
1 answer
73 views
Hello... we're new to telerik controls, and so far i love them but I am facing a little problem:
I'm using a RadScheduler and using resources and grouping them just like the resources example.
on the AppointmentInsert event i have no problem getting the Subject, Start and End date, but since im usin resources i need to find a way to get the current resource so i can insert to the DB.

Thank you very much in advance.
Peter
Telerik team
 answered on 22 Oct 2010
1 answer
93 views
Hi,

How Can I do to Obtain in the code behind the Resource of the appointment when I adding an appointment???

I have this code:

    protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
    {
        string mSubject = e.Appointment.Subject;
        DateTime mStart = e.Appointment.Start;
        DateTime mEnd = e.Appointment.End;
        string mResource = e.Appointment.??????????????????;
    }

I have this code to populate my schedule:

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack) ();
    }

void cargarSalones()
    {
        DataSet ds = new DataSet();
        DataTable dtSalones = new DataTable("salones");
        DataTable dtDetalle = new DataTable("detalle");
        
        dtSalones.Columns.Add(new DataColumn("salon", typeof(System.Int32)));
        dtSalones.Columns.Add(new DataColumn("nombre", typeof(System.String)));

        dtDetalle.Columns.Add(new DataColumn("salon", typeof(System.Int32)));
        dtDetalle.Columns.Add(new DataColumn("asunto", typeof(System.String)));
        dtDetalle.Columns.Add(new DataColumn("inicio", typeof(System.DateTime)));
        dtDetalle.Columns.Add(new DataColumn("fin", typeof(System.DateTime)));

        DataRow row = dtSalones.NewRow();
        row["salon"] = 1;
        row["nombre"] = "Salon 101";
        dtSalones.Rows.Add(row);

        DataRow row2 = dtSalones.NewRow();
        row2["salon"] = 2;
        row2["nombre"] = "Salon 202";
        dtSalones.Rows.Add(row2);
        
        DataRow row3 = dtDetalle.NewRow();
        row3["salon"] = 1;
        row3["asunto"] = "Curso A101 - Carrera LAE";
        row3["inicio"] = "08:00";
        row3["fin"] = "08:59";
        dtDetalle.Rows.Add(row3);

        DataRow row4 = dtDetalle.NewRow();
        row4["salon"] = 2;
        row4["asunto"] = "Curso B02 - Carrera II";
        row4["inicio"] = "10:00";
        row4["fin"] = "10:59";
        dtDetalle.Rows.Add(row4);

        ds.Tables.Add(dtSalones);
        ds.Tables.Add(dtDetalle);

        for (int ii = 0; ii < ds.Tables["salones"].Rows.Count; ii++)
        {
            ResourceType salon = new ResourceType();
            salon.KeyField = Convert.ToString(ds.Tables["salones"].Rows[ii]["salon"]);
            salon.Name = Convert.ToString(ds.Tables["salones"].Rows[ii]["nombre"]);
            RadScheduler1.ResourceTypes.Add(salon);
        }

        RadScheduler1.DataSource = ds;
        RadScheduler1.DataMember = "detalle";
        RadScheduler1.DataKeyField = "salon";
        RadScheduler1.DataSubjectField = "asunto";
        RadScheduler1.DataStartField = "inicio";
        RadScheduler1.DataEndField = "fin";
        RadScheduler1.DataDescriptionField = "asunto";
    }

Thanks in Advance.
Peter
Telerik team
 answered on 22 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?