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

Basically, I just took an demo of the RadGrid object and modified the code to allow me to bulk enter donations into our membership database.

My problem is that as soon as I select a value from either of the dropdowns and change focus to another object, the selected value is lost.

 

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

        <style type="text/css">
        li.rlbItem .rlbText {
            color: red;
        }
         
        .message {
            line-height: 37px;
        }
 
        .RadGrid .rgRow,
        .RadGrid .rgAltRow {
            height: 30px;
        }
 
        .RadGrid_Silk .rgRow,
        .RadGrid_Silk .rgAltRow,
        .RadGrid_Glow .rgRow,
        .RadGrid_Glow .rgAltRow {
            height: 36px;
        }
 
        .RadGrid_MetroTouch .rgRow,
        .RadGrid_MetroTouch .rgAltRow,
        .RadGrid_BlackMetroTouch .rgRow,
        .RadGrid_BlackMetroTouch .rgAltRow {
            height: 46px;
        }
    </style>
        <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="SavedChangesList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ConfigurationPanel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="ConfigurationPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>
    <telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecorationZoneID="demo" DecoratedControls="All" EnableRoundedCorners="false" />
    <div id="demo" class="demo-container no-bg">
        <h1>Donations</h1>
        <telerik:RadListBox RenderMode="Lightweight" runat="server" ID="SavedChangesList" Width="600px" Height="200px" Visible="false"></telerik:RadListBox>
        <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True" PageSize="10" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"
            OnItemUpdated="RadGrid1_ItemUpdated" AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand" DataSourceID="SqlDataSourceDonations">
            <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="DonationID"
                DataSourceID="SqlDataSourceDonations" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
                <BatchEditingSettings EditType="Cell" HighlightDeletedRows="true"/>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="Envelope" SortOrder="Ascending" />
                </SortExpressions>
                <Columns>
                    <telerik:GridBoundColumn DataField="DonationID" HeaderStyle-Width="0px" HeaderText="DonationID"
                        SortExpression="DonationID" UniqueName="DonationID" ReadOnly="true" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridNumericColumn DataField="Envelope" HeaderStyle-Width="80px" HeaderText="Envelope"
                        SortExpression="Envelope" UniqueName="Envelope">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="Donor" HeaderStyle-Width="350px" HeaderText="Donor"
                        SortExpression="Donor" UniqueName="Donor" ReadOnly="true">
                    </telerik:GridBoundColumn>

                    <telerik:GridDropDownColumn DataField="Fund" HeaderStyle-Width="250px" HeaderText="Fund" ListTextField="Fund" ListValueField="Fund"  DataSourceID="SqlDataSourceFunds" DropDownControlType="DropDownList"
                        SortExpression="Fund" UniqueName="Fund">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridDropDownColumn>
                    <telerik:GridDateTimeColumn DataField="DonationDate" HeaderStyle-Width="120px" HeaderText="Donation Date"
                        SortExpression="DonationDate" UniqueName="DonationDate" DataFormatString="{0:yyyy-MM-dd}">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridDateTimeColumn>
                    <telerik:GridNumericColumn DataField="DonationAmount" HeaderStyle-Width="120px" HeaderText="Donation Amount"
                        SortExpression="DonationAmount" UniqueName="DonationAmount" DataFormatString="{0:C2}">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridNumericColumn>
                    <telerik:GridDropDownColumn DataField="PaymentType" HeaderStyle-Width="150px" HeaderText="Payment Type" ListTextField="PaymentType" ListValueField="PaymentType"  DataSourceID="SqlDataSourcePaymentTypes" DropDownControlType="DropDownList"
                        SortExpression="PaymentType" UniqueName="PaymentType">
                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
                            </RequiredFieldValidator>
                        </ColumnValidationSettings>
                    </telerik:GridDropDownColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this Donation?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" 
                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings AllowKeyboardNavigation="true"></ClientSettings>
        </telerik:RadGrid>
    </div>
    <asp:SqlDataSource ID="SqlDataSourceDonations" runat="server" ConnectionString="<%$ AppSettings: LocalConnectionInfo %>"
        DeleteCommand="Exec UpdateDonation;" 
        InsertCommand="Exec UpdateDonation 'NEW', @Envelope, '', null, null, @DonationDate, @DonationAmount, null, null, null, @Fund, null, null, 'Monetary', null, @PaymentType;"
        SelectCommand="Exec GetDonation @EnvelopeNumber=-1;"
        UpdateCommand="Exec UpdateDonation @DonationID, @Envelope, '', null, null, @DonationDate, @DonationAmount, null, null, null, @Fund, null, null, 'Monetary', null, @PaymentType;">
        <DeleteParameters>
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Envelope" Type="Int16"></asp:Parameter>
            <asp:Parameter Name="Fund" Type="String"></asp:Parameter>
            <asp:Parameter Name="DonationDate" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="DonationAmount" Type="Decimal"></asp:Parameter>
            <asp:Parameter Name="PaymentType" Type="String"></asp:Parameter>
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="DonationID" Type="String"></asp:Parameter>
            <asp:Parameter Name="Envelope" Type="Int16"></asp:Parameter>
            <asp:Parameter Name="Fund" Type="String"></asp:Parameter>
            <asp:Parameter Name="DonationDate" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="DonationAmount" Type="Decimal"></asp:Parameter>
            <asp:Parameter Name="PaymentType" Type="String"></asp:Parameter>
        </UpdateParameters>
    </asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSourceFunds" runat="server" ConnectionString="<%$ AppSettings: LocalConnectionInfo %>"
        SelectCommand="Exec GetValidFunds;">
    </asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSourcePaymentTypes" runat="server" ConnectionString="<%$ AppSettings: LocalConnectionInfo %>"
        SelectCommand="Exec GetValidPaymentTypes;">
    </asp:SqlDataSource>

