Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
112 views
I have  radgrid with 2 column and I am hiding the header with showheader= 'False' and also not defined HeaderText attribute in column declaration.  Radgrid is set to POPUP for edit mode.

when I go into edit mode  for update or insert. the header is still displays with ":" 
How do I completley avoid displaying the column header in edit mode. I just want the i/p  field no headings

Also I do not want to use form template, because the column i have is  GridHtmleditorColumn and  equivalent editor column is not displaying in editform tempalte

Thanks


NVB
Top achievements
Rank 1
 answered on 29 Jun 2012
1 answer
85 views
I am very new to telerik controls so please bear with me.
I have a radgrid with multiple template columns. In most of them I have checkboxes and in one I have a textbox. What I need to do is allow the user to edit the textbox value or checkbox checked state and have it reflected in the underlying data.
 
I guess the real question is are these controls databound to the underlying data automatically? If not, what is the best way to manage that?

When the data is bound to the grid, the checkbox state is set via the ItemDataBound event. I'd prefer to allow the user the ability to edit the data as needed and then post it back all at once. Is this possible?

On a different note, I would also like to not have a textbox in the cell but instead cause it to be directly editable when clicking in the cell. Maybe display a temporary textbox that updates the underlying data ... barring that, perhaps format the textbox so it does not appear as an editable cell unless clicked in.

Like I said, I am new to telerik controls so please be patient with me. I am open to all suggestions.

Thanks
Keith
Top achievements
Rank 2
 answered on 29 Jun 2012
2 answers
152 views
Hi all,

This follows from a question I posed in another forum related to rounded corners on buttons.

Is there a way to disable the rounded corners on the RadComboBox (using the Office2010Black skin)?

The reason that I want to do this is to make the RadComboBox control consistant with other controls such as the RadTextBox.

Having one control being squared off and then the next having rounded corners looks like I'm using controls from two different skins...

Best Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 29 Jun 2012
3 answers
154 views
I have implemented sorting on my RadGrid and wanted to know if I could change the sort order (asc/desc) when the user clicks the column to be sorted? I know if the user clicks the column again it will alternate between the two types of sorting (asc/desc) or no sort based on this article , but what I want to control, is the order of the sort when the column is first clicked. Currently on the first click the column sorts ascending, but I want it to sort descending when it is click for the first time. Thanks in advance
Pavlina
Telerik team
 answered on 29 Jun 2012
0 answers
204 views
I need to create a master details web page for a project I am working on. We have the 2012 version. I would have one item (description) that I think I could put in a grid or listbox and when the user selects that item I need to show the details of that selected item. I was thinking that I could use either a radgrid or radlistbox to display the description and once selected show the corresponding fields in an ajax panel. What does the telerilk team recommend me doing to doe this the best way possible? note: I see how this can be done within the gridview its self but I need the master (grid) and the details view to be in two seperate panels side by side. Also the details data must be editable.

Thanks,


Steve Holdorf
Steve Holdorf
Top achievements
Rank 1
 asked on 29 Jun 2012
1 answer
83 views
The "Visual Style Builder Info" sticky on this thread states that I can create a style with the stylebuilder site (which I did) then download the zip file and

    "Simply add the files from this archive to your project, and your custom skin is ready go
"

However, I am having a hard time figuring out how to do this exactly. I'm using Visual Studio 2010 and it isn't as simple as adding the CSS files from the archive and linking to them, I tried that. What am I missing?
Ivan Zhekov
Telerik team
 answered on 29 Jun 2012
6 answers
72 views
hi

in my case, i have fields in my DB start_time n End_timr
n i want to show shedule from start time to end time of that day.
example.
if one user has first appoitment start time at 10.a.m  the in schedular it shows 10.am n its last appoitment end time will br end time of schedule
according to db firlds i want dynamicaly time into schedular
n if on next day  he has appoitment start  at 2:pm then it shud shows start_time from 2.pm

Regards
Devang Tadvi
Ivana
Telerik team
 answered on 29 Jun 2012
5 answers
208 views
Is it possible to specify a keyboard shortcut so that if a user presses "T", rather than "T" appearing in the input box, it instead selects today's date?
Vasil
Telerik team
 answered on 29 Jun 2012
1 answer
114 views
Hi,

First time using RadTabStrip. I have 7 Tabs. In tab index 0 I only display data in Literal controls, but in my second tab I populate a form for updating the record.
In my RadTabStrip I have OnLoad="rtsOrganisation_Load" which calls another method LoadTabData which uses a switch  to determine what to load for the selected Tab. Therefore I am not loading the data for all tabs each time someone clicks a tab in my page.
The form is populated, however when I click my button to save the record, the new form data never gets passed to my save method, therefore my record gets updated with the original data only?

I'm wondering if the problem is in my LoadTabData method being called with every load of the RadTabStrip? I guess I'm just basically lost..

Please help...
<div class="adminrc">
<asp:Literal ID="litFeedback" runat="server" Visible="false" />
<fieldset>
<legend>View Organisation - <span><asp:Literal ID="litTabTitleCurrent" runat="server" Text="Manage Organisation" /></span></legend>
    <asp:HiddenField ID="hidPreviousTabHidden" runat="server" Value="" />
    <script type="text/javascript">
        function OnSelecting(sender, args) {
            document.getElementById("<%= hidPreviousTabHidden.ClientID%>").value = sender.get_selectedTab().get_value(); // SelectedTab.Text;
        }
    </script>
        <telerik:RadTabStrip ID="rtsOrganisation" runat="server" MultiPageID="rmpOrganisation" Skin="Sunset" SelectedIndex="0" AutoPostBack="true" OnTabClick="rtsOrganisation_TabClick" OnClientTabSelecting="OnSelecting" OnLoad="rtsOrganisation_Load">
            <Tabs>
                <telerik:RadTab runat="server" Text="Company Details" PageViewID="rpvCompanyDetails" Value="CompanyDetails" />
                <telerik:RadTab runat="server" Text="Manage Company" PageViewID="rpvManageCompany" Value="ManageCompany" />
                <telerik:RadTab runat="server" Text="Manage Members" PageViewID="rpvManageMembers" Value="ManageMembers" />
                <telerik:RadTab runat="server" Text="Manage Package" PageViewID="rpvManagePackage" Value="ManagePackage" />
                <telerik:RadTab runat="server" Text="Manage Credits" PageViewID="rpvManageCredits" Value="ManageCredits" />
                <telerik:RadTab runat="server" Text="Purchase History" PageViewID="rpvPurchaseHistory" Value="PurchaseHistory" />
                <telerik:RadTab runat="server" Text="Notes" PageViewID="rpvNotes" Value="Notes" />
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="rmpOrganisation" runat="server" SelectedIndex="0">
        <%--
*****************************************************************************
*****************************************************************************
    TAB - COMPANY DETAIL DISPLAY
*****************************************************************************
*****************************************************************************
        --%>
            <telerik:RadPageView ID="rpvCompanyDetails" runat="server">
                        <ol>
                            <li>
                                <label><asp:HyperLink ID="HyperLink1" runat="server" Text="« Organisation list" NavigateUrl="default.aspx" /></label>
                            </li>
                            <li class="bar">
                                <h3>Company Information</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblInfoName" runat="server" Text="Company Name:" AssociatedControlID="litName" />
                                <asp:Literal ID="litName" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoExpiryDate" runat="server" Text="ExpiryDate:" AssociatedControlID="litExpiryDate" />
                                <asp:Literal ID="litExpiryDate" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoAccessType" runat="server" Text="Access Type:" AssociatedControlID="litAccessType" />
                                <asp:Literal ID="litAccessType" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoPackage" runat="server" Text="Access Type:" AssociatedControlID="litProductPackage" />
                                <asp:Literal ID="litProductPackage" runat="server" />
                            </li>
                            <li class="bar">
                                <h3>Contact</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblInfoContactName" runat="server" Text="Contact Name:" AssociatedControlID="litContactName" />
                                <asp:Literal ID="litContactName" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoContactTitle" runat="server" Text="Position:" AssociatedControlID="litContactTitle" />
                                <asp:Literal ID="litContactTitle" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoPhone" runat="server" Text="Phone:" AssociatedControlID="litPhone" />
                                <asp:Literal ID="litPhone" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoFax" runat="server" Text="Fax:" AssociatedControlID="litFax" />
                                <asp:Literal ID="litFax" runat="server" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoEmail" runat="server" Text="Email:" AssociatedControlID="hlEmail" />
                                <asp:HyperLink ID="hlEmail" runat="server" Text="" NavigateUrl="" />
                            </li>
                            <li>
                                <asp:Label ID="lblInfoURL" runat="server" Text="URL:" AssociatedControlID="hlURL" />
                                <asp:HyperLink ID="hlURL" runat="server" Text="" NavigateUrl="" />
                            </li>
                        </ol>
            </telerik:RadPageView>
        <%--