</asp:Content>

Attila Antal
Telerik team
 answered on 09 Jul 2020
1 answer
136 views

Hi,

 

how can I export both pivotgrid and radgrid to one Excel worksheet?

I know how to export each of them separately but together- nothing worked for me.

 

thanks

Attila Antal
Telerik team
 answered on 09 Jul 2020
8 answers
489 views
I have a Radgrid that has AllowMultiRowSelection="True". However in my code behind I have logic to disable and hide certain rows.

In RadGrid1_ItemDataBound I have this snippet of code to disable and hide rows that should not be checked.
((e.Item as GridDataItem)["ClientSelectColumn"].Controls[0] as CheckBox).Enabled = false;
((e.Item as GridDataItem)["ClientSelectColumn"].Controls[0] as CheckBox).Visible = false;

The issue I am having is that even though the checkbox is not enabled and hidden for certain rows when I click on the checkbox in the header of the RadGrid, even the rows in the RadGrid that don't have a checkbox are highlighted. 

I only want the rows in the RadGrid to highlight the ones with checkboxes when a user selects the checkbox in the header and not the ones that I have hidden the checkbox.  What is the best and most practical way to achieve this scenario?

Albert Shenker
Top achievements
Rank 1
Veteran
Iron
 answered on 07 Jul 2020
0 answers
206 views

I made this scheduler object:

<telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="RadScheduler"
    FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" OverflowBehavior="Expand" SelectedView="MonthView"
    DayStartTime="08:00:00" DayEndTime="19:59:59" WorkDayStartTime="08:00:00" WorkDayEndTime="20:00:00"
    ShowAllDayRow="true" ShowFullTime="true" AllowDelete="true" AllowEdit="true" AllowInsert="true"
    StartEditingInAdvancedForm="true" StartInsertingInAdvancedForm="true" EnableDescriptionField="true"
    EnableExactTimeRendering="true" ShowFooter="true"
    Reminders-Enabled="false" EnableRecurrenceSupport="false"
    OnAppointmentDataBound="RadScheduler_AppointmentDataBound"
    OnAppointmentInsert="RadScheduler_AppointmentInsert"
    OnAppointmentDelete="RadScheduler_AppointmentDelete"
    OnAppointmentUpdate="RadScheduler_AppointmentUpdate"
    AppointmentStyleMode="Auto" OnFormCreated="RadScheduler_FormCreated"
    DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End" DataDescriptionField="Description" ToolTip="Subject">
    <AdvancedForm Modal="true"></AdvancedForm>
    <MultiDayView UserSelectable="false" />
    <TimelineView UserSelectable="false" />
    <MonthView UserSelectable="true" />
    <AgendaView UserSelectable="true" />
    <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
    <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