*****************************************************************************
*****************************************************************************
    TAB - MANAGE COMPANY (FORM)
*****************************************************************************
*****************************************************************************
        --%>
            <telerik:RadPageView ID="rpvManageCompany" runat="server">
 
                        <ol>
                            <li>
                                <label><asp:HyperLink ID="lnkBack1" runat="server" Text="« Organisation list" NavigateUrl="default.aspx" /></label>
                            </li>
                            <li class="bar">
                                <h3>1. Basic Information</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblPublications" runat="server" Text="Publications: <span class=required title=Required>*</span>" AssociatedControlID="psPublicationSelector" />
                                <ah:PublicationSelector ID="psPublicationSelector" runat="server" AllowMultipleSelections="false" PropertyName="Publication" AutoPostBackSingle="true" />
                                <asp:RequiredFieldValidator ID="rfvPublicationId" runat="server" ControlToValidate="psPublicationSelector" Text="Pick a Publication" ValidationGroup="ValidatePage" SetFocusOnError="true"></asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="lblArtsHubStaffSelector" runat="server" Text="Staff/Sales Person" AssociatedControlID="asArtsHubStaffSelector" />
                                <ah:ArtsHubStaffSelector ID="asArtsHubStaffSelector" runat="server" InsertEmpty=" --Sales Person" />
                            </li>
 
 
 
                            <li class="bar">
                                <h3>2. Package Details</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblProductPackageTemplateSelector" runat="server" Text="Package Template:" AssociatedControlID="ptProductPackageTemplateSelector" />
                                <ah:ProductPackageTemplateSelector ID="ptProductPackageTemplateSelector" runat="server" PackageLegacyStatus="No" PublicationId="AU" />
                            </li>
                            <li>
                                <asp:Label ID="lblOrgAccessTypeSelector" runat="server" Text="Org AccessType:" AssociatedControlID="oaOrgAccessTypeSelector" />
                                <ah:OrgAccessTypeSelector ID="oaOrgAccessTypeSelector" runat="server" />
                                <asp:Label ID="lblCanViewJobs" runat="server" Text="Licence can view jobs" />
                                <asp:CheckBox ID="cbCanViewJobs" runat="server" /> <span>(Licence access type only)</span>
                            </li>
 
 
 
                            <li class="bar">
                                <h3>3. Company Details</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblName" runat="server" Text="Company Name: <span class=required title=Required>*</span>" AssociatedControlID="tbName" />
                                <asp:TextBox ID="tbName" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="75" />
                                <asp:Label ID="lblIsFeatured" runat="server" Text="Featured Org" />
                                <asp:CheckBox ID="cbIsFeatured" runat="server" /> <span>(Used for Company of the week)</span>
 
                            </li>
                            <li>
                                <asp:Label ID="lblExpiryDate" runat="server" Text="Expiry Date:" AssociatedControlID="rdpExpiryDate" />
                                <telerik:RadDatePicker ID="rdpExpiryDate" runat="server" />
                            </li>
 
                            <li>
                                <asp:Label ID="lblABN" runat="server" Text="ABN" AssociatedControlID="tbABN" />
                                <asp:TextBox ID="tbABN" runat="server" Text="" />
                            </li>
                            <li>
                                <asp:Label ID="lblContactName" runat="server" Text="Contact/Billing Name: <span class=required title=Required>*</span>" AssociatedControlID="tbContactName" />
                                <asp:TextBox ID="tbContactName" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="75" />
                            </li>
                            <li>
                                <asp:Label ID="lblContactTitle" runat="server" Text="Contact Title/Position: <span class=required title=Required>*</span>" AssociatedControlID="tbContactTitle" />
                                <asp:TextBox ID="tbContactTitle" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="75" />
                            </li>
                            <li>
                                <asp:Label ID="lblPhone" runat="server" Text="Phone: <span class=required title=Required>*</span>" AssociatedControlID="tbPhone" />
                                <asp:TextBox ID="tbPhone" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="50" />
                            </li>
                            <li>
                                <asp:Label ID="lblFax" runat="server" Text="Fax:" AssociatedControlID="tbFax" />
                                <asp:TextBox ID="tbFax" runat="server" Columns="50" MaxLength="50" />
                            </li>
                            <li>
                                <asp:Label ID="lblEmail" runat="server" Text="Email: <span class=required title=Required>*</span>" AssociatedControlID="tbEmail" />
                                <asp:TextBox ID="tbEmail" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="75" />
                            </li>
                            <li>
                                <asp:Label ID="lblURL" runat="server" Text="Companies URL:" AssociatedControlID="tbURL" />
                                <asp:TextBox ID="tbURL" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="75" />
                                <asp:CheckBox ID="cbListURLOnPublic" runat="server" /> <span>(List URL On Public)</span>
                                <%--<asp:RegularExpressionValidator ID="revURL" runat="server" ControlToValidate="tbURL" ErrorMessage="Enter a Valid Company URL" Display="Dynamic" ValidationExpression="^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$" SetFocusOnError="true" ValidationGroup="links"></asp:RegularExpressionValidator>--%>
                            </li>
                            <li>
                                <asp:Label ID="lblOrgSize" runat="server" Text="Organisation size" AssociatedControlID="osOrganisationSizeSelector" />
                                <ah:OrganisationSizeSelector ID="osOrganisationSizeSelector" runat="server" />
                            </li>
 
 
 
                            <li class="bar">
                                <h3>4. Company Address</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblAddress1" runat="server" Text="Address1: <span class=required title=Required>*</span>" AssociatedControlID="tbAddress1" />
                                <asp:TextBox ID="tbAddress1" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="75" />
                            </li>
                            <li>
                                <asp:Label ID="lblAddress2" runat="server" Text="Address2:" AssociatedControlID="tbAddress2" />
                                <asp:TextBox ID="tbAddress2" runat="server" Text="" MaxLength="75" />
                            </li>
                            <li>
                                <asp:Label ID="lblSuburb" runat="server" Text="Suburb: <span class=required title=Required>*</span>" AssociatedControlID="tbSuburb" />
                                <asp:TextBox ID="tbSuburb" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="50" />
                            </li>
                            <li class="blockFixSelector">
                                <asp:Label ID="lblRegion" runat="server" Text="Region:" AssociatedControlID="csCountrySelector" />
                                <ah:CountrySelector ID="csCountrySelector" runat="server" ShowSubRegions="false" MaxHeight="100" />
                            </li>
                            <li>
                                <asp:Label ID="lblPostcode" runat="server" Text="Postcode: <span class=required title=Required>*</span>" AssociatedControlID="tbPostcode" />
                                <asp:TextBox ID="tbPostcode" runat="server" Columns="50" ValidationGroup="ValidatePage" MaxLength="10" />
                            </li>
 
 
 
                            <li class="bar">
                                <h3>5. Notes</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblNotes" runat="server" Text="Notes:" AssociatedControlID="reNotes" />
                                <telerik:RadTextBox ID="reNotes" TextMode="MultiLine" runat="server" Rows="4" Columns="50" MaxLength="250"></telerik:RadTextBox>
                            </li>
 
 
 
                            <li class="bar">
                                <h3>6. Invoice Details</h3>
                            </li>
                            <li>
                                <asp:Label ID="lblInvoiceDate" runat="server" Text="Invoice Date:" AssociatedControlID="rdpInvoiceDate" />
                                <telerik:RadDatePicker ID="rdpInvoiceDate" runat="server" Enabled="false" />
                            </li>
                            <li>
                                <asp:Label ID="lblInvoiceAmount" runat="server" Text="Invoice Amount:" AssociatedControlID="tbInvoiceAmount" />
                                <asp:TextBox ID="tbInvoiceAmount" runat="server" Columns="50" Enabled="false" />
                                <asp:Label ID="lblInvoicePaid" runat="server" Text="Paid:" AssociatedControlID="cbInvoicePaid" />
                                <asp:CheckBox ID="cbInvoicePaid" runat="server" />
                            </li>
 
 
 
     
                            <%--Buttons --%>
                            <li class="bar">
                                <h3> </h3>
                            </li>
                            <li>
                                <label> </label>
                                <asp:Button ID="btnSave" runat="server" Text="Save Organisation" OnClick="btnSaveOrgDetails_Click" ValidationGroup="ValidatePage" TabIndex="15" />
                                <label> </label>
                                <asp:Button ID="btnExit" runat="server" Text="Exit without Saving" OnClick="btnExit_Click" CausesValidation="false" />
                            </li>
                        </ol>
 
                        <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="Proceed with Saving Organisation?" TargetControlID="btnSave" />
 
                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
 
                        <telerik:RadInputManager ID="RadInputManager1" runat="server">
 
                            <telerik:TextBoxSetting BehaviorID="TextBoxBehavior1">
                                <Validation IsRequired="true" ValidationGroup="ValidatePage" />
                                <TargetControls>
                                    <telerik:TargetInput ControlID="tbName" />
                                    <telerik:TargetInput ControlID="tbContactName" />
                                    <telerik:TargetInput ControlID="tbContactTitle" />
                                    <telerik:TargetInput ControlID="tbPhone" />
                                    <telerik:TargetInput ControlID="tbEmail" />
                                    <telerik:TargetInput ControlID="tbAddress1" />
                                    <telerik:TargetInput ControlID="tbSuburb" />
                                    <telerik:TargetInput ControlID="tbPostcode" />
                                </TargetControls>
                            </telerik:TextBoxSetting>
 
                            <telerik:RegExpTextBoxSetting BehaviorID="RegExpTextBoxSetting1" EmptyMessage="Full URL including 'http://' required" ValidationExpression="^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$">
                                <Validation IsRequired="false" ValidationGroup="ValidatePage" />
                                <TargetControls>
                                    <telerik:TargetInput ControlID="tbUrl" />
                                </TargetControls>
                            </telerik:RegExpTextBoxSetting>
 
                        </telerik:RadInputManager>
            </telerik:RadPageView>
        <%--
*****************************************************************************
*****************************************************************************
    TAB - MANAGE MEMBERS
*****************************************************************************
*****************************************************************************
        --%>
            <telerik:RadPageView ID="rpvManageMembers" runat="server">
                <p>TAB 3 Members</p>
                <asp:Literal ID="testValue" runat="server" Text="Default stuff here" />
            </telerik:RadPageView>
        <%--
*****************************************************************************
*****************************************************************************
    TAB - MANAGE PACKAGE
*****************************************************************************
*****************************************************************************
        --%>
            <telerik:RadPageView ID="rpvManagePackage" runat="server">
                <p>TAB 4 "Manage Package</p>
            </telerik:RadPageView>
            </telerik:RadPageView>
        <%--
*****************************************************************************
*****************************************************************************
    TAB - MANAGE CREDITS
*****************************************************************************
*****************************************************************************
        --%>
            <telerik:RadPageView ID="rpvManageCredits" runat="server">
                <p>TAB 5 Manage Credits</p>
            </telerik:RadPageView>
            </telerik:RadPageView>
        <%--
*****************************************************************************
*****************************************************************************
    TAB - PURCHASE HISTORY
*****************************************************************************
*****************************************************************************
        --%>
            <telerik:RadPageView ID="rpvPurchaseHistory" runat="server">
                <p>TAB 6 Purchase History</p>
            </telerik:RadPageView>
            </telerik:RadPageView>
        <%--