</telerik:RadScheduler>
 

When use, in code behind, the insert  ("RadScheduler_AppointmentInsert") or delete ("RadScheduler_AppointmentDelete") methods the scheduler refresh the appoitments correctly, withouth the necessity to use a rebind() option.

protected void RadScheduler_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
{
    Bisiona.ACE.Eal.Tenders.Appointment appointment = new Bisiona.ACE.Eal.Tenders.Appointment();
    appointment.ID = null;
    appointment.Subject = e.Appointment.Subject;
    appointment.Start = e.Appointment.Start;
    appointment.End = e.Appointment.End;
    appointment.Description = e.Appointment.Description;
    appointment.Calendar = e.Appointment.Resources.GetResourceByType("Calendar").Key.ToString();
    appointment.Color = e.Appointment.Resources.GetResourceByType("Color").Key.ToString();
    if (TenderActual != null) {
        appointment.TenderID = TenderActual.TenderID;
        appointment.VersionID = TenderActual.Version.VersionID;
    }
    if (UsuarioActual != null)
    {
        appointment.RoleID = UsuarioActual.Role.RoleID;
        appointment.CodUsuario = UsuarioActual.CodUsuario;
    }
 
    bool result = false;
    string ID = string.Empty;
    result = Bisiona.ACE.Bll.Tenders.CalendarBo.SetCalendarAppointment(appointment, ref ID);
 
    if (result)
    {
        e.Appointment.ID = ID;
        e.Appointment.ToolTip = e.Appointment.Subject;
        ((Master)this.Page.Master).ShowNotification(GetLocalResourceObject("msgSaveAppointment").ToString(), "save");
    }
    else
    {
        e.Appointment.Visible = false;
        ((Master)this.Page.Master).ShowNotification(GetLocalResourceObject("msgErrorAppointment").ToString(), "error");
    }
}
protected void RadScheduler_AppointmentDelete(object sender, AppointmentDeleteEventArgs e)
{
    bool result = false;
    result = Bisiona.ACE.Bll.Tenders.CalendarBo.DelCalendarAppointment(e.Appointment.ID.ToString());
 
    if (result)
        ((Master)this.Page.Master).ShowNotification(GetLocalResourceObject("msgDeleteAppointment").ToString(), "save");
    else
        ((Master)this.Page.Master).ShowNotification(GetLocalResourceObject("msgErrorAppointment").ToString(), "error");
}

 

But, when use the update method ("RadScheduler_AppointmentUpdate") I recived correctly the Appointment and ModifiedAppoitment objects. 

In this method, I can persist the object in database but the scheduler doesn't refresh.

 

 

protected void RadScheduler_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
    Bisiona.ACE.Eal.Tenders.Appointment appointment = new Bisiona.ACE.Eal.Tenders.Appointment();
    appointment.ID = e.Appointment.ID.ToString();
    appointment.Subject = e.ModifiedAppointment.Subject;
    appointment.Start = e.ModifiedAppointment.Start;
    appointment.End = e.ModifiedAppointment.End;
    appointment.Description = e.ModifiedAppointment.Description;
    appointment.Calendar = e.ModifiedAppointment.Resources.GetResourceByType("Calendar").Key.ToString();
    appointment.Color = e.ModifiedAppointment.Resources.GetResourceByType("Color").Key.ToString();
    if (TenderActual != null)
    {
        appointment.TenderID = TenderActual.TenderID;
        appointment.VersionID = TenderActual.Version.VersionID;
    }
    if (UsuarioActual != null)
    {
        appointment.RoleID = UsuarioActual.Role.RoleID;
        appointment.CodUsuario = UsuarioActual.CodUsuario;
    }
 
    bool result = false;
    result = Bisiona.ACE.Bll.Tenders.CalendarBo.UpdateCalendarAppointment(appointment);
 
    if (result)
        ((Master)this.Page.Master).ShowNotification(GetLocalResourceObject("msgSaveAppointment").ToString(), "save");
    else
        ((Master)this.Page.Master).ShowNotification(GetLocalResourceObject("msgErrorAppointment").ToString(), "error");
}

 