*****************************************************************************
*****************************************************************************
    TAB - NOTES
*****************************************************************************
*****************************************************************************
        --%>
            <telerik:RadPageView ID="rpvNotes" runat="server">
                <p>TAB 7 Notes</p>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
</fieldset>
 
 
</div>
    public partial class admin_membership_organisation_view : System.Web.UI.Page
    {
        RadTab lastClickedTab = null;
     
        protected override void OnPreRenderComplete(EventArgs e)
        {
            base.OnPreRenderComplete(e);
 
            if (!Page.IsPostBack)
            {
                Utilities.FeedBackMessage(litFeedback);
            }
 
        }
 
        protected void Page_PreLoad(object sender, EventArgs e)
        {
            //if (!Page.IsPostBack)
            //{
                if (Request.Form["__EVENTTARGET"] == rtsOrganisation.UniqueID)
                {
                    //locate the selected tab by using the value of the hidden field
                    //The code below will be executed only if the postback is fired by the tabstrip
                    //lastClickedTab = rtsOrganisation.FindTabByText(hidPreviousTabHidden.Value);
                    ////LoadTabData(rmpOrganisation.SelectedIndex, rtsOrganisation.SelectedTab.Text.ToString());
                }
            //}
        }
 
        protected void rtsOrganisation_Load(object sender, EventArgs e)
        {
            //What was the previous tab?
            lastClickedTab = rtsOrganisation.FindTabByText(hidPreviousTabHidden.Value);
            //if (!Page.IsPostBack)
            //{
                LoadTabData(rtsOrganisation.SelectedIndex, rtsOrganisation.SelectedTab.Text.ToString());
            //}
        }
 
        protected void rtsOrganisation_TabClick(object sender, RadTabStripEventArgs e)
        {
            ////Telerik.Web.UI.RadTab TabClicked = e.Tab;
            //LoadTabData(e, e.Tab.Text.ToString());
            litFeedback.Text = "";
            litFeedback.Visible = false;
 
        }
 
        protected void LoadTabData(RadTabStripEventArgs e, string tabName)
        {
            LoadTabData(e.Tab.SelectedIndex, tabName);
        }
        protected void LoadTabData(int selectedTabIndex, string tabName)
        {
            litTabTitleCurrent.Text = tabName;
            //Previous clicked tab was " + lastClickedTab.Text;
            switch (selectedTabIndex)
            {
                case 0:
                    //do stuff
                    BindCompanyDetails(Organisation.GetOrgId);
                    break;
                case 1:
                    //do stuff
                    BindManageCompany(Organisation.GetOrgId);
                    break;
                case 2:
                    //do stuff
                    testValue.Text = "See it loaded!!";
                    break;
                case 3:
                    //do stuff
                    break;
                case 4:
                    //do stuff
                    break;
                case 5:
                    //do other stuff
                    break;
 
            }
 
        }
 
        protected void btnExit_Click(object sender, EventArgs e)
        {
            Utilities.FeedbackWithRedirect("default.aspx", "Exited Manage/View Org without Saving!", ConfigGlobal.FeedbackStatus.Information);
        }
 
#region TAB - View Company Details
         
        private void BindCompanyDetails(int orgId)
        {
            Organisation record = Organisation.GetOrganisation_Cacheless(orgId);
            BindCompanyDetails(record);
        }
 
        private void BindCompanyDetails(Organisation record)
        {
            if (record != null)
            {
                //Organisation Basic deets #################################################
                litName.Text = record.Name;
                litExpiryDate.Text = Utilities.NiceDate(record.ExpiryDate);
                litAccessType.Text = record.AccessType;
                litProductPackage.Text = record.CurrentProductPackageTemplate.ProductPackageTemplateName;
                litContactName.Text = record.ContactName;
                litContactTitle.Text = record.ContactTitle;
                litPhone.Text = record.Phone;
                litFax.Text = record.Fax;
                hlEmail.Text = record.Email;
                hlEmail.NavigateUrl = "mailto:" + record.Email;
                hlURL.Text = record.URL;
                hlURL.NavigateUrl = record.URL;
                hlURL.Target = "_blank";
 
            }
        }
 
#endregion
 
#region TAB - Manage Company Details
        /// <summary>
        ///
        /// </summary>
        protected void btnSaveOrgDetails_Click(object sender, EventArgs e)
        {
            Page.Validate("ValidatePage");
            if (Page.IsValid)
            {
 
                litFeedback.Visible = true;
                if (psPublicationSelector.SelectedPubId == 0)
                {
                    litFeedback.Text = "<p class=\"warn\">You must select a Publication and a Member for the Listing and the Purchase.</p>";
                }
                else
                {
                    Organisation record = Organisation.GetOrganisation(Organisation.GetOrgId);
                    //Collect data from form
                    record = BuildOrgDetailsFromForm(record);
 
                    if (record.Save())
                    {
                        //BindJob(Job.GetJobId);
                        Utilities.FeedbackWithRedirect("organisation-view.aspx?OrgId=" + record.Id.ToString(), "Company #" + record.Id + "  has been updated successfully.", ConfigGlobal.FeedbackStatus.Success);
                    }
                    else
                    {
                        litFeedback.Text = "<p class=\"failure\">A error has occured, please try updating this Job Advertisement again.</p>";
                    }
                }
            }
            else
            {
                BLL.Emailing.Emailing.EmailBug("NOT VALID? Name=" + tbName.Text.Trim(), "");
            }
        }
        /// <summary>
        /// Collect the form data into the record for saving
        /// </summary>
        protected Organisation BuildOrgDetailsFromForm(Organisation record)
        {
            //Organisation Basic deets #################################################
            record.Name = tbName.Text.Trim();
            record.PublicationId = Convert.ToByte(psPublicationSelector.SelectedPubId);
            record.CurrentPackageId = ptProductPackageTemplateSelector.SelectedProductPackageTemplate;
            record.AccessType = oaOrgAccessTypeSelector.SelectedOrgAccessType;
            record.CanViewJobs = cbCanViewJobs.Checked;
            record.AdminUserId = asArtsHubStaffSelector.SelectedArtsHubStaff;
            record.OrgSizeId = osOrganisationSizeSelector.SelectedOrganisationSize;
 
 
            //Contact Deets ###########################################
            record.ABN = tbABN.Text.Trim();
            record.ContactName = tbContactName.Text.Trim();
            record.ContactTitle = tbContactTitle.Text.Trim();
            record.Phone = tbPhone.Text.Trim();
            record.Fax = tbFax.Text.Trim();
            record.Email = tbEmail.Text.Trim();
            record.URL = tbURL.Text.Trim();
            record.ListURLOnPublic = cbListURLOnPublic.Checked;
 
            //Contact Deets ###########################################
            record.Address1 = tbAddress1.Text.Trim();
            record.Address2 = tbAddress2.Text.Trim();
            record.Suburb = tbSuburb.Text.Trim();
            record.RegionId = csCountrySelector.selectedRegionId;
            record.CountryCode = csCountrySelector.selectedCountryCode;
            record.Postcode = tbPostcode.Text.Trim();
 
            //Dates
            record.ExpiryDate = (rdpExpiryDate.SelectedDate.HasValue) ? rdpExpiryDate.SelectedDate.Value : DateTime.MinValue;
            record.InvoiceDate = (rdpInvoiceDate.SelectedDate.HasValue) ? rdpInvoiceDate.SelectedDate.Value : DateTime.MinValue;
            record.InvoicePaid = cbInvoicePaid.Checked;
            record.InvoiceAmount = decimal.Parse(tbInvoiceAmount.Text);
 
 
            record.Notes = reNotes.Text.Trim();
            record.IsFeaturedOrg = cbIsFeatured.Checked;
 
            return record;
        }
 
        private void BindManageCompany(int orgId)
        {
            Page.Form.DefaultButton = btnSave.UniqueID;
             
            Organisation record = Organisation.GetOrganisation_Cacheless(orgId);
            BindManageCompany(record);
        }
 
        private void BindManageCompany(Organisation record)
        {
            if (record != null)
            {
                //Organisation Basic deets #################################################
                tbName.Text = record.Name;
                psPublicationSelector.SelectedPubId = (int)record.PublicationId;
                ptProductPackageTemplateSelector.SelectedProductPackageTemplate = record.CurrentPackageId;
                oaOrgAccessTypeSelector.SelectedOrgAccessType = record.AccessType;
                cbCanViewJobs.Checked = record.CanViewJobs;
                asArtsHubStaffSelector.SelectedArtsHubStaff = record.AdminUserId;
                osOrganisationSizeSelector.SelectedOrganisationSize = record.OrgSizeId;
 
 
                //Contact Deets ###########################################
                tbABN.Text = record.ABN;
                tbContactName.Text = record.ContactName;
                tbContactTitle.Text = record.ContactTitle;
                tbPhone.Text = record.Phone;
                tbFax.Text = record.Fax;
                tbEmail.Text = record.Email;
                tbURL.Text = record.URL;
                cbListURLOnPublic.Checked = record.ListURLOnPublic;
 
                //Contact Deets ###########################################
                tbAddress1.Text = record.Address1;
                tbAddress2.Text = record.Address2;
                tbSuburb.Text = record.Suburb;
                csCountrySelector.selectedRegionId = record.RegionId;
                csCountrySelector.selectedCountryCode = record.CountryCode;
                tbPostcode.Text = record.Postcode;
 
                //Dates
                rdpExpiryDate.SelectedDate = record.ExpiryDate;
 
                reNotes.Text = record.Notes;
                cbIsFeatured.Checked =  record.IsFeaturedOrg;
 
                rdpInvoiceDate.SelectedDate = record.InvoiceDate;
                tbInvoiceAmount.Text = record.InvoiceAmount.ToString();
                cbInvoicePaid.Checked = record.InvoicePaid;
 
            }
        }
#endregion
 
    }