I try also to do a rebind at the end, but nothing happend. 

I want to call to database as less as possible.

Any Ideas?

Thank you so much.

 

 

Álvaro
Top achievements
Rank 1
 asked on 07 Jul 2020
3 answers
318 views
I have a password input box with some password strength settings and an indicator show the password strength. That works fine, getting the password work fine.

But now I would like the password strength settings to be enforced and reject non complying passwords.  Is there a way to know the constraints are satisfied short of writing my own code the count lower case/upper case/number/special characters myself?

The documentation says nothing and the password examples do not submit.

Thanks,
George
liu
Top achievements
Rank 1
Veteran
 answered on 07 Jul 2020
1 answer
165 views
Hi ,
     I used three RadToolBarButton with image only in RadToolBar control , how to align all are in center position with Separator.
Screenshot -- http://prntscr.com/tchs0y
Like this -- http://prntscr.com/tchsun

Thanks
M Kumar
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 07 Jul 2020
8 answers
625 views

I am using radgird and allowing filters on all columns. I have 3 columns on grid and I am binding those columns dynamically using vb.net code behind.
On UI page I have only the below script:

<telerik:RadGrid ID="gridData" runat="server" Visible="true" RenderMode="Native"> </telerik:RadGrid>

The problem is that when I apply filter on one column that is worked fine now simultaneously I apply filter on second column then it removes the filter of first column. Please see the attached screenshot.

In code behind I have grid event like:
Protected Sub gridData_NeedDataSource(ByVal Source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gridData.NeedDataSource

but this event is also not firing in any case.

Any idea about filtering on multiple columns issue?

Attila Antal
Telerik team
 answered on 07 Jul 2020
6 answers
401 views
When we use the RadBarcode.GetImage() running the asp.net 4.0 site inside the visual studio 2012 IDE all is well and we can save and display the png on our site.  When  running the site on the server we get the following error:

A generic error occurred in GDI+.    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
   at System.Drawing.Image.Save(String filename, ImageFormat format)

No other error information is provided.   Are there perhaps some other support assemblies needed that may be needed on the server?    This telerik upgrade is being tested on 2003 server, where all other telerik stuff works just fine for a number of sites.  Is it possible the older server just doesn't support some GDI+ functionality that you require, and our only option is to move to server 2008?

We are in the process of switching our sites from rather ancient Windows Server 2003 to Windows Server 2008 so that's not a show-stopper.  We just weren't quite ready to deploy this testing site there.
Paolo
Top achievements
Rank 2
 answered on 07 Jul 2020
6 answers
633 views

I'm looking for a server side event that will fire after the menu has been rendured in the master page but before control is passed to the main page. So effectively before OnLoad. 

 

Any suggestions? 

The application is translating a website built with MS tools and they filter the menu system based on the logged in user on the computer. 

 

Thanks!

Bernie
Top achievements
Rank 1
Iron
Iron
 answered on 06 Jul 2020
7 answers
187 views

Hi, 
   I generate RadTabStrip theme builder using following link https://themebuilder.telerik.com/aspnet-ajax.In that i used Material theme and color swatches as Blue Light, and generated css and imported in my same testing page - http://prntscr.com/qcyymj , and output is http://prntscr.com/qcyz40 , 
but in theme builder - http://prntscr.com/qcz00i

 

Pls reply asap

Thanks

 

 

M Kumar
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 06 Jul 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?