Kate
Telerik team
 answered on 29 Jun 2012
2 answers
231 views
Hello there the RadGrid Export functionality is not working for me. Can you help what am I doing wrong?

Below is the aspx page code. I am trying to use btnExport to export to excel.


<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.Master"
    CodeBehind="WorklistSummary.aspx.cs" Inherits="MyCompany.WorklistSummary"
    MaintainScrollPositionOnPostback="true" %>
 
<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="cph1">
    <telerik:RadAjaxManagerProxy runat="server" ID="RadAjaxManagerProxy1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnlMain">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlMain" LoadingPanelID="lp1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdUserLoad" LoadingPanelID="lp1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdUserLoad">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdUserLoad" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <div class="formLayoutD">
        <asp:Panel runat="server" ID="pnlMain" Height="99%" Width="100%">
            <h3>
                Worklist Summary</h3>
            <asp:ValidationSummary ID="valSummary" runat="server" DisplayMode="BulletList" CssClass="validationSummary"
                ShowSummary="true" ValidationGroup="DateNeeded" />
            <table width="450px">
                <tr style="border: 1; border-color: black; border-width: 2">
                    <td style="width: 20%; text-align: left">
                        Admit Date Between:
                    </td>
                    <td style="width: 35%">
                        <telerik:RadDatePicker ID="dpStartAdmitDate" runat="server" AutoPostBack="false"
                            Calendar="" Width="100px">
                            <Calendar ID="Calendar1" ShowRowHeaders="False" runat="server" />
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator ID="valdpStartAdmitDate1" runat="server" ControlToValidate="dpStartAdmitDate"
                            ValidationGroup="DateNeeded" SetFocusOnError="true" ErrorMessage="Start Date is required"
                            Display="None" Text="" />
                        And
                        <telerik:RadDatePicker ID="dpEndAdmitDate" runat="server" AutoPostBack="false" Width="100px">
                            <Calendar ID="Calendar2" ShowRowHeaders="False" runat="server" />
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator ID="valdpEndAdmitDate1" runat="server" ControlToValidate="dpEndAdmitDate"
                            ValidationGroup="DateNeeded" SetFocusOnError="true" ErrorMessage="End Date is required"
                            Display="None" Text="" />
                    </td>
                    <td style="width: 5%;" align="left">
                        <asp:Button runat="server" ID="btnSearch" Text="Search" Width="75px" ValidationGroup="DateNeeded"
                            OnClick="btnSearch_Click" />
                    </td>
                    <td style="width: 5%;" align="left">
                        <asp:Button runat="server" ID="btnExport" Text="Export" Width="75px"
                            OnClick="btnExport_Click"  />
                    </td>
                </tr>
 
            </table>
            <div>
                <telerik:RadGrid ID="grdUserLoad" runat="server" AutoGenerateColumns="False" CssClass="Grid"
                    Skin="Windows7" GridLines="Vertical" Width="80%" AllowMultiRowSelection="false"
                    AllowFilteringByColumn="False" AllowSorting="false" AllowPaging="True" PageSize="20"
                    OnNeedDataSource="grdUserLoad_OnNeedDataSource" >
                    <ExportSettings HideStructureColumns="True" IgnorePaging="True" ExportOnlyData="True" />
                    <MasterTableView Width="100%" EnableViewState="True" >
                         <GroupByExpressions>
                           <telerik:GridGroupByExpression runat="server">
                                <SelectFields>
                                    <telerik:GridGroupByField runat="server" FieldName="Name" HeaderText="User Name" />
                                </SelectFields>
                                <GroupByFields>
                                    <telerik:GridGroupByField runat="server" FieldName="Name" HeaderText="" SortOrder="Ascending" />
                                </GroupByFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridBoundColumn HeaderText="User" DataField="Name" UniqueName="UserName"
                                Visible="False" />
                            <telerik:GridBoundColumn HeaderText="Group(s)" DataField="ParentName" UniqueName="GroupName" />
                            <telerik:GridBoundColumn HeaderText="Workload" DataField="CountAccount" UniqueName="CountAccount" />
                        </Columns>
                    </MasterTableView>
                    <HeaderStyle CssClass="GridHeader" />
                    <PagerStyle AlwaysVisible="False" Mode="NextPrevAndNumeric" HorizontalAlign="Center"
                        Height="35px"></PagerStyle>
                    <GroupingSettings CaseSensitive="False" />
                </telerik:RadGrid>
            </div>
        </asp:Panel>
    </div>
</asp:Content>

Below is the btnExport_Click: 


protected void btnExport_Click(object sender, EventArgs e)
{
    grdUserLoad.MasterTableView.ExportToExcel();
}

In the btnSearch click event I fill in the grid. I tried with EnableViewState = true and/or with NeedDataSource where I fill the Grid again just in case while exporting it may need it. But nothing works.
Manas
Top achievements
Rank 1
 answered on 29 Jun 2012
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?